From 2e4ecca19aadc09d5c3d927724f8004b6a0ff0b0 Mon Sep 17 00:00:00 2001 From: quou Date: Thu, 13 Feb 2025 23:32:28 +1100 Subject: refactoring; prep for shadows --- lighting.hpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lighting.hpp') diff --git a/lighting.hpp b/lighting.hpp index f7708a1..627de66 100644 --- a/lighting.hpp +++ b/lighting.hpp @@ -5,12 +5,23 @@ #include "video.hpp" struct Arena; +struct Model_Resources; +struct Model_Scene; struct World; +struct Caster { + m4f vp; +}; + struct Lighting { static constexpr int max_lights = 128; + static constexpr int max_shadows = 16; + static constexpr int shadow_res = 512; Staged_Buffer lights; - int light_count; + Texture_Id shadows; + Texture_Id shadow_slices[max_shadows]; + Caster casters[max_shadows]; + int light_count, caster_count; void init(Device* dev); void destroy(Device* dev); void update(Device* dev, Context& ctx, World& w); @@ -20,6 +31,7 @@ struct Lighting { struct Light { v3f colour; float brightness; + bool caster; }; struct Sun_Light : Light { -- cgit v1.2.3-54-g00ecf