Search Unity

Question Upgraded 2020 Shader does not work anymore

Discussion in 'Shader Graph' started by alchemist_wurzelpurzel, Apr 27, 2022.

  1. alchemist_wurzelpurzel

    alchemist_wurzelpurzel

    Joined:
    Sep 4, 2018
    Posts:
    43
    Hi all!

    TLDR: A shader using Alpha Clipping and Scene Depth that worked in 2020 does not work as intended in 2021 anymore.

    We recently started the process to upgrade from Unity 2020 LTS (2020.3.17f1) and URP 10.6.0 to Unity 2021 LTS (2021.3.1f1) and URP 12.1.6.

    Now we have an issue with one of our Shader Graph Shaders that relies on Scene Depth and Alpha Clipping and since we are no experts on shaders, we are at a loss.
    The mentioned Shader is responsible for an Acid Puddle VFX. It's basically just applied to a simple Mesh, animating a Noise Texture and, more importantly, supposed to slightly highlight intersections with other geometry.

    It used to work in Unity 2020 (see screenshot 1) but now in 2021 the Mesh just isn't visible anymore due to the Alpha having an unintendedly low value across the whole Mesh (see screenshot 2).

    The Shader uses a subgraph that is reused elsewhere to use the depth information which is then used with Alpha Clipping to only highlight parts that intersect with other geometry and I am fairly confident that the issue lies there somewhere.
    I attached both the Shadergraph and the Subgraph.

    We did look through all the changes that were made from 2020 to 2021 but we couldn't make out anything that might have caused this so I am hoping someone here can give us a hint.

    Thank you!
     

    Attached Files:

  2. jburchamerwin

    jburchamerwin

    Joined:
    Oct 18, 2021
    Posts:
    1
    Hope this might help you: I had a similar issue with shader graph shaders that use depth on the update from LTS 2020 to 2021. I solved it by changing the depth buffering setting in the URP asset to "forced."