View Full Version : Reading FBO Texture
12-26-2006, 01:53 AM
I would like to know what the color of a perticular pixel from a texture is. Obviously this isn't a 'regular' static texure, but a texture from a Frame Buffer Object.
But is there a way to do this, except for using shaders(because they can directly read from textures if i'm correct)? I would like to keep the shaders-way as a last resort.
12-26-2006, 12:04 PM
FBO Textures are the same as regular textures from the OpenGL point of view. You could read the texture image back to the main memory, or just texture a polygon with the texel you want it and read the pixel color back...
12-27-2006, 09:57 PM
So if I want to access 2 or 3 pixels, I need to copy the whole texture back to my main RAM?
In that case, i'm gonna first try to do it with shaders.
Anyway, thanks for your help :-)
If the textures are bound to FBO's, you can always bind the FBO's one at a time and use glReadPixels to read the pixel (=texel) values from there. That way you won't need to copy the whole texture image back to the client memory.
12-28-2006, 09:48 AM
Wow, thanks for your reply. :-)
That's just what I needed.
12-28-2006, 11:24 AM
Is glReadPixels still slow when using it with FBOs? Wouldn't using glGetTexImage be faster than a glReadPixels call?
12-28-2006, 01:08 PM
I always thought that GetTexImage was slower then ReadPixels... Still, if you read just one pixel it should be fast enough...
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.