summaryrefslogtreecommitdiff
path: root/lighting.hpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-02-13 23:32:28 +1100
committerquou <quou@disroot.org>2025-02-13 23:33:54 +1100
commit2e4ecca19aadc09d5c3d927724f8004b6a0ff0b0 (patch)
tree156c747452788f5221158f6e2a9151eaeb61b672 /lighting.hpp
parent42cd6a572a35c354dc7d7fd390e86e7cff191617 (diff)
refactoring; prep for shadows
Diffstat (limited to 'lighting.hpp')
-rw-r--r--lighting.hpp14
1 files changed, 13 insertions, 1 deletions
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 {