Sign in to follow this  
MatrixCubed

Using a texture's alpha channel to produce solid colors

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this