Sign in to follow this  

glReadPixels Question

This topic is 3785 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

When you use the glReadPixelsb(x, y, 1, 1, GL_RGB) function it returns an array of signed bytes. I.E. the byte has a both positive and negative side ranging from -128 to 127 as mentioned before. But since standard RGB values range from 0 to 255 you would want to use the function that returns unsigned bytes which also range from 0 to 255.

Share this post


Link to post
Share on other sites
I don't know how your code looks like. But the bytes probably gets casted into unsigned bytes anyway when you store them.

IMHO, you should use glReadPixelsub(x, y, 1, 1, GL_RGB) anyway since it's probably unsigned bytes you want.

Share this post


Link to post
Share on other sites

This topic is 3785 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