PDA

View Full Version : How to capture from FBO ?



smogzer
05-10-2007, 07:41 AM
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 ?

k_szczech
05-10-2007, 09:16 AM
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.

smogzer
05-10-2007, 10:40 AM
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.

hseb
05-11-2007, 12:11 AM
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.