# Dark lines on object from SAO when adjusting camera angle

**URL:** <https://discourse.threejs.org/t/dark-lines-on-object-from-sao-when-adjusting-camera-angle/4549>\
**Category:** Questions\
**Tags:** post-processing\
**Created:** [October 17, 2018, 9:51pm UTC](https://discourse.threejs.org/t/dark-lines-on-object-from-sao-when-adjusting-camera-angle/4549 "2018-10-17T21:51:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![afanton](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/afanton/32/2969_2.png) [@afanton](https://discourse.threejs.org/u/afanton)\
**Post date:** [October 17, 2018, 9:51pm UTC](https://discourse.threejs.org/t/dark-lines-on-object-from-sao-when-adjusting-camera-angle/4549/1 "2018-10-17T21:51:05Z")

</div>

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.

[Video of issue](https://www.dropbox.com/s/t19igfu86lq5wnr/SAO.mp4?dl=0)

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 );

---

<div class="post-metadata">

**Author:** ![marquizzo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marquizzo/32/25192_2.png) [@marquizzo](https://discourse.threejs.org/u/marquizzo)\
**Post date:** [October 18, 2018, 12:43am UTC](https://discourse.threejs.org/t/dark-lines-on-object-from-sao-when-adjusting-camera-angle/4549/2 "2018-10-18T00:43:04Z")

</div>

I’ve never used the SAO effect, but that looks an awful lot like [shadow acne](https://computergraphics.stackexchange.com/questions/2192/cause-of-shadow-acne). ThreeJS uses the [bias](https://threejs.org/docs/index.html#api/en/lights/shadows/LightShadow.bias) property to add/subtract a bit of distance when determining whether a plane is in shadow. Maybe you could try tweaking the `saoBias` parameter in your `params` object for a similar behavior?

---

<div class="post-metadata">

**Author:** ![afanton](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/afanton/32/2969_2.png) [@afanton](https://discourse.threejs.org/u/afanton)\
**Post date:** [October 18, 2018, 1:00am UTC](https://discourse.threejs.org/t/dark-lines-on-object-from-sao-when-adjusting-camera-angle/4549/3 "2018-10-18T01:00:32Z")

</div>

Hi Marquizzo. Thank you for your suggestion. Not sure why this worked, but I adjusted to scene camera far to 4,000 from 60,000 (the size of my scene) and the artifacts went away.
