   Reading the OGL Depth Buffer
  Hi,I render two triangles to the screen and after that I read the depth buffer of opengl like that:glReadPixels( 0, 0, 640, 480, GL_DEPTH_COMPONENT,GL_FLOAT, (void*)dbuf );To verify I print the values in dbuf to a file. However the values read from the depth buffer appear to be wrong. where no geometry is rendered the depth value are all 1.0. the depth values covered by the triangles is around 0.98. I would have expected 0.0 for no occlusion and much smaller values for the occluded regions as the triangles are close to the origin.any ideas what I could be doing wrong ?before rendering I clear the depth and color buffer btw.Thanks for your help, quak   
  The depth buffer is, by default, filled with 1.0. Since you most often want to draw geometry only closer that what is already drawn, the depth buffer starts with the largest possible depth value and decreases as you draw closer objects. A value of 1.0 corresponds to a depth at the far clip plane, and 0.0 at the near clip plane.Also, the distribution is highly non-linear for perspective projections. Meaning that an object drawn in the middle between the near and far clip planes will not have a depth value of 0.5. The actual depth value will be much close to 1.0 than its linear mapping, and 0.98 does sound perfectly normal.Mandatory reading.   