Fully implemented lighting

Two types of light sources are currently supported: directional lights
and point lights. A scene can have only one directional light and up to
1024 point lights.
This commit is contained in:
Lorenzo Torres 2025-08-08 03:18:08 +02:00
parent 214317e0bf
commit 503ed33aec
7 changed files with 181 additions and 48 deletions

View file

@ -314,6 +314,11 @@ pub fn initShader(self: Self, comptime name: []const u8) !c.VkShaderModule {
return shader_module;
}
pub fn pushConstant(self: Self, pipeline: vk.GraphicsPipeline, stage: u32, offset: u32, size: u32, data: [*c]u8, frame: usize) void {
_ = stage;
c.vkCmdPushConstants(self.command_buffers[frame], pipeline.layout, c.VK_SHADER_STAGE_FRAGMENT_BIT, offset, size, data);
}
pub fn deinitShader(self: Self, shader: c.VkShaderModule) void {
c.vkDestroyShaderModule(self.handle, shader, null);
}