View Full Version : glBlitFramebuffer(EXT) coordinates

11-05-2009, 12:44 PM
Is there any opengl state that affects coordinates used in a blit operation?

I use glBlitFrameBuffer to copy the upper half of an offscreen render buffer to the upper half of a window's back buffer. Both source and destination have the same size (winXP + GeForce 8800GT + Opengl 3.0).

I need to do this:

glBlitFramebufferEXT( 0, 0, w, h/2, 0, h/2, w, h, GL_COLOR_BUFFER_BIT, GL_NEAREST);

instead of that (what I think should work according to the documentation):

glBlitFramebufferEXT( 0, h/2, w, h, 0, h/2, w, h, GL_COLOR_BUFFER_BIT, GL_NEAREST);

I other words, it is like source y axis is pointing down (with origin in top-left corner) and destination y axis is pointing up (with origin in lower left corner).

Is that the expected behavior?

Thanks in advance.


11-05-2009, 03:10 PM
What graphics card are you using and which driver version?

Older ATI drivers showed a bug where the image got flipped upside down, when you rendered into a FBO.

11-06-2009, 06:14 AM
GeForce 8800GT, winXP, OpenGL 3.2. I updated the driver this week, so I should have the latest version ( driver date: 27-09-2009, driver version: ).

It could be the case that the image is rendered upside down in the render buffer. I will try getting the pixels from the render buffer to main memory to confirm that.

11-06-2009, 12:16 PM
You where right. The content of the render buffer is flipped upside down.

This render buffer has multisample storage. The interesting thing is that if I set the number of samples to 0, the render buffer is not flipped anymore. The window I'm bliting to is not multisampled.

I don't get this reversed buffer problem on other machines I have in the office though. Machines with Quadro cards all work well. I'll do some test with different driver versions.


11-07-2009, 05:06 AM
After many tests (different graphics card and different driver versions), it appears that the a blit between a multisampled render buffer and the non-multisampled on-screen buffer is buggy with all drivers for GeForce cards.

The lastest driver (191.07) is the most consistent, but everything in the render buffer is getting drawn upside down (the problem goes away if I set the number of samples to 0). Previous versions of the drivers have more erratic behavior.

Quadro cards work as expected for every driver versions that I have tried.

Any NVidia person around here to give more insight into this problem?