I was trying to specify a vertex attribute in vertex shader consisting of an array of 4 floats. Instead of vec4 I tried specifying it as array, float[4]. But I don’t seem to get the correct values with later. Is it not allowed to use array format when specifying vertex attributes?
layout (location = 5) in float[4] v;
I guess there might be different reasons for this not working properly, just wanted to first check if this is valid in the first place.
You can have arrayed attributes, but each array element acts like its own attribute. So your definition of v declares 4 attributes, with attribute locations 5 to 8. I’m guessing your VAO doesn’t match that.
There’s not much reason to use an array of 4 elements as an attribute, as you can access vectors with [] syntax.