In graphics programing, we calculate the depth of a pixel by:
depth = z-min/(max-min) where, min and max are the minimum and maximum values for the value of z ,
But, it is said( here)since we need more precision for values of z near min than max, we use the following form of the formula:
depth = (1/z)-(1/near)/( (1/far)-(1/near) )
I quite don't get how this formula was derived. Could I be given some insight or derviation to this, please?
depth = z-min/(max-min) where, min and max are the minimum and maximum values for the value of z ,
But, it is said( here)since we need more precision for values of z near min than max, we use the following form of the formula:
depth = (1/z)-(1/near)/( (1/far)-(1/near) )
I quite don't get how this formula was derived. Could I be given some insight or derviation to this, please?