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
WebGLRenderer: Remove gammaOutput, introduce outputEncoding. #18127
Conversation
It is not appropriate to use both of these patterns in the same example: renderer.outputEncoding = THREE.GammaEncoding;
texture.encoding = THREE.sRGBEncoding; Doing so will cause color distortion. In the examples, use Some users prefer the flexibility of |
I've just tried to retain the current visuals as good as possible. If things can be improved, I'm glad to do this with this PR. |
Do you have an example already in mind? |
It would have to be one without textures, I guess... |
How about |
Or none. I don't have a strong opinion on that. |
Then I would leave it out for now since the API is proper documented. If necessary, we can still update one of the examples in the future. |
Many thanks! |
Yay! It's great to get rid of |
So many things are being solved in this release 😍 |
I would say it's the best release of 2019 😁 |
Getting it ready for the next decade 😀 |
As proposed in #11337.
This PR removes
gammaOutput
and introducesoutputEncoding
as a replacement.gammaOutput
can still be used, however a warning will be generated. The renderer ensures to update materials ifoutputEncoding
is changed during runtime.There is in subtle change that needs some highlight:
getTextureEncodingFromMap()
does only depend from the given map now. That means the previous behavior of automatically setting theencoding
of a render target's textures toGammaEncoding
ifgammaOutput
istrue
does not exist anymore. This is also the correct behavior from my point of view. Meaning, when using post-processing viaEffectComposer
,WebGLRenderer.outputEncoding
should not be changed and gamma correction should be done viaShaderPass
andGammaCorrectionShader
. Check out howwebgl_materials_normalmap
is written now to see this idea in action.