This is the calculation for rate of change in the zbuffer
per distance in view coordinates

Use the following vars to simplify the calc.
mat is the ViewToDeviceMatrix

A = mat[0][0]
B = mat[0][2]
C = mat[2][2]
D = mat[2][3]
E = mat[0][3]

Z = View Coord Z value
S = space (distance in View coords) to move
Zdc = Z in device coords
Zdb = Z in depth buffer coords

==============================================================
==============================================================
Ortho case

Zdc1 = C * Z + D
Zdc2 = C * Z + C * S + D
dZdc = C * S
dZdb = C*S*2.0

==============================================================
==============================================================
Perspective case

Zdc = (C*Z + D)/-Z
Zdc = -C - D/Z
Zdc + C = - D/Z
Z*(Zdc + C) = -D
Z = -D/(Zdc + C)

Z2 = Z + S

Zdc2 = (C*Z2 + D)/-Z2
Zdc2 = - C - D/Z2
Zdc2 = - C - D/(Z + S)

dZdc = - D /(Z+S) + D/Z
