PDA

View Full Version : glBlitFramebuffer question!



Golgoth
02-14-2008, 10:19 AM
Hi all!

this is a new start from a previous post. Long story short, I m rendering my scene to a FBO and use it as RTT. Now, I d like to fill the Main Buffer with what I just renderer off-screen.

My first question is, is there a way to avoid using glBlitFramebuffer for this?

Zed said yes but im not sure how.

Can we say, render off-screen on buffer x and to the main buffer at the same time?

Even better… render on the main frame buffer and bind it to a texture as well?

I would rather use one of those options then use the glBlitFramebuffer... even though I tried to figure glBlitFramebuffer out, I can’t have it to working yet...

thx

-NiCo-
02-14-2008, 10:29 AM
Can we say, render off-screen on buffer x and to the main buffer at the same time?
Even better… render on the main frame buffer and bind it to a texture as well?


AFAIK these options are not possible.



I would rather use one of those options then use the glBlitFramebuffer... even though I tried to figure glBlitFramebuffer out, I can’t have it to working yet...


You could render a fullscreen textured quad to your main frame buffer but I still believe blitframebuffer is the way to go...



glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, FBO_ID);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBlitFramebufferEXT(0, 0, width, height, 0, 0, width, height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);

Golgoth
02-14-2008, 06:51 PM
Fantastik!

thx NiCo

Hampel
02-15-2008, 01:25 AM
But the blit extension is not available on ATI hardware (at least not on X800)... :-(

oc2k1
02-15-2008, 03:31 AM
In the case use a Pixel Buffer Object to copy the content.

CaptainZ
02-20-2008, 04:23 PM
If the BlitFrameBuffer is not supported, bind a texture (color attachement) to your FBO, then when you are done rendering to the FBO, simply render a full screen quad to your backbuffer with that texture bound.
Hope that helps.