#ifndef lighting_hpp #define lighting_hpp #include "maths.hpp" #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; 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); void write_buf(void* ptr, World& w); }; struct Light { v3f colour; float brightness; bool caster; }; struct Sun_Light : Light { v3f dir; }; #endif