How to asynchronously transfer depth texture

I’ve got a problem with depth setting up texture format. When I use GL_DEPTH_COMPONENT, the fragment shader could access depth texture I uploaded to GPU correctly, but When I set the depth texture format as GL_DEPTH_STENCIL_NV, the result of depth texture access seems wrong, I use GL_DEPTH_STENCIL_NV because I need a 32bit depth buffer to transfer asynchronously,and the GL_DEPTH_COMPONENT will block CPU to wait depth texture transfer end.
Is there a suitble format both enable asynchronously transfer and GLSL access? many thancks for your help:)

What exactly you mean by asynchronous transfer? Do you transfer the depth texture from/to client memory?
If yes, then use pixel buffer objects (PBO) for the transfer. This way you can make the transfer asynchronous.

yes,I indeed use PBO to transfer texture asynchronously. I mean that I first use PBO read back a depth texture from FBO(FBO is consist of two texture buffer objects), then I upload this texture to another FBO as its depth texture, these two FBOs’ depth texture format are all set as GL_DEPTH_STENCIL_NV, which lead to something wrong for GLSL accessing, if GL_DEPTH_COMPONENT, GLSL could read the depth texture well. I don’t hnow what wrong in my program.

Why do you make a copy instead of using the depth texture directly?

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