I'm thinking on my mesh class drawing method. Is this an acceptable way of doing things?
public void draw()
{
glEnableVertexAttribArray(0); //position
glEnableVertexAttribArray(1); //normal
glEnableVertexAttribArray(2); //color ambient
glEnableVertexAttribArray(3); //color diffused
glEnableVertexAttribArray(4); //color specular
glEnableVertexAttribArray(5); //color emission
glEnableVertexAttribArray(6); //texture 1 coordinates
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, colorMap);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, normalMap);
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, displacementMap);
glActiveTexture(GL_TEXTURE3);
glBindTexture(GL_TEXTURE_2D, colorMapMod);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glVertexAttribPointer(0, 3, GL_FLOAT, false, Vertex.SIZE * 4, 0);
glVertexAttribPointer(1, 3, GL_FLOAT, false, Vertex.SIZE * 4, 12);
glVertexAttribPointer(2, 4, GL_FLOAT, false, Vertex.SIZE * 4, 24);
glVertexAttribPointer(3, 4, GL_FLOAT, false, Vertex.SIZE * 4, 40);
glVertexAttribPointer(4, 4, GL_FLOAT, false, Vertex.SIZE * 4, 56);
glVertexAttribPointer(5, 4, GL_FLOAT, false, Vertex.SIZE * 4, 72);
glVertexAttribPointer(6, 2, GL_FLOAT, false, Vertex.SIZE * 4, 88);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo);
glDrawElements(GL_TRIANGLES, size, GL_UNSIGNED_INT, 0);
glDisableVertexAttribArray(0);
glDisableVertexAttribArray(1);
glDisableVertexAttribArray(2);
glDisableVertexAttribArray(3);
glDisableVertexAttribArray(4);
glDisableVertexAttribArray(5);
glDisableVertexAttribArray(6);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, 0);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, 0);
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, 0);
glActiveTexture(GL_TEXTURE3);
glBindTexture(GL_TEXTURE_2D, 0);
}
Am I missing something? Should I make room for more data like maps. The Idea is to send everything that doesn't change at once. Variables would be sent as uniforms.
Also, should I include bone index/weight data here? And how about the bone matrices themselves? Send each as a uniform matrix4f or is there a better way of sending a group of matrices at once?