View Full Version : glReadPixels

Andrew Jameson
05-13-2002, 05:19 AM
Gosh, have I been struggling with this one ! I'm trying to get a pixel's depth value by calling glReadPixels with GL_DEPTH_COMPONENT ... and I can't get it work ... the documentation says that it should return a normalized depth value in the range 0.0 - 1.0 but in my case it looks to be undefined. What am I doing wrong ?


05-13-2002, 06:18 AM
You haven't searched the forum http://www.opengl.org/discussion_boards/ubb/wink.gif
Give the exact code and we'll see.

You probably didn't use GL_FLOAT?
Or forgot to convert Window origins from top-left to OpenGL's bottom-left?