Jump to content
  • Advertisement
Sign in to follow this  
-don-

Rendermode GL_SELECT and GL_ALPHA_TEST [solved]

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

Hi! I am encountering problems with the GL_SELECT rendermode in combination with alpha testing... Although no glError is raised when i enable alpha testing in select rendermode, and glGet returns that it is on, the commands seem to be ignored because even when i set the glAlphaFunc to GL_NEVER all pixels are obviously "drawn" because the rendermode returns the same values as if i never used alpha testing.... Thats bad for selecting because my textures use transparency, so my GL_SELECT always returns the name of rectangle drawn and not only the pixels that are not transparent... Red and blue book gave me no clues to this :( Enabled: GL_TEXTURE_2D, GL_ALPHA_TEST Disabled: GL_BLEND I tried with several enabled and disabled states but nothing changed the result. Please help, thanks, don [Edited by - -don- on January 20, 2006 8:25:53 AM]

Share this post


Link to post
Share on other sites
Advertisement
Selection in OpenGL works purely with geometry, and does not involve any fragments at all. If the geometry, after projection, intersects the view volume, a hit is recorded. What you want is a per-fragment selection but OpenGL provides a per-primitive selection. You have to perform the selection another way that takes individual fragments into account.

You could, for example, do it by putting the object ID in the color channel, and render the alpha channel as usual. Then read back the color from the frame buffer, and match the color with an object.

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!