Sign in to follow this  

Reading color pixel information from FBO

This topic is 2124 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I have FBO working just fine (generated texture is bind to a simple test quad and show ok).

However I have troubles reading the color information of the buffer. Here is how I do it:

[code]
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboId);
glReadBuffer(GL_COLOR_ATTACHMENT0);
unsigned char *pixels_rgb= new unsigned char[window_width * window_height * 4];
glReadPixels(some_x, some_y, 1, 1, GL_RGBA_INTEGER, GL_UNSIGNED_INT, pixels_rgb);
[/code]

The pixel_rgb just contains null data.

Share this post


Link to post
Share on other sites
Never mind: I solved it (made an error with the unsigned char assignment). Sorry.

However, there is still something I'd like to ask. Using glReadPixels to get pixel information is very slow. What alternative could be used? Maybe PBO's?

Share this post


Link to post
Share on other sites
Never mind: I solved it (made an error with the unsigned char assignment). Sorry.

However, there is still something I'd like to ask. Using glReadPixels to get pixel information is very slow. What alternative could be used? Maybe PBO's?

Share this post


Link to post
Share on other sites

This topic is 2124 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this