Now I'm getting this error every frame:

I'm not sure what's going on yet. But commenting out array_length in the shader (and references to it in the for loop) "fixes" it. So uniform ints are weird? Even more confusingly, if you declare the uniform int before the other uniforms, this error is removed?


I should probably state that I'm using 4.0 because it supports uniform arrays, so I can't see how to implement this kind of fog of war without it.
I can't see in the debugger on the local tree that the shadar params were altered, but that's probably just how shader params work.
Current theory is that unit_positions are always filled with zeroes, meaning somehow the set_param doesn't work. This is based off the evidence that changing the vec2(0,0) in the shader code to vec2(1,1) causes the whole thing to be discarded. Night all. Shader code is hard :|
It's weird to think that if I just rendered all this manually I wouldn't be having these problems.