Pre-multiply V and P matrices

This commit is contained in:
Camden Dixie O'Brien committed 2025-10-04 14:10:00 +01:00
1 parent e7f4f4b51d
commit 2cf4f6832d
5 files changed
+21 -25

No files matched your search

+2 -3
View File
@@ -8,8 +8,7 @@ layout(location = 3) in vec4 weights;
layout(location = 0) out vec3 frag_normal;
layout(push_constant) uniform vp_t {
mat4 view;
mat4 proj;
mat4 transform;
} vp;
layout(binding = 0) uniform transform_t {
@@ -26,7 +25,7 @@ void main() {
+ weights.y * bones.matrices[bone_indices.y]
+ weights.z * bones.matrices[bone_indices.z]
+ weights.w * bones.matrices[bone_indices.w];
gl_Position = vp.proj * vp.view * transform.model * skinning_matrix
gl_Position = vp.transform * transform.model * skinning_matrix
* vec4(position, 1.0);
frag_normal = transpose(
inverse(mat3(transform.model * skinning_matrix))) * normal;