3 in vec3 unscaledNormal;
11 uniform mat4 projection;
13 uniform mat4 bones[16 + 1];
18 out vec3 lightPos, viewPos, worldPos;
21 texCoords = vTexCoord;
23 mat4 boneTrans = bones[boneIds.x] * boneWeights.x;
24 boneTrans += bones[boneIds.y] * boneWeights.y;
25 boneTrans += bones[boneIds.z] * boneWeights.z;
26 boneTrans += bones[boneIds.w] * boneWeights.w;
28 mat4 bonedModel = model * boneTrans;
30 worldPos = vec3(bonedModel * vec4(pos, 1.f));
32 normal = mat3(transpose(inverse(bonedModel))) * unscaledNormal;
34 gl_Position = projection * view * bonedModel * vec4(pos, 1.f);