nickels
08-18-2010, 07:20 AM
I need to change the wrap mode from GL_CLAMP to GL_REPEAT depending on my shader texture modes:
glBindTexture(GL_TEXTURE_2D, shader.tex[i].glTex;
if (shader.tex[i].clamped) {
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
...
} else {
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
..
}
I have two questions:
1) will this work (can you modify the wrap mode after creation?
2) What is the performance hit expected?
I can (and will) try it, but any guidance would be helpful!
glBindTexture(GL_TEXTURE_2D, shader.tex[i].glTex;
if (shader.tex[i].clamped) {
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
...
} else {
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
..
}
I have two questions:
1) will this work (can you modify the wrap mode after creation?
2) What is the performance hit expected?
I can (and will) try it, but any guidance would be helpful!