Original Post
So I have a big panel that's textured with this texture (shown from photoshop):
The checkerboard represents "transparent." So I've used three different algorithms for TGA loading, and each time my in-game results are as follows:
Notice that the blurry edges are fine, but the crisp edges get this gross gray stuff on them. I know it's a result of mipmapping. Check my code:
The checkerboard represents "transparent." So I've used three different algorithms for TGA loading, and each time my in-game results are as follows:
Notice that the blurry edges are fine, but the crisp edges get this gross gray stuff on them. I know it's a result of mipmapping. Check my code:
if(MipMap)
{
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR);
gluBuild2DMipmaps(GL_TEXTURE_2D, 4, Img.GetWidth(), Img.GetHeight(), GL_RGBA, GL_UNSIGNED_BYTE, Img.GetImg());
}
else
{
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Img.GetWidth(), Img.GetHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, Img.GetImg());
}
When I do mipmapping, I get those edges. When I do no mipmapping (the second block), I get my desired screen output, but my game runs disastrously slow. Is there a way I can make mipmapping get rid of those edges? Or, has someone run into the problem of big non-mipmapping textures creating huge performance problems? Or is there a problem with my code?