Advertisement

Textures: Transparent Color

Started by January 28, 2003 03:02 PM
-1 comments, last by G3ck0Blu3 22 years, 1 month ago
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]);

This topic is closed to new replies.

Advertisement