-
Member
Regular Contributor
glActiveTexture how do I shutdown extra units?
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
-
Senior Member
OpenGL Pro
Re: glActiveTexture how do I shutdown extra units?
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.
-
Super Moderator
Frequent Contributor
Re: glActiveTexture how do I shutdown extra units?
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules