View Full Version : shared depth buffer

04-09-2012, 12:56 AM
Does any know if I can have the one depth buffer shared by several frame buffers; so long a I only bind one at a time?

What I am trying to do is

pass 1
render to texture with attached depth buffer, setting depths

pass 2
render to a new texture but with depth tests against the buffer from pass 1.

04-09-2012, 05:23 AM
Yes. Create a framebufferobject with texture attachements (one colour and one depth/depthstencil).
You can create the second framebuffer by respecifying the depth texture from FBO #1

04-09-2012, 06:10 AM