   GLSL uniform variable struct
  Hi all.I have written some GLSL shader code, and require some of the data to be passed in as custom structs. Well actually an array of a custom struct.However I can't find any information on passing a custom structure, or array of said structure to the shader as a uniform variable.(Actually I have found some information saying that it cannot be done, but i'm hoping that's wrong :p)So basically is it possible to pass a struct (or array of structs) to a uniform variable in a shader?Or is this just not allowed in GLSL?I'm using c++ and windows btw...(incase it makes any difference), and openGL version 2.1 (all my graphics card can support).Thanks!!oh! almost forgot and example:e.g.shader.fragstruct FOO{   float b;   float a;   float r;};uniform Foo bar;main.cppstruct FOO.... (same as in shader)Foo bar;shader->setUniform("bar", bar, sizeof(FOO));   
  It's not possible.Get the location of each of the struct members.loc_a=glGetUniformLocation(ProgramObject, "bar.a");loc_b=glGetUniformLocation(ProgramObject, "bar.b");loc_c=glGetUniformLocation(ProgramObject, "bar.c");and then update each uniformglUseProgram(ProgramObject);glUniform1fv(loc_a, 1, &value_a);glUniform1fv(loc_b, 1, &value_b);glUniform1fv(loc_c, 1, &value_c);   ;  Isn't it possible with uniform blocks and uniform buffer objects? (GL 3.1).   