I have a FBO holding a texture, and to that texture I need to apply a post-processing filter, which is done via GLSL.
So, the way I found to do so:
glUseProgram(program);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboDst); //fboDst has an empty texture (newTex)
// ... draw fboSrc texture (oldTex)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glUseProgram(0);
copyImage(&fboDst, &fboSrc); // Replace oldTex by newTex via glBlitFramebufferEXT
Ok. At this point, fboSrc contains my wanted filtered texture. But what if I try to filter it again? Now fboDst isn't clear anymore.
So I ask you: how to fully clear it, including the alpha channel, without having to recreate everything?
PS: Have tried glClearColor(1, 1, 1, 0) + glClear(GL_COLOR_BUFFER_BIT) but it seems to screw up my scene.