Search Unity

Feature Request Shader graph: SV_Depth output and vertex attributes

Discussion in 'Graphics Dev Blitz Day 2023 - Q&A' started by Nexusmaster, May 25, 2023.

  1. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hello,

    there is a bug with DX12 ( and Vulkan) with shader graph not rendering DrawProcedural, because the vertex attributes are missing, I could fix that bug by modifying the generated shader from the shader graph, however, it would be great if you guys could implement this properly, for not only HDRP but also URP and Built-in. Think it's not that complicated, here is the link, I also posted my working solution for HDRP there:

    https://forum.unity.com/threads/drawproceduralindirect-broken-in-2021-2-with-dx12-vulkan.1139248/

    Another feature request is the ability to access the SV_Depth output not only for HDRP, but also for URP and Built-in with shader graph. See here:

    https://forum.unity.com/threads/dep...t-terrain-blending-billboard-shadows.1428033/

    @ Unity graphics team:
    Thanks for the great work guys!
    Besides these issues, I'm really happy with the new shader graph and how HDRP and URP turn out!

    Best,
    Chris
     
    Matjio likes this.
  2. dnach

    dnach

    Unity Technologies

    Joined:
    Mar 9, 2022
    Posts:
    89
    Hey!

    Regarding the first issue, looking at the thread above, it seems like you are declaring the semantic for vertex input in your shader:
    Code (CSharp):
    1.             struct appdata
    2.             {
    3.                 float4 vertex : POSITION;
    4.             };
    5.  
    Since you are issuing a procedural indirect draw call (with no vertex input), the draw call is skipped when targeting DX12. This can be resolved by simply removing the line above from your shader. I will check with the ShaderGraph team if any fix is needed from their side.
     
    Last edited: May 25, 2023
  3. mehmet_soyturk

    mehmet_soyturk

    Joined:
    Oct 17, 2022
    Posts:
    17
  4. dnach

    dnach

    Unity Technologies

    Joined:
    Mar 9, 2022
    Posts:
    89