Original Post
I know what a z-buffer is, but what I would like to know is how it's scaled (don't know the right word for it). A ZB is usually a 16 or 24 bit int, right? So, is the number on the pixel multiplied by a constant (say, 0.1) or is it dynamic? That is, if I have the number 1645 on a pixel in the ZB, how does it know if a point on a triangle that is 234.0f l.u. away from me should be rendered there instead? The optimal way it seems, would be to take the far clipping plane - near clipping plane and divide it into 65536 pieces (for a 16-bit ZB), and use that.. Is that how it's done? Or does it keep some average of the closest and farest points in the scene over the last frames?