PDA

View Full Version : glUniform of arrays



ugluk
11-27-2009, 02:11 AM
Is it possible to set a specific element in an array (other than the first one), or only the whole array, as it appears to be the case?

Jan
11-27-2009, 05:03 AM
As far as i know you can query the location of a uniform array element like "myArray[2]" and then only load data in there.

I am not entirely sure, though. Just try it.

Jan.

DmitryM
11-30-2009, 08:55 AM
As Jan said "myArray[2]" is a valid uniform name for the GetUniformLocation routine. I'm sure it's covered in the GLSL spec.
In practice it works for my bone pose transformation array perfectly.