0
\$\begingroup\$

So for attributes the spacing between indexes is vec4, so if I had 2 matrix as an attribute, they'd be layout (location = 0) in mat4 a and layout (location = 4) in mat4 b

If I did the same for 2 uniform matix, what would the index of matrix b be?

Side note: with OpenGL 4, are VBOs also attributes, there isn't a key word for vertex?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Uniform locations don't work like attribute locations.

Every basic type in OpenGL takes up 1 uniform location. So a float and a mat4 both take up 1 location. The only time multiple locations are consumed is if you're using an aggregate (aka: struct or array) of basic types. Each basic type element of the aggregate, recursively, takes up one location.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .