PDA

View Full Version : GL_CLAMP Issues



Clever
11-03-2003, 03:24 PM
For some reason I cannot get GL_CLAMP (or GL_CLAMP_TO_EDGE, GL_CLAMP_TO_BORDER, i've used others...) to work properly. I always see a black line at the top of the texture.
I've tried it on a GF3, a GF2, and even on a Riva TNT2 (which incidentally had the least amount of CLAMPing problems). I've specified clamping before each and every call of glTexImage and Build2DMipmap.
I'm suspecting this is a Nvidia driver problem, has anyone had this persisting problem? can u share how you fixed it?

I'll post my code soon


Appreciate any and all help, thanks

Clever
11-03-2003, 07:04 PM
Here's the code I'm using:




glBindTexture(GL_TEXTURE_2D, texid);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, lWidthPixels, lHeightPixels, GL_RGBA, GL_UNSIGNED_BYTE, pBits);


again, thanks 4 the help http://www.opengl.org/discussion_boards/ubb/smile.gif

Obli
11-05-2003, 04:57 AM
Is the black line only on the top or all around the texture?

If you change the border color, do the color changes accordingly?