0
\$\begingroup\$

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?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\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\$ Dec 21, 2015 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .