Send view and project matrices in push constant

This commit is contained in:
Camden Dixie O'Brien committed 2025-10-03 23:42:54 +01:00
1 parent f3aa7435ec
commit ea82627695
4 files changed
+67 -59

No files matched your search

+9 -6
View File
@@ -7,11 +7,14 @@ layout(location = 3) in vec4 weights;
layout(location = 0) out vec3 frag_normal;
layout(binding = 0) uniform mvp_t {
mat4 model;
layout(push_constant) uniform vp_t {
mat4 view;
mat4 proj;
} mvp;
} vp;
layout(binding = 0) uniform transform_t {
mat4 model;
} transform;
layout(binding = 1) uniform skeleton_t {
mat4 matrices[32];
@@ -23,8 +26,8 @@ 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 = mvp.proj * mvp.view * mvp.model * skinning_matrix
gl_Position = vp.proj * vp.view * transform.model * skinning_matrix
* vec4(position, 1.0);
frag_normal
= transpose(inverse(mat3(mvp.model * skinning_matrix))) * normal;
frag_normal = transpose(
inverse(mat3(transform.model * skinning_matrix))) * normal;
}