Original Post
I already have bone and 1 directional light working for animations, heres my question though: vertex_position = boneMatrix0*weight0 +.....boneMatrixN*weightN; It would be faster to do something like this: Basically, just getting rid of all the weights of 0 to speed up the shader. I wasted all my time writing the above, my question really is this: mat4 boneMatrix[32]; //32 bones When I sent the matrices as uniforms to the shader, how do I specify locations = GetUniformLocation(..., "boneMatrix[1]")? Do I just say locations+= (sizeof(float)*16 ?
//You have an array of matrices per frame
//each vertex has an array of integer indexes
//stating the bone and weight
for(int i = 0; i < vertex.boneIndex;i++)
{
vertex_position += boneMatrix[vertex.boneIndex]*vertex.weight[vertex.boneIndex];
}