Blending two frame buffers!
How to blend two frame buffers in OpenGL?
Let the first one be the default frame buffer (either front or back) and the second one be an overlay buffer. These two frame buffers need to get blended.
Please respond to this query.
Just an idea:
You could use two 2D squares that fit your screen size, assign a texture to each and render into those textures.
When you render the two squares with their textures enable blending.
If you only need the sort of blending provided by glBlendFunc(), you can render one image directly to the framebuffer and the other into a texture, then render the texture onto the existing framebuffer with blending.
Originally Posted by Hannibal
If you don't have render-to-texture (glFramebufferTexture), you'll have to render into the framebuffer then copy the data to a texture with e.g. glCopyTexImage2D().
You are right. One texture is enough to blend it with the default frame buffer.
Originally Posted by GClements
Perhaps I'm doing things the round about way but I've found it useful to attach a framebuffer to the rendering of a screen aligned quad. Now you may composite several FBO's together using multi-texturing and capture the result as another texture.
Thank you. We are rendering the object to a user defined frame buffer as a color attachment texture and blending it with the default frame buffer. But we have some confusion regarding the blending function.