Reading in Z-buffer


I was wondering whether it is possible to read in z-buffer of the current framebuffer using GL ES? From the specs I gathered that glReadPixels support only RGBA read and not the DEPTH_COMPONENT read that is required here. If it is not possible with GL ES can the same thing be done using egl? Any help on the subject is highly appreciated.


The spec doesn’t allow reading of depth buffer for a good reason. For some HW implementations providing readback capability from depth buffer is ever worse than reading back the frame buffer.

It can be provided as a vendor-specific extension though (e.g., for SW only rasterizers).


This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.