Search Unity

Feature Request Write custom value to fragment depth

Discussion in 'Shader Graph' started by Tenebrous, Sep 13, 2020.

  1. Tenebrous

    Tenebrous

    Volunteer Moderator

    Joined:
    Jul 25, 2011
    Posts:
    102
    Hello!

    As per title, I'd like ShaderGraph to support modifying the final fragment depth.

    This will allow us to create objects/shapes which don't directly correlate to the surfaces being drawn, e.g. a cube could be rendered where the shader actually draws a sphere within with the correct depth (or other examples e.g. shadertoy single-quad effects).

    Tene
     
  2. Frump

    Frump

    Joined:
    Jan 24, 2017
    Posts:
    4
    Seconded. I came here about the same problem. I created a raymarching shader in shader graph using custom hlsl and I can't seem to write to the depth buffer to get it to work with shadows or depth of field.

    Is it for sure not possible right now?
     
  3. Shaunyowns

    Shaunyowns

    Joined:
    Nov 4, 2019
    Posts:
    328
    Hey there! I can send this over to the team for you, I hope this helps!
     
    cultureulterior likes this.
  4. Tenebrous

    Tenebrous

    Volunteer Moderator

    Joined:
    Jul 25, 2011
    Posts:
    102
    Yes please!