GLSL uniform array names?

My understanding of GLSL uniform arrays is that they should be identifiable by both the name along, and the name along with the array index in brackets. For example, if I had this uniform array in my shader:

uniform float lightrange[4];

Then according to the spec, my program should be able to set the array, or parts of the array, with any of the following uniform names:

lightrange
lightrange[0]
lightrange[1]
lightrange[2]
lightrange[3]

I ask because it appears iOS would only recognize “lighttange[0]” while Samsung’s stuff only recognizes “lightrange”.

[QUOTE=JoshKlint;29114]My understanding of GLSL uniform arrays is that they should be identifiable by both the name along, and the name along with the array index in brackets. For example, if I had this uniform array in my shader:

uniform float lightrange[4];

Then according to the spec, my program should be able to set the array, or parts of the array, with any of the following uniform names:

lightrange
lightrange[0]
lightrange[1]
lightrange[2]
lightrange[3]

I ask because it appears iOS would only recognize “lighttange[0]” while Samsung’s stuff only recognizes “lightrange”.[/QUOTE]

I noticed the same problem reported on StackOverflow:

So, I searched all the OpenGL ES shader code that I have and the only examples I found of using the array notation was for OpenGL ES 3.0.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.