Skip to content

Instantly share code, notes, and snippets.

@satoruhiga
Created December 11, 2011 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save satoruhiga/1460378 to your computer and use it in GitHub Desktop.
Save satoruhiga/1460378 to your computer and use it in GitHub Desktop.
readDepthPixelsToImage
void readDepthPixelsToImage(ofFloatImage &image)
{
glPopAttrib();
glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT );
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, image.getWidth(), image.getHeight(), GL_DEPTH_COMPONENT, GL_FLOAT, image.getPixels());
glPopClientAttrib();
image.update();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment