03-06-2001, 10:08 AM
I have texture 128x128x32, it is pure white (FF). Now, when I use texture on a rectangle, there is a grey border around texture! Why? First I thought this AA, but then I change background color to pure white also, and I still see grey border around the texture! This should not be case, but I don't know why this is happening. I try to set to GL_FLAT from GL_SMOOTH, but no difference.
Anyone know why this happen?
This is code
// Texture parameters
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R, GL_LINEAR_MIPMAP_LINEAR);
// Build mip-maps
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, 128, 128,GL_RGB, GL_UNSIGNED_BYTE, dat);
..then draw code
glBindTexture(GL_TEXTURE_2D, Tex);
glBegin(GL_QUADS);
glTexCoord2d(0.0, 0.0) ;
glVertex2d( -1, -.05);
glTexCoord2d(1, 0.0) ;
glVertex2d( 1, -.05);
glTexCoord2d(1, 1) ;
glVertex2d( 1, .05);
glTexCoord2d(0, 1) ;
glVertex2d(-1, .05);
glEnd();
Help!
Anyone know why this happen?
This is code
// Texture parameters
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R, GL_LINEAR_MIPMAP_LINEAR);
// Build mip-maps
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, 128, 128,GL_RGB, GL_UNSIGNED_BYTE, dat);
..then draw code
glBindTexture(GL_TEXTURE_2D, Tex);
glBegin(GL_QUADS);
glTexCoord2d(0.0, 0.0) ;
glVertex2d( -1, -.05);
glTexCoord2d(1, 0.0) ;
glVertex2d( 1, -.05);
glTexCoord2d(1, 1) ;
glVertex2d( 1, .05);
glTexCoord2d(0, 1) ;
glVertex2d(-1, .05);
glEnd();
Help!