• Advertisement
Sign in to follow this  

Using a texture's alpha channel to produce solid colors

This topic is 4189 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 all, I'm trying to do something which is seemingly simple, but I can't figure out how to accomplish it. I want to be able to render objects in my game with solid color values (rather than textured) but I want to color-key the objects with the alpha-channel of a texture. Is there a simple method of doing this? I have been unsuccessful in finding a solution (either here, or on the web). Any help is appreciated!

Share this post


Link to post
Share on other sites
Advertisement

Right... I have the following states set up to accomplish the effect described in my original post:

glAlphaFunc(GL_NOTEQUAL, 0.0f);
glEnable(GL_ALPHA_TEST);
glEn/Disable(GL_TEXTURE_2D);
glColor4ub(r, g, b, a);
glEnable(GL_BLEND);
glBlendFunc(GL_NOT_SURE, GL_NOT_SURE);

The above bolded is what I'm unsure about...

Share this post


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

  • Advertisement