Search Unity

HDRP | Fading a GameObject or a Group of Gameobjects with Animation

Discussion in 'General Graphics' started by Werwei_Drefa, Dec 14, 2018.

  1. Werwei_Drefa

    Werwei_Drefa

    Joined:
    Aug 15, 2018
    Posts:
    1
    Hey Guys,

    i have a small problem with the StandardLit Shader on the HDRP.

    I would like to fade a group of GameObjects with an animation by modifying the alpha value of my BaseColor texture.
    On the Standard Render Pipeline i would change the Surface Type of the material to "Fade" and could animate it but there is no "Fade" Surface Type on the StandardLit shader of the HDRP.

    Setting the Shader Type on "Transparent" and modifying the alpha value with an animation does not seem to work nicely, because it produces wierd glitches underneath my transparent objects.

    Is there any way to achieve an object fade like on the Standard RP, on the HDRP?
    Or is there a smarter way to do this in general?

    Best regards,
    Eugen
     
    udunadmin likes this.
  2. DeanUC

    DeanUC

    Joined:
    Jun 12, 2017
    Posts:
    3
    I found this post because I was having this problem too. I have just discovered a solution (which may work for you) and thought you (and others) would like to know.

    When creating a shader using the Shader Graph, do the following:
    • Create a Lit Shader
    • Then on the "Lit Master" node select the cog icon in the top right corner.
    • Change the "Surface type" to "Transparent", the "Blending Mode" to "Alpha", and then finally untick the "Preserve Specular Lighting" option so that it is OFF
    • Expose the "Alpha" value
    I hope this helps!