Any trick to get a depth buffer image?!

I need to get depth buffer values for all the pixels in the viewport but glReadPixels(0,0,w,h,GL_DEPTH_COMPONENT,GL_FLOAT,myBuffer); is too slow.

Is there any trick to do it in a faster way?

GL_UNSIGNED_SHORT or GL_UNSIGNED_INT may very well be faster. It certainly will be much faster on our drivers.

  • Matt