As mentioned earlier in this topic, you have to use a gamma correction pass if you use post processing. WebGLRenderer.outputEncoding
is only evaluated when you directly render to the default frambebuffer or screen. Besides when you pass in a predefined render target to EffectComposer
, you already have to define the correct type (THREE.FloatType
) for this render target. Otherwise do it like in the below fiddle and pass no render target to EffectComposer
.
OK, I hadn’t realized GammaCorrectionShader
referred to an external class that had to be imported manually and was a necessary addition to apply gamma correction when using EffectComposer
. It is a bit surprising to require an additional non-built-in file when none was required before v112.
In any case, thank you!
Before R112
, most devs performed gamma correction at the wrong place. In most scenarios, it should be performed at the end of the pass chain, not when producing the render pass. So working with GammaCorrectionShader
is actually more correct. And it’s worth the migration effort.
An alternative that worked for me is to perform gamma correction at the end of each one of my geometry shaders so I get the correct final result regardless of whether I’m rendering to canvas or to a RenderTarget
. This lets me deal with post-processing shaders in linear space, without needing a final color-correction pass. And I can also turn post on/off at will.