I encountered a problem when passing an array of textures to a shader:
After setting two materials
node->setMaterialTexture(0, driver->getTexture("./media/wall.bmp"));
node->setMaterialTexture(1, driver->getTexture("./media/bark_loo.jpg"));
and passing them to the shader
s32 TextureLayerID[] = {0, 1};
services->setPixelShaderConstant("myTextures[0]", TextureLayerID, 2);
under both indexes is the same texture
uniform sampler2D myTextures[2];
varying vec2 texCoord;
void main (void)
{
//gl_FragColor = texture2D(myTextures[0], texCoord);
gl_FragColor = texture2D(myTextures[1], texCoord);
}
Attached patch makes it work. (I am not sure if this is the correct way to achieve this, though.)