expenses / mateversum

Mateversum is a peer-to-peer WebXR metaverse project. Binary: https://github.com/expenses/mateversum-web
https://expenses.github.io/mateversum-web
MIT License
24 stars 1 forks source link

Unlit materials probably shouldn't be tonemapped #37

Open expenses opened 2 years ago

expenses commented 2 years ago

https://gltf-viewer.donmccurdy.com/ displays the Alicia.vrm VRM sample as like this:

20220627_17h18m08s_grim

while we currently render Alicia.VRM like this:

20220627_17h18m02s_grim

This is because we're doing tonemapping for unlit materials but probably shouldn't be.

This is very solveable when doing inline tonemapping - just don't tonemap and just do the linear-to-srgb conversion instead! But when we're doing a seperate tonemapping pass it gets harder. How do we tell that a fragment should be tonemapped or not? Perhaps we could write to the alpha channel and tonemap if the alpha is 1.0 and not if it's 0.0.

expenses commented 2 years ago

I've implemented the inline tonemapping solution in this superconductor commit: https://github.com/expenses/mateversum/commit/46fffce3e77f047ccb47f917c2ca0698b4a790e2.