Save the zbuffer

How can I dump and save the zbuffer in a ppm file ? I know how to do it for the rendered image but not for depth map.

Use glReadPixels with a format parameter of GL_DEPTH_COMPONENT to read out the depth buffer. Then save the result to any file format you want

Originally posted by DonDan:
save the zbuffer

Ok, but where’s the petition to sign in?