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

Resolved Mesh issues when surface type is set to transparent

Discussion in 'Shader Graph' started by PaperMouseGames, Oct 27, 2022.

  1. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    434
    So I'm trying to make a shader graph and I'm running into an issue when using on meshes: Shader Transparancy Issue.gif

    When I set the Surface Type in the shader graph to opaque it works as expected but I want to be able to make the materials transparent sometimes so I wanted to use transparent surface type.

    Any idea how to fix this? I'm not sure where to start...
     
  2. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    631
    Hi, are you using URP 12 and above (or HDRP)?

    This is because transparent objects don't write depth by default during rendering.

    You can try switching to the Force Depth Write option:
    ShaderGraph_ForceDepthWrite.jpg
     
    PaperMouseGames likes this.
  3. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    434
    That did it! Thanks so much!

    I'm still pretty new to shaders and I wasn't sure what info to include, but for anyone finding this in the future, I'm using URP 12.1.7
     
    wwWwwwW1 likes this.
  4. DhiaSendi

    DhiaSendi

    Joined:
    May 16, 2018
    Posts:
    42
    For some reasons, Depth write option is not shown to me upload_2023-6-20_10-48-13.png