Search Unity

Question Using Depth Texture

Discussion in 'Shader Graph' started by eco_bach, May 25, 2019.

  1. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Could anyone possible share an example of using the camera depth texture in a material? I see this setting in my LWRP settings but unsure how to take advantage of it.
     
    Antony-Blackett likes this.
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    Soft particles
    Water edge foam
    Localized fog volumes

    The usual stuff the depth texture is used for.
     
  3. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    In my case, I know what it can be used for. I just don't understand how to use it... I tried building a water shader in the share graph but couldn't get depth to work for it at all. There's some transformations that need to be done but I don't understand how.
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    If you’re using the older 2018 versions of Shader Graph, it’s a complicated and overly involved affair. I’ve posted an example on how to use it in the past, but I would highly recommend upgrading to Unity 2019 and using a recent SRP & Shader Graph instead.

    If you’re using 2019 and something like Shader Graph 5.13, then it’s much more straight forward.
     
    Antony-Blackett likes this.
  5. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    I’ll double check which graph I’m using and watch this tutorial. Thanks.