   Converting World Z Values to Depth Buffer Z Values
  How do you convert world Z values to depth buffer Z values in OpenGL? I know there's some kind of non-linear relationship between the two. Could someone provide me with some kind of formula?   
  Er, if you render with a z-buffer, youll get the values your looking for, theres no direct relationship between z values and the z buffer, its determined by the modelview matrix and the projection matrix, as well as the vertices and how their being drawn.  What are you trying to accomplish? (remember as far as i know you CAN retreve the depth buffer) also anything you implemented in software would most likely be a lot slower than the hardware version executed by your video card with openGL.hope that helped-Dan   ;  I'm using gluUnProject() to convert screen coordinates to world coordinates, and the function requires a depth buffer value.   ;use glReadPixels with GL_DEPTH_COMPONENT to get the z value   