Sorry if this is a stupid question,
I have an array but I can not access it unless I hard code it?
int c = 3;
if (c==0) color = n;
if (c==1) color = n;
if (c==2) color = n;
if (c==3) color = n;
// color = n[c]; doesn't work
In most cases, arrays can be indexed with any integer expression.
Arrays of opaque types (e.g. samplers or images) can only be indexed with constant, uniform or dynamically-uniform expressions, depending upon GLSL version.
Arrays need to be explicitly sized if they’re indexed with non-constant expressions.