When I move the camera to the top of my scene, the AO looks great on my model. As I rotate the camera down, dark lines begin to appear on the model, increasing in quantity as the camera gets lower to the ground plane. Is this due to the AO being created using an orthographic camera?
I am using SAOPass.js and SAOShader.js. I have not changed any of the code in those files.
CODE…
///////////// PREP EFFECT COMPOSER /////////////
effectComposer = new THREE.EffectComposer( renderer );
effectComposer.setSize( renderContainerWidth * window.devicePixelRatio, renderContainerHeight * window.devicePixelRatio);
///////////// RENDER PASS /////////////
var renderPass = new THREE.RenderPass( scene, camera );
renderPass.enabled = false;
effectComposer.addPass( renderPass );
///////////// TAA /////////////
var taaRenderPass = new THREE.TAARenderPass( scene, camera );
taaRenderPass.unbiased = true;
taaRenderPass.sampleLevel = 2;
effectComposer.addPass( taaRenderPass );
///////////// COPY PASS /////////////
var copyPass = new THREE.ShaderPass( THREE.CopyShader );
effectComposer.addPass( copyPass );
///////////// SAO /////////////
var params = {
output: 0,
saoBias: 1,
saoIntensity: .5,
saoScale: 200,
saoKernelRadius: 50,
saoMinResolution: .0002,
saoBlur: true,
saoBlurRadius: 1.5,
saoBlurStdDev: 38,
saoBlurDepthCutoff: .0001
}
saoPass = new THREE.SAOPass( scene, camera, false, true, {x:256,y:256}) ;
for( var e in params ) {
if( e in saoPass.params )
saoPass.params[e] = params[e];
}
saoPass.saoMaterial.defines[‘NUM_SAMPLES’] = 64;
saoPass.renderToScreen = true;
effectComposer.addPass( saoPass );