-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reflector Color Space Issues #24384
Comments
If |
@Mugen87 You are correct. That is a very good way of thinking about it. The reflector should include the tone mapping fragment. |
If we just include This can only be fixed if tone mapping is disabled when the beauty pass is performed (and then enabled back again). The code for this needs to be placed around this line of code: three.js/examples/jsm/objects/Reflector.js Line 158 in 7ad7827
I would say it's indeed more correct to add the tone mapping fragment and update |
I am inclined to agree with what I intended to say in my original post, but did not say very precisely.
|
I am opening this as a separate issue in the hope we can keep the discussion focused.
Note that "color space" and "encoding" have still not been decoupled in the shader, so I am using legacy terminology here. Hopefully that will end soon.
Reflector
should render in scene-referred linear color space -- to a float or half-float render target. (Or to an RGBM-encodedUInt8
render target.) This is true, regardless of the renderer's output encoding. Setting the Reflector'srenderTarget.texture.encoding
torenderer.outputEncoding
is not the right thing to do.Consequently, it is only correct to include
encodings_fragment
in the reflector's fragment shader if it is needed for something like RGBM encoding. But three.js no longer supports such encodings.When encoding to
sRGB
color space, tone mapping must proceed encoding. This is to ensure the inputs to the encoding step are in LDR.Reflector
includes the encoding fragment, but not tone mapping fragment. Ideally, it should not include either of them.Granted, encoding to sRGB and then decoding to linear-sRGB when reading back should not make a vast visual difference, except for rounding due to the Uint8 conversion. But still, it is unnecessary.
Feedback welcome.
three.js version: [r.142]
The text was updated successfully, but these errors were encountered: