Jump to content

  • Log In with Google      Sign In   
  • Create Account


Alpha picking in opengl


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 gnomgrol   Members   -  Reputation: 583

Like
0Likes
Like

Posted 04 February 2013 - 04:33 AM

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!



Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 7116

Like
1Likes
Like

Posted 04 February 2013 - 04:46 AM

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, 04 February 2013 - 04:48 AM.


#3 gnomgrol   Members   -  Reputation: 583

Like
0Likes
Like

Posted 05 February 2013 - 10:51 AM

What you mentioned was exactly the problem, tfixed it! Thanks!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS