PDA

View Full Version : glActiveTexture how do I shutdown extra units?



Mars_999
12-05-2007, 01:36 PM
I have 8 texture units for my terrain. The rest of my objects use less than this. I am wondering is there anyway to shutdown those extra texture units for the other objects? Reason I am asking is, will shutting them down help increase performance? I am not using glEnable() due to I am using GLSL.

glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textureObject);

is all I am doing to enable them, but how does one shut it down? And if you can't why not just load up 16 texture units full of objects if you can get away with that and not call glBindTexture anymore in the app?

Thanks

Zengar
12-05-2007, 03:04 PM
What do you mean by "shut down"? A texture unit (from GLSL point of view) is a logical unit, used to create a connection between a texture object and a sampler. If the unit is not used in the shader, it is just not used. That's all. You can't turn them on or shut them down.

Groovounet
12-05-2007, 03:05 PM
Enable:
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textureObject);
Disable:
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, 0);

And you can use 8 units? Oo