Passing an array of vectors to a uniform
I am trying to implement multiple lights in my shader but I have trouble to fill the uniform with my light data. My vertex shader: attribute vec3 aVertex; attribute vec3 aNormal; attribute vec2 aTexture; uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uNMatrix; uniform vec3 uAmbientColor; uniform vec3 uPointLightingLocation[16]; uniform vec3 uPointLightingColor[16]; varying vec2 vTexture; varying vec3 vLightWeighting; void main(void) { vec4 mvPosition = uMVMatrix * vec4(aVertex, 1.0); gl_Position = uPMatrix * mvPosition; vTexture = aTexture; int i; for (i = 0; i < 16; i++) { vec3