summaryrefslogtreecommitdiff
path: root/lighting.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'lighting.hpp')
-rw-r--r--lighting.hpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/lighting.hpp b/lighting.hpp
index ac2d2c5..ccd08d3 100644
--- a/lighting.hpp
+++ b/lighting.hpp
@@ -11,32 +11,19 @@ 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 gpu_lights;
- Staged_Buffer gpu_casters;
+ Staged_Buffer lights;
+ Staged_Buffer casters;
Texture_Id shadows;
- Texture_Id shadow_slices[shadowmap_count];
- Texture_Id ss_shadows[2];
- Texture_Id ss_shadow_slices[2][shadowmap_count];
- Texture_Id occlusion[2];
+ Texture_Id shadow_slices[max_shadows];
Sampler_Id shadow_sampler;
- 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);
+ Camera_Id cameras[max_shadows];
+ int light_count, caster_count;
+ void init(Device* dev);
void destroy(Device* dev, Renderer& r);
- Camera_Id gm_cam(Renderer& r);
void update(
Device* dev,
Context& ctx,