I am attempting to merge SMAA and SSAO within my THREE.EffectComposer
as shown below:
this.composer = new THREE.EffectComposer(this.renderer);
// Setting up depth pass
depthMaterial = new THREE.MeshDepthMaterial();
depthMaterial.depthPacking = THREE.RGBADepthPacking;
depthMaterial.blending = THREE.NoBlending;
var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter };
depthRenderTarget = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, pars );
// Setting up SSAO pass
ssaoPass = new THREE.ShaderPass( THREE.SSAOShader );
ssaoPass.renderToScreen = true;
ssaoPass.uniforms[ "tDepth" ].value = depthRenderTarget.texture;
ssaoPass.uniforms[ 'size' ].value.set( window.innerWidth, window.innerHeight );
ssaoPass.uniforms[ 'cameraNear' ].value = this.camera.near;
ssaoPass.uniforms[ 'cameraFar' ].value = this.camera.far;
ssaoPass.uniforms[ 'onlyAO' ].value = false;
ssaoPass.uniforms[ 'aoClamp' ].value = .3;
ssaoPass.uniforms[ 'lumInfluence' ].value = 1;
this.ssaoPass = ssaoPass;
this.depthRenderTarget = depthRenderTarget;
smaapass = new THREE.SMAAPass( window.innerWidth, window.innerHeight );
smaapass.renderToScreen = true;
this.composer.addPass(new THREE.RenderPass(this.scene, this.camera));
this.composer.addPass(ssaoPass);
this.composer.addPass(smaapass);
However, only smaapass seems to be applied. I have tried changing the order of composer.addPass
but it did not work. What could I be doing wrongly? Thank you!