if you want to use multiple textures, you have to explicitly assign a value to “gm_BaseTexture”:
c-code:
unsigned int textureunit = ..anynumber..;
// get sampler location:
int location = getUniformLocation(shader, "gm_BaseTexture");
// send texture location to the sampler:
glProgramUniform1i(shader, location, textureunit);
// bind texture to texture unit
glActiveTexture(GL_TEXTURE0 + textureunit);
glBindTexture(GL_TEXTURE_2D, texture);
if you want to use multiple textures, you have to explicitly assign a value to “gm_BaseTexture”:
c-code:
unsigned int textureunit = ..anynumber..;
// get sampler location:
int location = getUniformLocation(shader, "gm_BaseTexture");
// send texture location to the sampler:
glProgramUniform1i(shader, location, textureunit);
// bind texture to texture unit
glActiveTexture(GL_TEXTURE0 + textureunit);
glBindTexture(GL_TEXTURE_2D, texture);