anyway that works, but its exactly the same speed as just using readpixels with the glReadBuffer(GL_COLOR_ATTACHMENT0_EXT), in some cases it might actually be slower.
My program works at about 75fps normally, with read pixels with PBO attached i get about 18fps. Just using read pixels the conventional way i get also 18fps.
What am I doing wrong ? I appear to be getting no fps improvement at all.
I am using Vista + a quadro 3400/400 card which is something like an nvidia 6800 card.
Normal glReadPixel operation is blocking call. But when you use glReadPixels with PBO then it is nonblocking call. What you have to do is to create two PBO buffers… once per frame copy data from first PBO to sysmem (or codec) and use second PBO to start glReadPixels. Then swap PBO buffers. In next frame do the same.
You will get framebuffer data with one frame behind but it will not stall your CPU.
I see you’re using GL_BGR_EXT, however isn’t it likely that the framebuffer has an alpha channel (even though you didn’t ask for one)? Also, is that the native format for the framebuffer (and not GL_RGBA)? Afaik, in either case the driver would have to convert the texture before presenting it to you. I’d try different pixel formats and see if speed improves.
Are you bandwidth limited, ie if you decrease the size of the ReadPixel call, does the speed increase?
Anyway … on my quadro card, downloading textures theres very little difference in speed between using just straight glReadPixels and using it with a PBO(<5%). That normal ? There is a difference uploading textures to the gfx card with multi PBO, but the performance difference is 10-15% maybe. Not huge.