How to set up more than 32 Textures?

Hi
The Subject already says it.
I want to use a single VBO to render many cubes (already works). But I want to use many different Textures for each cube! I think the only chance I have is to bind all Textures and send an index through the VBO. And then the shader has to select the right texture (depending on the index). The problem: I’m using much more than 32 Textures (max. active textures). So I have already thought of some solutions:

[ul][li]Texture Array. Problem: My target system doesn’t support them![]Texture3D. Problem: I think the Texture Layers are filtered linear! Anyway the 3D-texture mixes up with my MipMap-Levels[]I just bind one big Texture that contains all of my textures and select them with texture coordinates. Problem: If The Texture is rendered bigger than its real size or smaller than 1 pixel, it produces graphic errors, because I use MipMaps and linear filtering.[/ul][/li]I’m glad about any suggestion

Thaks in advice!
regards Freecraft

Those pretty much are your options. Even high-end DX11 hardware doesn’t have more than 16 texture units per shader stage (there are 32 enumerators, but the number of enumerators does not limit the number of textures). So you’re not going to get this done by binding a bunch of individual texture objects.

A texture atlas is the only option that will allow you to do what you want on such hardware. Just don’t fill in the entire mipmap chain. Also, try putting some empty space between the textures.

Just don’t fill in the entire mipmap chain.

I thought that you HAVE to set up the mipmaps down to 1x1 pixel?
I’m using:

glTexParameteri([..] GL_GENERATE_MIPMAP[...]);

where do I have to set up the minimal MipMap resolution then? Is there a function like glTexParameteri(GL_MIN_MIPMAP_RESOLUTION);?

Almost, see the description of GL_TEXTURE_MAX_LEVEL for glTexParameter.

Hmmmm
I’m still getting some weird lines beetween the cubes when using the method above.
Isn’t there a chance to get this to work with Texture3D?

Isn’t there a chance to get this to work with Texture3D?

Not with mipmaps.

If all of your textures are square, the same size, and if they don’t need to repeat, you could pack 6 into the faces of a cubemap.

As a side note to the topic poster, that will imply to use 3D texture coordinates.

Texture atlases are certainly the most interresting things to do here. But I wonder if the “usual” way to do thing, ie, split the single rendering call to many, one for each texture and bind textures, won’t be simpler and as fast since it will simplify texture unit management and shaders.

In addition to this, you could use a custom, tile aware mipmap generation routine.

But I wonder if the “usual” way to do thing, ie, split the single rendering call to many, one for each texture and bind textures, won’t be simpler and as fast since it will simplify texture unit management and shaders.

He’s drawing “many cubes”: I read that as code-language for “Minecraft-clone”. So that probably won’t work.