   Skeletal animation
  Hi there.I'm trying to do some skeletal animation with GLSL, but I'm currently unable to understand a few things.First of all, using GLSL, how do I pass an array of matrices (for the bones)?This is what I'm currently doing.glBindAttribLocation ( Program.GetHandle(), 0, "Bones" );GLint Location = glGetUniformLocation ( Program.GetHandle(), "Bones" );assert ( Location != -1 );glUniformMatrix4fv ( Location, AnimationMatrices.Size(), GL_FALSE, reinterpret_cast <float *> ( AnimationMatrices.GetPointer() ) );Unfortunately, it always fails on the assert.I can get other uniforms, but never this one. As a matter of fact, I'm unable to get any attrib, only uniforms. How to do it?Here is the vertex shader:/** * file Texturing.vert */uniform mat4 Bones[32];attribute vec4 BoneIndex;uniform bool TexturingEnabled;void main(){if (TexturingEnabled==true)gl_TexCoord[0] = gl_MultiTexCoord0;int Index=BoneIndex.x;gl_Position = gl_ModelViewProjectionMatrix * ( Bones[int(Index)] * gl_Vertex);//gl_FrontColor = gl_Color;//gl_Position = ftransform();}[Edited by - Rhiakath on May 18, 2009 10:16:40 AM]
  When you use boneMat in your shader, should that actually be Bones? When you use boneIndex in your shader, should that actually be BoneIndex?I'm guessing your shader isn't compiling, which means your program wont link, and all addresses get returned as -1 ?   ;  Oh, yeah, sorry. I copied the wrong code.But yes, it is correct. It is indeed Bone and Index.It does compile, there's nothing wrong with that part.I corrected the post above.It fails later, when trying to put some values inside Bone.Simply put, I don't know how to do it.   