Archived

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

Textures: Transparent Color

This topic is 5435 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''ve written myself a TGA loader that sets the alpha value for each pixel based on its color, so all magenta(FF00FF) pixels are set to a byte value of 00, and the rest to a byte value of FF. When I try and draw a box with the texture, the alpha value seems to have no effect on what part of the box is transparent. The box is either completely invisible or an inverted version of the image. Does this look like it''s missing something? or is something wrong? All I want is the areas with alpha set to #00 to be invisible and everything else to be visible, but not inverted like it wants to make it. glEnable(GL_BLEND); glColor4f(0.0f,0.0f,0.0f,1.0f); glBlendFunc(GL_DST_ALPHA,GL_ZERO); glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, envc); glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND); glBindTexture(GL_TEXTURE_2D, texture[0]);

Share this post


Link to post
Share on other sites