Hello,
I am trying to reference an array that is passed in as a uniform parameter with another uniform parameter in a fragment shader, like this:
uniform mat4 matrices[20];
uniform int MatIndex;
void main(void)
{
vec4 result = somevector * matrices[MatIndex];
}
But the linker complains that the indexing must use a compile-time constant…
is that true for fragment programs and not for vertex programs? I do not understand why this could be a fragment program limitation.
please help.