Merge pull request #275 from NonLinearGuy/master

Fixed errors in skeletal animation code
This commit is contained in:
Joey de Vries
2022-02-20 17:50:22 +01:00
committed by GitHub
6 changed files with 11 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
#version 430 core
#version 330 core
out vec4 FragColor;
in vec2 TexCoords;
@@ -8,4 +8,4 @@ uniform sampler2D texture_diffuse1;
void main()
{
FragColor = texture(texture_diffuse1, TexCoords);
}
}

View File

@@ -1,4 +1,4 @@
#version 430 core
#version 330 core
layout(location = 0) in vec3 pos;
layout(location = 1) in vec3 norm;
@@ -36,4 +36,4 @@ void main()
mat4 viewModel = view * model;
gl_Position = projection * viewModel * totalPosition;
TexCoords = tex;
}
}

View File

@@ -124,7 +124,7 @@ int main()
ourShader.setMat4("projection", projection);
ourShader.setMat4("view", view);
auto transforms = animator.GetPoseTransforms();
auto transforms = animator.GetFinalBoneMatrices();
for (int i = 0; i < transforms.size(); ++i)
ourShader.setMat4("finalBonesTransformations[" + std::to_string(i) + "]", transforms[i]);