The only real good way of doing this is to figure out a way of not having to do it... The performance hit you get is MASSIVE. It's way lighter to monopolize a texture unit for a one pixel texture, and use a texture sampler in your shader, than reading the single pixel over the bus and pushing it back as a uniform.

If it's that bad for a single pixel, you can imagine the rest.

On the other hand, if you really have to. You don't have to make the FBO a texture target. You can create a regular FBO and use glReadPixels instead. This way, you won't be locking up a texture unit.

You can use pixel buffer objects (ARB_pixel_buffer_object) to get asynchronous pixel readback, if you can cope with the latency required you shouldn't see a major performance hit I think. Examples in the PBO spec.

Just to clarify, the rendering I'm doing isn't for anything visible. This is all offscreen and not used for graphics. The reason I want to do the readback is because I want to sample (potentially) thousands of points in the frame for calculation of a vector field. The floats I get out of the readback need to update the state of my application, not just the graphics.

So yeah, I want pretty much all the data in the frame. And no, I'm not bound by synchronizing with the graphics.

OneSadCookie Wrote:You can use pixel buffer objects (ARB_pixel_buffer_object) to get asynchronous pixel readback, if you can cope with the latency required you shouldn't see a major performance hit I think. Examples in the PBO spec.

I looked at the PBO route, but I wasn't clear on how to get the pixels out of GL and back into my application layer. I can do this to get the pixels into a PBO float array, but then what?