Hello,
I want to compute multiple lights in my fragment shader. I pass the light data to the vertex shader via a uniform struct[] and then I want to do something like that:
struct Global_lights {
...
};
uniform ...
uniform Global_lights[] lights;
out ...
out Global_lights[] frag_lights;
void pass_lights() {
frag_lights = lights;
}
The fragment shader:
struct Global_lights {
...
};
in ...
in Global_lights[] frag_lights;
If I try to compile this I get two errors:
Error compiling Shader
Vertex shader failed to compile with the following errors:
ERROR: 0:27: error(#282) Implicitly sized arrays can not be assigned to
ERROR: 0:27: error(#160) Cannot convert from: “uniform array of structure” to: “default out array of structure”
ERROR: error(#273) 2 compilation errors. No code generated
I somewhat understand the error message but I’d like some kind of source to read what is allowed and what not. Can someone offer a soluting? The exact amount of lights has to variable.
Thanks!