Implement configurable lighting

This commit is contained in:
Camden Dixie O'Brien committed 2025-10-05 13:51:14 +01:00
1 parent 070758b6cc
commit b5bda150d2
6 files changed
+148 -49

No files matched your search

+4 -4
View File
@@ -8,10 +8,10 @@ layout(location = 3) in vec4 weights;
layout(location = 0) out vec3 frag_normal;
layout(location = 1) out vec4 light_pos;
layout(push_constant) uniform push_t {
layout(push_constant) uniform vps_t {
mat4 vp;
mat4 light_vp;
} push;
} vps;
layout(binding = 0) uniform transform_t {
mat4 model;
@@ -29,8 +29,8 @@ void main() {
+ weights.w * bones.matrices[bone_indices.w];
const vec4 world_pos
= transform.model * skinning_matrix * vec4(position, 1.0);
gl_Position = push.vp * world_pos;
gl_Position = vps.vp * world_pos;
frag_normal = transpose(
inverse(mat3(transform.model * skinning_matrix))) * normal;
light_pos = push.light_vp * world_pos;
light_pos = vps.light_vp * world_pos;
}