How to turn off multiple texture units because they influence to other render parts. I activate my them:
glActiveTexture(GL_TEXTURE0 + index);
glBindTexture(GL_TEXTURE_2D,
((MaterialSampler2D)specular).texture.getTOB());
shader.setTexture2(index);
Is there something like glDeactivateTexture?
glActiveTexturedoes not activate texture-units. It merely selects which texture-unit you're currently modifying (yes, OpenGL's object state managing is horrible). You activate textures withglEnable(<texture-target>)andglDisable(<texture-target>). In your case, the target would beGL_TEXTURE_2D.So to answer your question: Select the texture-unit
iby usingglActiveTexture(GL_TEXTURE0+i)and then disable it withglDisable(GL_TEXTURE_2D).Note that all this is redundant with shaders - you can just not access the values there.