Jump to content
  • Advertisement
Sign in to follow this  
greenmoss

OpenGL glReadPixels on back buffer only works for positive coordinates

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

[font="Arial"] Hello,

Is it possible to use glReadPixels to read negative coordinates from the OpenGL back buffer? I'm trying to do "color" mouse picking. I created vertices where some have negative coordinates and others have positive coordinates. However when I read pixel colors only the vertices with positive coordinates show the expected colors; all others with negative x or y are read as black.

[/font]For an example/demonstration of the problem, I created a git repository.[font="Arial"] On the "master" branch, glReadPixels always works, because 0,0 is the lowest coordinate. However switch to branch "negative_offset" and run the code again, and see how glReadPixels fails to detect anything with a negative coordinate.[/font]

Thanks for any suggestions

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!