Is it possible to use the default framebuffer depth buffer when rendering to a texture (instead of using a depth texture)?

The Idea is to continue to render part of the scene normally but on a separate texture so I can later apply a post-processing effect without having to incur the cost of having another stencil/depth buffer. Ho can I do that?


I'm sorry but you can't...

By the way, an additional depth buffer is not a resource killer. What would be costly is to re-render objects depth in the second depth buffer.

Another idea, not so resource angry would be to share the same depth buffer between two different frame buffers and render one of these frame buffers color attachment on screen at the end of the process.

| improve this answer | |
  • \$\begingroup\$ I needed that to continue rendering on default framebuffer, not for performance. The second Idea seems good to me thanks. So I have just to drop using default FB. \$\endgroup\$ – CoffeDeveloper Dec 21 '15 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.