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)
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.
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 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.
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