Point lights

This commit is contained in:
2024-12-04 23:41:52 +01:00
parent 71668cc2f5
commit c4073d7d91
5 changed files with 66 additions and 5 deletions

View File

@@ -61,6 +61,15 @@ update_light_buffer :: () {
light_data.light_matrix = light_matrix;
upload_data_to_buffer(engine.renderer, engine.directional_light_buffer, *light_data, size_of(Directional_Light_Buffer_Data));
point_light_array: Point_Light_Array;
for light: engine.current_scene.by_type._Point_Light {
shd_point_light := to_shader_point_light(light);
point_light_array.point_lights[point_light_array.num_point_lights] = shd_point_light;
point_light_array.num_point_lights += 1;
}
upload_data_to_buffer(engine.renderer, engine.point_light_buffer, *point_light_array, size_of(Point_Light_Array));
}
sync_engine_buffers :: () {