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

Resolved [Unity 2020.2.0f] Transparent Shader with vertex displacement flickers with Transparent Prepass

Discussion in 'High Definition Render Pipeline' started by magehuntz, Dec 17, 2020.

  1. magehuntz

    magehuntz

    Joined:
    Mar 24, 2017
    Posts:
    27
    This water shader flickers and I don't know why. If I remove the vertex displacement, the flickering stops (that's what I've done at the end of the video). What's funny is that if I turn the transparent prepass off under HDRP Settings, the flickering also stops, even if the vertex displacement is on, but the screen space reflection disappears as a result. I'd like to keep both vertex displacement and SSR on, but I can't get rid of this flickering. Does anybody know how to deal with this?

    The fact that this seems to be related to the transparent prepass is what made me post here instead of the shader graph sub-forum.
     
  2. magehuntz

    magehuntz

    Joined:
    Mar 24, 2017
    Posts:
    27
    For a little more context:

    -I'm using a shader graph which implements the gerstner waves algorithm, so it modifies the vertex positions, tangent and normals.
    -By turning off Transparent depth prepass inside the HDRP Asset, it renders perfectly (no flickering), but Transparent SSR stops completely.
    -While Transparent depth prepass is on, turning off the screen space reflections doesn't stop the flickering.
    -If i remove either the vertex displacement or both the normal and tangent in the vertex shader, it also stops flickering.


    Possible causes that I've already checked and aren't the issue:
    -The model doesn't have double faces
    -There are no anomalies or discontinuities in the normal and tangent outputs
    -Toggling depth writing on/off doesn't solve the problem
    -Turning the directional light/sky light off doesn't solve the problem, it really seems to be a normal/sorting issue.
    -I've tried toggling various options on the HDRP Asset settings, material settings and default HDRP settings, but nothing apart from turning off the Transparent depth prepass seem to stop the flickering.
     
  3. magehuntz

    magehuntz

    Joined:
    Mar 24, 2017
    Posts:
    27
    Alright, so the issue has been solved. I don't know what caused it, but creating the shader from scratch made the artifacts go away. This started happening when I updated my project from 2020.2.0b7 to 2020.2.0f, so it probably had something to do with the automatic updating of the materials or something along those lines. I think the team should look into that, because the functionality of the shader remained exactly the same, and yet it became like that without even throwing an error message.