Please Help,Some Question with depthRender

Hi everybody~
I have some trouble with depth render, I need your help
Question 1: why force32bitsFloat effect a lots?
In this PG, force32bitsFloat is set true:
In this PG, force32bitsFloat is set false:
force32bitsFloat seems not only effect the precious of depth but also sth else?
Question 2: how to convert linear depth to nonLinearDepth? or how to get screenSpace world Position from linear depth?(
In vertex shader:
gl_Position = viewProjection * finalWorld * vec4(positionUpdated, 1.0);
vDepthMetric = ((gl_Position.z + minZ) / (minZ+maxZ));
In fragment Shader:
#endif =;
gl_FragCoord.w = 1/gl_Position.w;
… I always write shader in localSpace and worldSpace. I’m not clearly understand calculation from view space to fragCoord :sob:

There are simply not enough precision in a 16 bits float when using a non linear z.

Using a linear z does help:

This PG is using a linear depth renderer in 16 bits float mode.

Derivation of the formula for the linear case:

In the PG c and d are negated because you are setting the scene in right handed mode (the derivation above is for a left handed mode).


Thank you :smiling_face_with_three_hearts: