How to capture from FBO ?

I’m building a stereo camera simulator and i’m having trouble capturing a FBO image, to convert it to ppm and later to import it into opencv. Any tips of how i can do the capture ?

You can capture from FBO in two ways. You can use glReadPixels after you have finished rendering but before you switch FBO. The other way only if you render to texture - after you unbnd FBO you can use glGeTexImage2D to read texture’s contents.

Thanks! i eventually figured the first way when i remembered the gpu reading/writing called ping pong, but i was doing the glReadPixels with the FBO unbinded.

I have experiment problem for reading FBO color buffer pixels with glReadPixel on a Quadro Fx 4500 SD with lastest driver.

So, I prefer to use the glGetTexImage way.

However, this problem should be resolve soon.