Hello everyone,
I have a problem about stencil buffer: I can use it without problem, but when I resize window all my stencil buffer disappear (the 1s writed disappear, I can see only 0).
Could you please help me? How can I update my stencil buffer while resizing?
Create a new stencil attachment of the new size, attach to another FBO (e.g. FBO2), blit stencil from FBO1 to FBO2 (the part you want to keep), delete FBO’s stencil attachment.
I’ve got a question though: why are you blitting stencil from your FBO to the system framebuffer? Couldn’t you just do all of your rendering in your FBO. And then just blit color from your FBO to the system FB?