i'm trying to figure out what happens internally in a vertex-fragment shader pair. To be more specific i'm trying to compare depth values on the cpu. On of these depth values is calculated by a shader and correspond to the gl_FragCoord.z value. What i do know is that the depth output is in the range [0,1] and not linear. So does anyone know what happens to any given depth value between feeding the depth to the vertexshader and reading it out in the fragment shader? How does opengl convert depth into the range [0,1]?
Thanks a lot in advance!