Sign in to follow this  

Transparent textures

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

I have a texture with alpha value 1.0 everywhere. I want to render this texture transparent with a given alpha value. How do I do it? I've tried with:
GLfloat alpha = 0.5;
GLfloat color[4] = {1,1,1,alpha};
glTexEnvfv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_COLOR, color);
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE, GL_BLEND);
glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE);
// draw the texture

and lots of other different setup but nothing works =( The GL reference is really cryptical... Thanks in advance

Share this post


Link to post
Share on other sites
I assume no lighting is present(if it is,replace glColor with glMaterial).


GLfloat alpha = 0.5;
glColor4f(1,1,1,alpha);
glTexEnvfi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);



Share this post


Link to post
Share on other sites
Lighting is enabled, thanks a billion!!

And the first hour we tested different setups, we had also forgot to enable GL_BLEND =/

Thanks a lot.. I'll re-post if it doesn't work

Share this post


Link to post
Share on other sites

This topic is 4842 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.

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