 uniform mat4 projMat;
 uniform mat4 normalMat;
 
-uniform int maxNumBones;
-
 in vec3 position;
 in vec4 normal;
 in vec2 texCoord;
-
-in vec4 boneIndices;
-in vec4 boneWeights;
-
-const int MAX_BONES = 100;
-uniform mat4 boneMatrices[MAX_BONES];
 
 out vec2 texCoordFrag;
 out vec3 normalFrag;

    vec4 bindSpacePos = bindSpaceMat * pos;
    vec4 bindSpaceNor = bindSpaceNorMat * nor;

    for (int b = 0; b < maxNumBones; ++b)
    {
        int boneIndex = int(boneIndices[b]);
        mat4 boneMat = mat4(1.0);
        if (boneIndex != -1) {
            boneMat = boneMatrices[boneIndex];
        }

        vec4 partialPos = boneMat * bindSpacePos;
        float weight = boneWeights[b];
        animatedPos.xyz += (partialPos * weight).xyz;

        vec4 partialNormal = boneMatrices[boneIndex] * bindSpaceNor;
        animatedNormal.xyz += (partialNormal * weight).xyz;
    }
    if (maxNumBones == 0) {
        animatedPos = bindSpacePos;
        animatedNormal = bindSpaceNor;
    }

    vec4 eyeSpacePos = modelViewMat * animatedPos;
    gl_Position = projMat * eyeSpacePos;

    normalFrag = (normalMat * animatedNormal).xyz;

    texCoordFrag = texCoord;


{
    vec4 pos = vec4(position, 1.0);

    vec4 nor;
    nor.xyz = normalize(normal.xyz);
    nor.w = 0;
