PDA

View Full Version : texture limit and activating texture



jos_t_tarigan
01-16-2011, 05:37 PM
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

Alfonse Reinheart
01-16-2011, 05:56 PM
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.

jos_t_tarigan
01-17-2011, 04:07 AM
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 :)

mbentrup
01-17-2011, 05:03 AM
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.

Dark Photon
01-17-2011, 06:12 PM
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...