Import .glb model file with animation

- improve movement controls
- TODO: allow more than one model, instance, and animation
This commit is contained in:
var
2026-04-19 21:31:31 -05:00
parent 565c4e0e6f
commit 58289aa6b2
10 changed files with 9256 additions and 48 deletions

View File

@@ -0,0 +1,29 @@
#version 450 core
layout (location = 0) in vec3 position;
layout (location = 1) in vec2 texCoord;
layout (location = 2) in ivec4 jointIndices;
layout (location = 3) in vec4 jointWeights;
out vec3 textureCoord;
uniform mat4 theModelMatrix;
uniform mat4 theViewMatrix;
uniform mat4 theProjMatrix;
uniform mat4 theJointMatrices[64];
uniform float texIndex;
void main()
{
mat4 skinMatrix =
jointWeights.x * theJointMatrices[jointIndices.x] +
jointWeights.y * theJointMatrices[jointIndices.y] +
jointWeights.z * theJointMatrices[jointIndices.z] +
jointWeights.w * theJointMatrices[jointIndices.w];
vec4 localPos = skinMatrix * vec4(position, 1.0);
mat4 mvp = theProjMatrix * theViewMatrix * theModelMatrix;
gl_Position = mvp * localPos;
textureCoord = vec3(texCoord.x, texCoord.y, texIndex);
}

BIN
res/model/human.glb Normal file

Binary file not shown.