Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


How do I set the color key for a texture quad?

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

For example, lets say we have a .tga or a .bmp like this. Example
Afer I load it into memory with glTexImage2D() I decide that I want to blit it but not like the way it is. Lets say I want to blit it on screen but I have all of the 1''s to be ''invisible'' or not blitted(or just blit it as another color). How would I go about this? ----------------------- "In reality God is a comedian but his audience are too afraid to laugh."

Share this post

Link to post
Share on other sites
AFAIK you can''t do that in OpenGL. If you want to do something like that you can either do an image mask (see a tutorial at nehe.gamedev.net on how to do it) or add an alpha channel to the texture and use alpha testing so all texels with certain alpha values don''t get rendered.

glAlphaFunc, take a look at that to see how to do alpha testing.

Share this post

Link to post
Share on other sites

  • 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!