I want to define an uniform interface block that consists of a 100 element array of floats with std140. Problem: It seems that every element in the array is padded to the size of a vec4 (which for me is 16 bytes). Is there a way to define a float uniform array so that every element only uses 4 bytes?
The only thing you can do is create a vec4 array and use math to access it as if it were a flat array. Basically, you do this arr[index / 4][index % 4] to access the element from arr at the index index.
If you’re talking about one of GLSL’s mat* types, the no, you have to access each column/row individually. But that’s just a matter of simple math.