Hi, all.
I try to write a structure and declare an array as follow :
struct ShadowMapping
{
mat4 light_coordinate_system;
sampler2DShadow shadow_map;
int shadow_map_width;
int shadow_map_height;
};
...
//shadow mapping info
uniform ShadowMapping shadow_mapping_list[8]; //declaration
uniform int shadow_mapping_number;
Then I use the array in my shading program(fragment shader).
If the condition in for loop is large than 1, I won’t get all location of variables in my shader.
So how can I use the uniform struct array in my shader?
P.S. I post my code occurring the problem.
int i;
for( i = 0 ; i < shadow_mapping_number ; i++)//if I modify the shadow_mapping_number to a constant 1, it's working. Otherwise, it's failure.
{
//use the uniform struct array by the form : shadow_mapping_list[i].light_coordinate_system, and etc... .
}
And my version of glsl is #version 120
Graphics card is Nvidia GTX 460
By the way, the complied result is on error occurred in any shader.
Thanks.