Depth Offset Bug HDRP

When I was doing the ParallaxOcclusion code for my URP+ pipeline following the HDRP example, I noticed a bug (or I’m wrong).
In HDRP code we multiply viewTS by GetDisplacementObjectScale():

float3 viewDirTS = isPlanar ? float3(uvXZ, V.y) : TransformWorldToTangent(V, input.tangentToWorld) * GetDisplacementObjectScale(false).xzy;

But if we do not do this, then DepthOffset will work more correctly. Here are the screenshots:




1 Like

Hi, thanks for reporting this, we will insvestigate why there is such a behavior.

1 Like

A very strange bug. The DepthOffset in general works very oddly with Pixel Displacement. It’s not GetDisplacementObjectScale fault.

oh, sorry, I didn’t understand it well enough, I didn’t know that i need Primitive Length and Primitive Width for this