mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Merge pull request #275 from NonLinearGuy/master
Fixed errors in skeletal animation code
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user