ShaderChunk: Added transmission alpha support by mrdoob · Pull Request #22425 · mrdoob/three.js (original) (raw)

That's awesome! To recount an offline conversation, I believe there is no way to apply true physically-based rendering to the compositing step where a transparent canvas is stacked on an HTML background. Fundamentally, background-color does not represent light intensity, refraction is impossible, etc. However, it is still a very valuable use case (transparent objects in AR require this since the camera image is not available to JS, not to mention all kinds of cute web design cases). I think it's worth making a non-physical heuristic to handle this situation.

I propose we transform output alpha, where 1 = 1 and 0 = x, where x > 0. I suppose we could try 0.5 and see how it goes. The idea is that opaque objects are opaque, but completely transparent objects are not completely transparent because we calculated specular reflections for them which we do not want composited away. It will definitely have all kinds of weird edges cases, but if we can make it look halfway decent, I think it'll be quite valuable. And it'll have no effect on alpha = false canvases.