Results 1 to 5 of 5

Thread: texture limit and activating texture

  1. #1

    texture limit and activating texture

    hi,

    im currently using 8800GT, when i do this method to check my texture limit:

    GLint texLim = 0;
    glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &texLim);
    cout<< texLim << " TEXTURE LIMIT " << std::endl;

    i got a value 32. does it means i can only do 32 texture? how if i want to put more texture on it?

    also im going to attach this textures to my shader. ussualy i did it by usgin glActivateTexture(GL_TEXTURE0 - GL_TEXTURE31)? can i simply put 0-31 instead of GL_TEXTURE enum so I can use a loop to activate it?

    thanks in advance

  2. #2
    Senior Member OpenGL Lord
    Join Date
    Mar 2015
    Posts
    6,671

    Re: texture limit and activating texture

    i got a value 32. does it means i can only do 32 texture? how if i want to put more texture on it?
    Then you can't. How exactly do you plan to use 32 textures to render a single object?

    can i simply put 0-31 instead of GL_TEXTURE enum so I can use a loop to activate it?
    No, but you can do glActiveTexture(GL_TEXTURE0 + i) where i is the loop index.

  3. #3

    Re: texture limit and activating texture

    well not a single object, but for the entire scene, when there is floor, 3 different chair, lots of magazines and cover, etc2. which is definitely more than 32. is it possible to do that?


    ah ok gonna try that, thx for the info

  4. #4
    Senior Member Regular Contributor
    Join Date
    Mar 2015
    Posts
    256

    Re: texture limit and activating texture

    Quote Originally Posted by jos_t_tarigan
    well not a single object, but for the entire scene, when there is floor, 3 different chair, lots of magazines and cover, etc2. which is definitely more than 32. is it possible to do that?
    Sure, the limit means that you can combine up to 32 textures in a single draw call (think multitexturing). You can use as many textures as you want in separate draw calls.

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,649

    Re: texture limit and activating texture

    Quote Originally Posted by jos_t_tarigan
    well not a single object, but for the entire scene, when there is floor, 3 different chair, lots of magazines and cover, etc2. which is definitely more than 32. is it possible to do that?
    Sure. You can use texture arrays. Each one only consumes a single shader sampler (i.e. texture unit), yet you can put a boatload of 2D textures in one of these things, each one a separate 2D texture slice of the 2D texture array.

    Alternatively, you can use texture atlases (precursor to texture arrays), but then you have to deal with cross-map filtering issues...

Similar Threads

  1. Texture memory limit
    By M27 in forum OpenGL: Advanced Coding
    Replies: 9
    Last Post: 01-08-2008, 08:19 AM
  2. Replies: 2
    Last Post: 09-27-2004, 05:25 PM
  3. max texture size + max limit of textures
    By mithun_daa in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-06-2004, 11:07 AM
  4. Texture Memory Limit... what happens?
    By Dark in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 10-30-2002, 05:30 PM
  5. CLIPPING problems after activating the FOG
    By TB-Rex in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 08-21-2000, 04:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean