I have a shader program that uses an array of a Light struct. It stores the light color and its position in world space. Problem is, i cannot use it in the scripts with go.set.:
struct Light {
vec3 light_pos;
vec3 light_color;
};
#define LIGHT_COUNT 1
uniform Light lights[LIGHT_COUNT];
function update(self, dt)
local light_color = lights:get_color(lights.sources[1])
go.set("#mBigCube", "lights[0].light_color", light_color)
local light_pos = lights:get_position(lights.sources[1])
go.set("#mBigCube", "lights[0].light_pos", light_pos)
end
how can i use uniform arrays?