PDA

View Full Version : Rendering to back buffer and FBO



brtnrdr
06-12-2006, 10:24 AM
Hi,

in a program I was writing recently I was trying to write to both the back buffer and a fbo at the same time using mrt's. I had something like this:

GLenum bufs[] = {GL_BACK , GL_COLOR_ATTACHMENT0_EXT };
glDrawbuffers(2,bufs);

fbo->Bind();

//draw stuff

however, when I bind the fbo, the back buffer is not rendered to and if I don't bind the fbo then that buffer is not rendered to. This seems like it makes sense, but does anyone know of a way to do this other than 1) using two passes or 2) rendering to two color attachments and then combining them.

thanks.

Overmind
06-12-2006, 10:37 AM
There is no way to do this directly.

But you don't need two passes either, at least if you're content with the color buffer. Just render to a texture, and then render a fullscreen quad with the texture on it and shaders disabled to the backbuffer. That should cost almost nothing in terms of performance, but of course you'll need the space for the additional texture.