PDA

View Full Version : glsl array length



marksibly
10-02-2006, 12:03 PM
Hi,

Is there any elegant/correct way to determine the length of a glsl array?

I'm currently using this, which works but isn't very pretty:

Local arrlen
For arrlen=0 Until 10000
If glGetUniformLocationARB( glprogram,name+"["+arrlen+"]" )=-1 Exit
Next
dprint "Array length="+arrlenBye!
Mark

Komat
10-02-2006, 01:05 PM
You can use values returned by the glGetActiveUniform function to determine size of the array.

marksibly
10-02-2006, 01:27 PM
Didn't notice that one - thanks!