Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Screen Space Ambient Occlusion and Transparency

Discussion in 'Universal Render Pipeline' started by SniperED007, Mar 25, 2021.

  1. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    341
    Shouldn't there be a dropdown on the SSAO Renderer Feature to select when you want to insert the effect?

    Drawing ambient occlusion after transparency looks terrible:
    upload_2021-3-25_15-11-44.png

    Unity 2021.1.0f1
     
  2. xgonzal2

    xgonzal2

    Joined:
    Jul 3, 2012
    Posts:
    62
    We ran into this issue a while back. I think what was going on was that any transparent shader that has the multi compile for screen space AO would also sample the AO texture. Since we were already modifying URP source our solution ended up being disabling AO during transparency rendering from within the DrawObjects render pass. I think you can do the same thing we did without modifying source with a custom scriptable render feature that disables SSAO just before rendering transparents.
     
  3. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    341
    Thanks for your response.

    I'll just stick with the one from the Asset Store then that works without having to hack it.
     
    PutridEx likes this.
  4. Elvar_Orn

    Elvar_Orn

    Unity Technologies

    Joined:
    Dec 9, 2019
    Posts:
    158
    Hey!
    That's a bug. Going to take a look today and see if I can find a solution for it.
    Thanks for letting us know.
     
    SniperED007 and Matt-Cranktrain like this.
  5. Kinetic

    Kinetic

    Joined:
    Jul 15, 2012
    Posts:
    26
    Yesterday I came across the same issue. Turns out I already had a material postprocessor for everything in my scene, so ended up having to disable the _SCREEN_SPACE_OCCLUSION and DepthNormals pass for all transparent materials to hopefully fix it.
     
  6. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    341
    Have you found a fix for it yet?
     
  7. xgonzal2

    xgonzal2

    Joined:
    Jul 3, 2012
    Posts:
    62
    https://github.com/Unity-Technologies/Graphics/pull/4025 looks like that will be the official solution. Essentially a new shader feature that gets enabled for transparent surfaces and if it is enabled then SSAO is not applied.
     
  8. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    341
    Is the fix not coming to 2021.1?