Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: glActiveTexture how do I shutdown extra units?

  1. #1
    Member Regular Contributor
    Join Date
    Jun 2005
    Location
    USA
    Posts
    277

    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

  2. #2
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,979

    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.

  3. #3
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    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
  •