Reflector (WebGLRenderTarget): Fog Color problem in sRGB outputEncoding
See original GitHub issueFrom https://github.com/mozilla/hubs/issues/5572
Describe the bug
Fog color in Reflector
(WebGLRenderTarget
) can mismatch the one in the main scene.
I made an online example to show the problem.
https://raw.githack.com/takahirox/three.js/MirrorFogExample/examples/webgl_mirror_fog.html
Screenshots
sRGB output encoding + fog. Fog color in the reflector looks brighter than the one in the main scene. (See the green wall.)
sRGB output encoding + no fog. Color in the reflector looks the same as the one in the main scene.
Linear output encoding + fog. Fog color in the reflector looks the same as the one in the main scene.
Live example
https://raw.githack.com/takahirox/three.js/MirrorFogExample/examples/webgl_mirror_fog.html
Expected behavior
Fog color in the reflector looks same as the one in the main scene even in sRGB outputEncoding.
Platform:
- Device: Desktop
- OS: Windows 10
- Browser: Chrome
- Three.js version: dev
Issue Analytics
- State:
- Created a year ago
- Comments:12 (2 by maintainers)
Top GitHub Comments
Fog should be applied in scene-referred linear color space.
Since tone mapping converts from scene-referred color space to display-referred color space, the fog chunk should precede tone mapping.
Ideally, we should adhere to that convention – and make whatever changes are required to accommodate it.
/ping @donmccurdy (color management) /ping @bhouston (legacy conventions)
Unfortunately the problem doesn’t seem to be resolved yet