So I need to pass matrices and color data for instances and I was wondering if the best way to do this would be to load the matrix data and the color data into two separate buffers, as opposed to I guess interleaving data?
layout(location = 10) in mat4 mats;
layout(location = 14) in vec3 colors;
If so would specifying the instanced data format with two buffers look like this (with the two buffers having index 1 and 2)?
glVertexArrayAttribFormat(vao, 10, 4, GL_REAL, GL_FALSE, 0);
glVertexArrayAttribFormat(vao, 11, 4, GL_REAL, GL_FALSE, 1*sizeof(vec4));
glVertexArrayAttribFormat(vao, 12, 4, GL_REAL, GL_FALSE, 2*sizeof(vec4));
glVertexArrayAttribFormat(vao, 13, 4, GL_REAL, GL_FALSE, 3*sizeof(vec4));
glVertexArrayAttribFormat(vao, 14, 3, GL_REAL, GL_FALSE, 0);
glVertexArrayAttribBinding(vao, 10, 1);
glVertexArrayAttribBinding(vao, 11, 1);
glVertexArrayAttribBinding(vao, 12, 1);
glVertexArrayAttribBinding(vao, 13, 1);
glVertexArrayAttribBinding(vao, 14, 2);
//set glEnableVertexArrayAttrib for all
glVertexArrayBindingDivisor(vao, 1, 1);
glVertexArrayBindingDivisor(vao, 2, 1);