URP Shader Graph: Is there Pixel Depth Offset?

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)

1 Like

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.

6751333--778624--22h07m0000.jpg

Thank you, that’s good information.

You might find this reference useful in terms of accessing and manipulating depth:

3 Likes

Is this still not a thing in Unity 2022?

Bumping this as is a very important feature.

Is there any news on this for URP ?

1 Like

Yep, this is very important stuff for a lot of effects. Should definitely be there.

1 Like

Looking for info on this too. Id like to use it to blend detailed terrain meshes into terrain.

1 Like

Yeah this is quite bad, this guy offers a workaround by generating shader and modifying the code:

2 Likes

Nice find, though would be much welcome if they enabled it in the graph like in HDRP, same for tessellation

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.

This topic is still not solved for URP please vote here:

This saved me. Thanks! – TLDR, in the inspector window for the Shader Graph asset, click on View Generated Code, then save the generated code as a .shader file, and then edit the code as needed.

I am changing the render queue and depth test offset using this method. It’s a workaround, but still a very neat one compare to other suggestions around the forums here.

I will try brilliant !

Can you share your PDO pass?

Still a problem in 2025?!

Editing the generated shader code is not a good solution - maybe a custom function node can do it?
Edit: you can subtract the view direction times a fraction from an object’s position in position-space to draw behind surfaces that z-fight. This is a bit clumsy as should also vary by distance and angle of view but may be sufficient for some

1 Like

Not having Depth Offset in URP ShaderGraph makes it difficult to migrate from HDRP. Any news on this?

1 Like