Search Unity

Shadow & sorting issues with vertex colored PBR Shader Graph

Discussion in 'Shaders' started by ASFghost, May 1, 2018.

  1. ASFghost

    ASFghost

    Joined:
    Nov 21, 2016
    Posts:
    10
    I'm working on a custom vertex colored PBR shader, using Unity's new shader graph feature. I would like to recreate this shader I was using previously, and was wondering what would be the best way to do in the shader graph? This is what I have so far:
    5118_ShaderSetup.jpg

    It works well and even supports vertex color alpha transparency, but there are a few issues with it:
    • Shadows can be seen through transparent faces, no matter how high the alpha value is for the colors.
      2018-05-01_12-57-06.png
    • There is an obvious transparency sorting issue, since all objects are all apart of the same mesh. I was able to fix this with the previous shader by applying this fix, but don't know how to implement it in the graph.
      2018-05-01_13-09-32.png
    • Shadows are all the same, no matter the alpha value for vertex colors.
      2018-05-01_13-43-05.png
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Looks like a bug. Is this the LW SRP? They moved from doing the shadows in the shader to doing the shadows in a depth pre-pass like Unity's existing forward pass which breaks shadow receiving for transparent objects, but it looks like they forgot to update the Shader Graph to not sample the screen space shadows in transparent shaders.

    The Shader Graph cannot do multi-pass shaders (yet?), so it's not possible to recreate the shader you linked to with it.

    The LW SRP doesn't support transparent shadows like Unity's existing Standard shader does, only opaque or cutout, and there isn't a way to implement this feature with a Shader Graph either.

    You should probably post all this in the shader graph feedback thread:
    https://forum.unity.com/threads/feedback-wanted-shader-graph.511960/
     
  3. ASFghost

    ASFghost

    Joined:
    Nov 21, 2016
    Posts:
    10
    Thanks for the reply, I appreciate it. Yes, it's the lightweight SRP.

    I think it might be best to just buy another editor for creating custom vertex color shaders.
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    As a warning, these limitations are pretty common for node based shader editors. Even Unreal has the same limitations technically.
     
    ASFghost likes this.
  5. anasainea

    anasainea

    Joined:
    Apr 7, 2015
    Posts:
    4
    it is been a year but no progress on this?
     
  6. Blarghle

    Blarghle

    Joined:
    Aug 19, 2014
    Posts:
    19
    I'm still seeing this in 2019.2.8f1. I'd love to see this fixed!