It is my understanding that after the modelview projection, the scene is laid out in from of the camera with the negative z axis extended away from the camera? So in this space things with larger z coord will eventually overwrite those with smaller (possibly negative) z value in the depth buffer?
But it is also my understanding that out of the fragment shader the gl_FragDepth values are from [0, 1], with smaller values overwriting those with larger (under standard GL_LEQUAL)?
Is that the standard setup?
In which case, doesn’t the z value get flipped at some point? Is this reflection built into the standard opengl projection matrix functions?
What am I missing here?
(* I’m trying to write light view projection matrices for shadow mapping and my world space is in left handed coords, so I’m trying to mimic the glScalef(0,0,-1) that works for the regular modelview projection)…