Search Unity

Question URP Shader Graph: Is there Pixel Depth Offset?

Discussion in 'Shader Graph' started by unity_MyWwvGAFstre6g, Jan 21, 2021.

  1. unity_MyWwvGAFstre6g

    unity_MyWwvGAFstre6g

    Joined:
    Oct 27, 2020
    Posts:
    6
    Hello Unity community,

    simple question: it is possible to activate Pixel Depth Offset in a URP shader graph? (it'd be used for object interpenetration using parallax occlusion mapping)

    I assume that PDO is the type of advanced feature that is reserved for the HDRP, but I figured I'd ask anyways.

    Thank you!

    (edit: also lol at my username, it's the company's account ID)
     
    SteveKouts likes this.
  2. lilacsky824

    lilacsky824

    Joined:
    May 19, 2018
    Posts:
    171
    No.
    I need write a shader to use PDO with POM when I use URP.
    It seems you can only acess Depth with manullay write a shader or use Amplify Shader Editor.

    22h07m0000.jpg
     
  3. Horus_Sungod42

    Horus_Sungod42

    Joined:
    Oct 30, 2014
    Posts:
    99
    Thank you, that's good information.
     
  4. JG-Denver

    JG-Denver

    Joined:
    Jan 4, 2013
    Posts:
    77
  5. YetNeele

    YetNeele

    Joined:
    Dec 12, 2019
    Posts:
    7
    Is this still not a thing in Unity 2022?
     
  6. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
    Bumping this as is a very important feature.

    Is there any news on this for URP ?
     
    arkano22 likes this.
  7. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,928
    Yep, this is very important stuff for a lot of effects. Should definitely be there.
     
    nasos_333 likes this.
  8. SteveKouts

    SteveKouts

    Joined:
    Aug 23, 2012
    Posts:
    79
    Looking for info on this too. Id like to use it to blend detailed terrain meshes into terrain.
     
    nasos_333 likes this.
  9. FoodFish_

    FoodFish_

    Joined:
    May 3, 2018
    Posts:
    58
    nasos_333 likes this.
  10. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
  11. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,928
    Depth bias (the "Offset" attribute in regular shaders) and writing per-fragment depth are not the same thing. Depth bias uniformly offsets the depth for all fragments, but doesn't allow for things like accurate intersections in parallax occlusion mapping, or ellipsoid splatting. So this workaround (copy-pasting ShaderGraph output and adding the "Offset" attribute manually) doesn't work, or rather, it works around a different issue.
     
  12. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365