From 8fc46365d6bdcde0c18a8b413b9f7a80fa487107 Mon Sep 17 00:00:00 2001 From: Connor Thomson Date: Sat, 12 Sep 2026 10:20:39 -0700 Subject: Getting ready to add PCSS shadows --- src/teapot.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/teapot.c') diff --git a/src/teapot.c b/src/teapot.c index 916406f..3d9cb6d 100644 --- a/src/teapot.c +++ b/src/teapot.c @@ -20,10 +20,11 @@ #include "model.h" #include "teapot.h" #include "models/teapot_data.h" +#include "models/floor_data.h" #include "window.h" static ta_model ta_teapot_model; -static ta_model ta_dounut_model; +static ta_model ta_floor_model; void ta_teapot_init(void) { ta_model_init( @@ -37,17 +38,31 @@ void ta_teapot_init(void) { SDL_GPU_TEXTUREFORMAT_D32_FLOAT, ta_gpu_sample_count ); + ta_model_init( + &ta_floor_model, + ta_gpu_device, + ta_floor_positions, + ta_floor_position_count, + ta_floor_faces, + ta_floor_face_count, + ta_gpu_swapchain_format, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT, + ta_gpu_sample_count + ); + ta_floor_model.position[1] = -0.7f; } void ta_teapot_upload(SDL_GPUCommandBuffer *command_buffer) { ta_model_upload(&ta_teapot_model, command_buffer, ta_gpu_device); - ta_model_upload(&ta_dounut_model, command_buffer, ta_gpu_device); + ta_model_upload(&ta_floor_model, command_buffer, ta_gpu_device); } void ta_teapot_render(SDL_GPUCommandBuffer *command_buffer, SDL_GPURenderPass *render_pass) { ta_model_render(&ta_teapot_model, command_buffer, render_pass, ta_window_width, ta_window_height); + ta_model_render(&ta_floor_model, command_buffer, render_pass, ta_window_width, ta_window_height); } void ta_teapot_shutdown(void) { ta_model_destroy(&ta_teapot_model, ta_gpu_device); -} + ta_model_destroy(&ta_floor_model, ta_gpu_device); +} \ No newline at end of file -- cgit v1.2.3