I’m writing a program uses glReadPixels() to get values from the depth buffer (GL_DEPTH_COMPONENT). I also use it to read from the frame buffer (GL_RGBA).
What I notice is that reading 32bits per pixel from the depth buffer is FAR slower than the same amount to data from the frame buffer.
Why is this and is there a way around it?
For those that are interested, I used a GForce2 GTS with 512x256 window at 32bps for colour and 32bps depth.
Reading the entire depth buffer took 88M clock cycles. Reading the same amount to data from the colour buffer took just 7.6M. 13x faster!