I have a test program that renders a scene to a depth texture (GL_DEPTH_COMPONENT24). I teture a quad with the texture and the result is a gray scale image of the depth buffer. How is the depth stored in the texture? I am assuming that if it is a 24 bit depth texture, then 8 bits are in each of RG and B... Is it as simple as
Scaled range value = red<<16 + green<<8 + blue
or something similar?