Search Unity

SSAO problem

Discussion in 'Shaders' started by arturmandas, Aug 26, 2015.

  1. arturmandas

    arturmandas

    Joined:
    Sep 29, 2012
    Posts:
    240
    I have a problem with SSAO shader. My scene consists of 3D tiles of objects snapped side to side - think of corridor made of segments.
    The problem is there are very apparent dark areas near the edges, where one would expect no shade to be. I mean, visually there is surface continuity there, but as the shader works using edge detection, it detects the edges and applies shading.
    Has somebody dealt with the problem? Are there any remedies?
    I must say that this problem pertains to Screen Space Ambient Occlusion shader - with Screen Space Ambient Obscurance this does not occurs, but there are other issues - like ring-shaped bands over the entire scene, making the shader useless.

    Thank you in advance
     
  2. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
    Have you tried fiddling with the near and far clippping plane of the camera? Are you using orthographic projection or perspective? I've run into some issues related to both things when using SSAO.
     
    arturmandas likes this.
  3. arturmandas

    arturmandas

    Joined:
    Sep 29, 2012
    Posts:
    240
    Thank you Martin, you made my day. I've tried fiddling, but with Zwrite Off and other things, haven't thought about this solution. Anyway, changing near clipping plane to about 20 units removed almost all artifacts. I can live with that. Thank you.
     
    Martin_H likes this.