Jump to content
  • Advertisement
Sign in to follow this  
Anand Baumunk

OpenGL Alpha picking in opengl

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

Hello there,

I am currently in charge of building an opengl-renderer for a little gamestudio at my university. 

Currently I am trying to implement alphapicking, which is causing me some problems. We are using openGL with GLKit. 

The game is mostly 2D, and therefor all objects are planes with textures mapped onto them. When I pick, I need to be able to determine if the picked pixel has an alphavalue < 0.1 to not have it picked then. I tried glReadPixels(...), but the returnvalues are pretty strange. The openGL selectionmode does not really help me either, since it does not apply alphachannels (does it?).

What is the basic way to do it?

 

Thanks!

Share this post


Link to post
Share on other sites
Advertisement

I tried glReadPixels(...), but the returnvalues are pretty strange

Can you describe what pretty strange means ?

I use glReadPixels to do picking. You should ensure, that you pick the right buffer (front/back) and this only after the rendering has been finished (e.g. pick from front buffer buffer has been swapped).

Edited by Ashaman73

Share this post


Link to post
Share on other sites
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!