using default depth buffer in off-screen framebuffer I'm trying to implement Weighted, Blended Order-Independent Transparency

There are three passes:


3D opaque surfaces to a primary framebuffer
3D transparency accumulation to an off-screen framebuffer
2D compositing transparency over the primary framebuffer


I need to test transparent objects against default depth buffer. I created a framebuff for transparency pass and also created a depth buffer for maybe I can copy default depth to this buffer if this is the only way. But I don't know how to do that because I created depth buffer with GL_DEPTH_COMPONENT24 but I don't know default depth format.

Is it possible to bind default framebuffer's depth buffer to another framebuffer? If not, how can I copy default depth to another depth buff, or what is best way to do this?
Is it possible to bind default framebuffer's depth buffer to another framebuffer?


First, you "attach" images to framebuffers. You "bind" objects to the context; you "attach" objects to other objects.

Second, no, you cannot attach images of the default framebuffer to anything.


  If not, how can I copy default depth to another depth buff, or what is best way to do this?


You render to your own depth buffer entirely. Just copy/render the image data out to the default framebuffer when its time to display it.