Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Post-Processing Stack Ambient Occlusion Causes Dark Edges Around Foliage

Discussion in 'General Graphics' started by lamplightforest, Jun 5, 2019.

  1. lamplightforest

    lamplightforest

    Joined:
    Aug 23, 2015
    Posts:
    12
    I'm using Post Processing stack v1 and the Ambient Occlusion causes dark boxes around foliage. The only way to get rid of them is to have the ambient occlusion settings so far down that they're not even visible. This is possibly an OSX only issue, I haven't seen it on Windows builds

    139052-show-ambient-occlusion-issue-in-forums-copy.jpg
     
    protopop likes this.
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Are you using a custom shader for the foliage and the forward rendering path? When using the forward rendering path, AO uses the camera depth and / or camera depth normals textures. The camera depth texture is generated by rendering the scene using each shader's shadow caster pass, but the depth normals texture is generated using a replacement shader pass. My guess is the shader you're using for foliage is set to be "RenderType"="Opaque" or "RenderType"="TransparentCutout" but doesn't have the alpha in the _MainTex or isn't using a _Cutoff material property that the replacement shader is expecting.
     
    protopop and SpencerPDX like this.
  3. lamplightforest

    lamplightforest

    Joined:
    Aug 23, 2015
    Posts:
    12
    Hm no just using Speedtree's regular shader, but I am using forward rendering. I've done some more tests and it does seem to be an OSX-only problem, Windows is fine. Any idea why that might be?
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Nope, I've never done any MacOS dev. Sorry.
     
  5. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    This probably isn't too helpful but I do know that the issue is related to Speedtree shaders and not so much Post-Processing, I ran into this way back with my own AO on 5.x, same issue. Try looking at the debug views for depth/depthnormals - if you see a big square there where you see the AO incorrectly applying - it's speedtree causing it.
     
    adroitclippingpath likes this.
  6. adroitclippingpath

    adroitclippingpath

    Joined:
    Dec 2, 2018
    Posts:
    3
    I am trying to understand
     
  7. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    Thank you thread for helping me investigate this.

    I fixed it by changing the shader (in amplify) from transparent-cutout to transparent