AE
04-03-2005, 06:48 PM
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); //helps 2 sides.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
//Create 32 bpp texture that has an alpha channel that acts as a mask. The alpha channel in the image is set to 0 for every area on the image that is pink.
//Drawing Texture
glColor4f(1,1,1,1); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//Draw texture
Now I know I could use glAlphaFunc(GL_GREATER, .7f); but that looks horrible and does not work with a semi-transparent image and an alpha channel.
Using GL_TEXTURE_WRAP's fixes the top and left but the bottom and right still have an interpolation overflow line at the outer edges of the image.
How do I fix this?
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
//Create 32 bpp texture that has an alpha channel that acts as a mask. The alpha channel in the image is set to 0 for every area on the image that is pink.
//Drawing Texture
glColor4f(1,1,1,1); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//Draw texture
Now I know I could use glAlphaFunc(GL_GREATER, .7f); but that looks horrible and does not work with a semi-transparent image and an alpha channel.
Using GL_TEXTURE_WRAP's fixes the top and left but the bottom and right still have an interpolation overflow line at the outer edges of the image.
How do I fix this?