PDA

View Full Version : 1D Textrue Color is Wrong ?



LLM
06-11-2006, 10:48 PM
when I build a 1D texture like this

glBindTexture(GL_TEXTURE_1D, 1);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glTexImage1D(GL_TEXTURE_1D,
0,
GL_RGBA,
256,
0,
GL_RGBA,
GL_UNSIGNED_BYTE,
table);I found the first color of the texture is the same as the final one.In another word, Index "0" Color is the same as Index "255". Why? And How to deal with this?

LLM
06-12-2006, 12:01 AM
oh, I overcome it. Change the glTexParameteri's parameter "GL_REPEAT" to "GL_CLAMP"