DepthNormalTexture differences between Scene and Game view

Hi Everyone,

Using URP and shadergraph with the DepthNormals render feature enabled, as described here:

This more or less works, but I get terrible banding in the Game view. In the Scene view there is no such problem, even though scene and game cameras have identical near and far clip and field of view.

I understand depth should be encoded in 16-bit for DepthNormalTexture on URP, but this banding looks more like 8-bit.


(Left: Sceneview, Right: Gameview)

I am using DecodeFloatRG() to decode the .zw channels of the _DepthNormalsTexture into a float…

float depth = DecodeFloatRG(enc.zw);

inline float DecodeFloatRG(float2 enc) // From UnityCG.cginc
{
 float2 kDecodeDot = float2(1.0, 1 / 255.0);
 return dot(enc, kDecodeDot);  // so effectively enc.x + enc.y/255.
}

Ah… in fact it is 8-bit. If I look at the two bytes individually, we can see that the w channel in the Gameview is always 1.0…


(z-channel of DepthNormalTexture Left: Sceneview, Right: Gameview)


(w-channel of DepthNormalTexture Left: Sceneview, Right: Gameview)

Using URP 10.6.0 and Shadergraph in Unity 2020.3.18f1, NVIDIA 3060, Windows 10

It also induces banding in the normals… (left is sceneview, right is gameview)

Toggling HDR has an effect on the encoded resolution of Normals and Depth.
Seems to drop depth to 8-bit and halve the resolution of normals.
Bug or feature?

Left is sceneview, right is gameview.

HDR off. Scene and game view are same for Normals.

HDR on. Scene view is nice and smooth, while Gameview has larger banding.

Same with Depth
HDR off…

HDR on…

for anyone googling this: i had the same issues, for me it was happening due to clipping plane far in gameview camera being ~30cm and in scene view ~3cm which then resulted in obvious differences of depth (g-buffer).