Struggling to fix this issue, now day 2 of this and I keep running into the same banding issue, with different pass setups.
renderer.setClearColor('#000000');
const bloomPass = new UnrealBloomPass(new THREE.Vector2(width, height), 1, 1, 0.75);
const copyPass = new ShaderPass(CopyShader);
copyPass.renderToScreen = false;
bloomPass.renderTargetsHorizontal.forEach((element) => {
element.texture.type = THREE.FloatType;
});
bloomPass.renderTargetsVertical.forEach((element) => {
element.texture.type = THREE.FloatType;
});
const composer = new EffectComposer(renderer);
composer.renderer.outputEncoding = sRGBEncoding;
composer.setSize(width, height);
composer.setPixelRatio(density);
const normalRender = new RenderPass(scope.scene, scope.cameraManager.camera);
composer.addPass(normalRender);
composer.addPass(bloomPass);
composer.renderer.toneMapping = ACESFilmicToneMapping;
THREE.ShaderChunk.tonemapping_pars_fragment = THREE.ShaderChunk.tonemapping_pars_fragment.replace(
'vec3 CustomToneMapping( vec3 color ) { return color; }',
`#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )
float toneMappingWhitePoint = 1.0;
vec3 CustomToneMapping( vec3 color ) {
color *= toneMappingExposure;
return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );
}`,
);
env map setup
cubeTextureLoader.loadAsync([`${map}_px.jpg`, `${map}_nx.jpg`, `${map}_py.jpg`, `${map}_ny.jpg`, `${map}_pz.jpg`, `${map}_nz.jpg`]).then((textureCube) => {
this.scene.environment = textureCube;
textureCube.encoding = sRGBEncoding;
this.scene.background = textureCube;
});
Is there anything I am missing?
Using ThreeJS 133.1
By the way when i add the following to the end, the entire scene becomes dark so thats why its not in there yet :
composer.addPass(copyPass);
Edit: I realised this always happens when you add unreal bloom pass into the effect composer, it just creates a colour banding