I want to read the depth component of a scene rendered to a framebuffer object. I initially used glReadPixels() but found that it could only read pixels from the default framebuffer.
The answers to some relevant questions on this website suggest using PBO, but I haven't tried it yet. It seems that the PBO reading is asynchronous, therefore, using which command can synchronize the reading at the end?