From 629dc808c595d65cda74a86975ebd780113f3431 Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 9 Feb 2025 18:50:58 +1100 Subject: Properly send lights from the CPU --- lighting.hpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lighting.hpp (limited to 'lighting.hpp') diff --git a/lighting.hpp b/lighting.hpp new file mode 100644 index 0000000..f7708a1 --- /dev/null +++ b/lighting.hpp @@ -0,0 +1,29 @@ +#ifndef lighting_hpp +#define lighting_hpp + +#include "maths.hpp" +#include "video.hpp" + +struct Arena; +struct World; + +struct Lighting { + static constexpr int max_lights = 128; + Staged_Buffer lights; + int light_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; +}; + +struct Sun_Light : Light { + v3f dir; +}; + +#endif -- cgit v1.2.3-54-g00ecf