I'm using an FBO with color, depth, and stencil attached to implement deferred shading.
Here is what I'm doing:
- I create an FBO with color, depth, and stencil attached, then render to it
- I blit the stencil to the back buffer's stencil buffer
- I render the final pass (using stencil tests)
Is there a way I can avoid step #2?
That is, can I just "reuse" the same stencil from step #1 in step #3 directly? I tried creating a 2nd FBO with only a stencil attached, but that didn't work -- I assume b/c attaching an FBO disables all writes to the color back buffer.