I'm trying to do post processing in threejs scene here I'm using EffectComposer for doing it but im not able to enble sRGBEncoding in renderTarget.
const renderTarget = new THREE.WebGLRenderTarget(
sizes.width,
sizes.height,
{
minFilter:THREE.LinearFilter,
magFilter:THREE.LinearFilter,
format:THREE.RGBAFormat,
encoding:THREE.sRGBEncoding
}
)
and my effectComposer is like that
const effectComposer = new EffectComposer(renderer,renderTarget);
effectComposer.setPixelRatio(Math.min(window.devicePixelRatio,2));
effectComposer.setSize(sizes.width,sizes.height)
but sRGBEncoding is not working

When using post processing, use a gamma correction pass at the end of your pass chain. This will ensure a sRGB encoded output:
composer.addPass( new ShaderPass( GammaCorrectionShader ) );
Full example: https://threejs.org/examples/webgl_postprocessing_3dlut
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With