I’m attempting to do:
to get position.x where
and I’m getting a “cannot index a non-array value”. I’m using GLSL 1.2.
The OpenGL Shading Language book states:
Vectors can also be indexed as a zero-based array to obtain components. For instant, position returns the third component of position. Variable indices are allowed, making it possible to loop over the components of a vector.
What am I doing wrong?