summaryrefslogtreecommitdiff
path: root/gfx/models/lights.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2026-04-01 20:21:23 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2026-04-01 20:21:23 +0100
commit30fcb8bce7b60b6754a0d35f2f15b627d0fba4cb (patch)
tree7e782f51affa8a2a40cf47e6ba69335a1289b2be /gfx/models/lights.h
parentFix VertexArrayConfigurator with derived classes (diff)
downloadilt-30fcb8bce7b60b6754a0d35f2f15b627d0fba4cb.tar.bz2
ilt-30fcb8bce7b60b6754a0d35f2f15b627d0fba4cb.tar.xz
ilt-30fcb8bce7b60b6754a0d35f2f15b627d0fba4cb.zip
Have Renderable manage all instance lights
Spot and point lights now existing in Renderable, the vertex data contains the owning parent object's index in CommonLocationData, the render step is just a single draw call.
Diffstat (limited to 'gfx/models/lights.h')
-rw-r--r--gfx/models/lights.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/gfx/models/lights.h b/gfx/models/lights.h
new file mode 100644
index 0000000..586b3ef
--- /dev/null
+++ b/gfx/models/lights.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include "config/types.h"
+
+struct LightCommon {
+ RelativePosition3D position;
+ RGB colour;
+ RelativeDistance kq;
+};
+
+struct LightCommonVertex {
+ uint32_t parentObject;
+};
+
+struct SpotLightDef : LightCommon {
+ Direction3D direction;
+ Angle arc;
+};
+
+struct PointLightDef : LightCommon { };
+
+struct SpotLightVertex : SpotLightDef, LightCommonVertex {
+ SpotLightVertex(const SpotLightDef &, uint32_t);
+};
+
+struct PointLightVertex : PointLightDef, LightCommonVertex {
+ PointLightVertex(const PointLightDef &, uint32_t);
+};
+