how can I get the float depth value from an
active framebuffer object (FBO) that uses a
packed depth-stencil buffer?
unsigned int DepthBufferZi; glReadPixels(x, y, 1, 1, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, &DepthBufferZi);
But I don’t know how to extract the depth part as float,
tried logical AND with shifting but nothing worked.
The OpenGL registry says:
“glReadPixels of GL_DEPTH_STENCIL_EXT data reads back a rectangle from both the depth and stencil buffers.”
Still don’t know how to do it.
Please help! Thanks