Like this:
MaterialParameters {
Texture2D ColorMap1
Texture2D ColorMap2
}
I’d like to extend the spritesheet shader for using multiple sprite sheets.
Like this:
MaterialParameters {
Texture2D ColorMap1
Texture2D ColorMap2
}
I’d like to extend the spritesheet shader for using multiple sprite sheets.
Of course you can. For an example, see “almost every JME default material”.
As far as I remember you can set up to 16 texture parameters for a material instance.
Is it true? On the TerraMonkey page is written “OpenGL supports a maximum of 16 samplers in any given shader”, and it means exactly this?
For every texture given as a parameter you need to have sampler inside your shader. So … yes, 16 textures at one time.
You can define even 100 textures in material definition, but only 16 you can pass to the shader at one time.
16 are reliable, each opengl specification is free to allow far more, some actually allow 1024 and more, but do not bet on it.