When tweaking the Factor field, everything works as expected.
But, tweaking the Units field, it doesn’t work, no matter what value is put in.
The [r] value stated in the above page, seemes to behaves as if it is 0 or as close as possible to a 0.
Thank you.
It’s exactly the same as the glPolygonOffset function. The problem is the actual implementation of it isn’t defined by either OpenGL or DirectX. The above is likely based on the OpenGL reference implementation, but there’s no requirement that GPU makers actually implement it exactly like that. The result is exactly how offset works is GPU specific, and may be different between GPU makes and models!
Depends on what you’re trying to do. If you’re just looking to push the object closer to the camera, then absolutely adjusting the vertex position would be better. If you’re looking to do it based on the triangle slope like Offset does, then you’d need to implement it in a geometry shader or fragment shader. GPUs technically do it by adjusting fragment output depth, similar to setting SV_Depth.
Yeah, there’s a lot of render state stuff not exposed yet to Shader Graph (which Offset falls under), especially in the LWRP/URP. Some of it is getting exposed for the HDRP and hopefully that filters down to the URP at some point.
Either way, offsetting towards the camera using a Shader Graph isn’t super hard. I posted a super basic implementation here: