summaryrefslogtreecommitdiff
path: root/lighting.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'lighting.hpp')
-rw-r--r--lighting.hpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/lighting.hpp b/lighting.hpp
index 0d331d7..ac2d2c5 100644
--- a/lighting.hpp
+++ b/lighting.hpp
@@ -11,23 +11,32 @@ struct Model_Scene;
struct Renderer;
struct World;
+struct Caster {
+ Camera_Id reality;
+ Camera_Id jittered;
+};
+
struct Lighting {
static constexpr int max_lights = 128;
static constexpr int max_shadows = 16;
+ static constexpr int shadowmap_count = max_shadows * 2;
static constexpr int shadow_res = 2048;
- Staged_Buffer lights;
- Staged_Buffer casters;
+ Staged_Buffer gpu_lights;
+ Staged_Buffer gpu_casters;
Texture_Id shadows;
- Texture_Id shadow_slices[max_shadows];
+ Texture_Id shadow_slices[shadowmap_count];
Texture_Id ss_shadows[2];
- Texture_Id ss_shadow_slices[2][max_shadows];
+ Texture_Id ss_shadow_slices[2][shadowmap_count];
+ Texture_Id occlusion[2];
Sampler_Id shadow_sampler;
- Camera_Id cameras[max_shadows];
- int light_count, caster_count;
+ Caster casters[max_shadows];
+ Camera_Id cameras[shadowmap_count];
+ int light_count, caster_count, cam_count;
void init(Device* dev, int w, int h);
void destroy_ss(Device* dev);
void recreate(Device* dev, int w, int h);
void destroy(Device* dev, Renderer& r);
+ Camera_Id gm_cam(Renderer& r);
void update(
Device* dev,
Context& ctx,