From 8740d30b01f6c12e2fcea0450df73736cd17dc87 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 10 Jan 2024 01:10:44 +0000 Subject: Add spot light definition, loader, and rendering Rendering is untested, data is passed to whatever GL program is currently active. --- game/scenary/illuminator.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'game/scenary/illuminator.h') diff --git a/game/scenary/illuminator.h b/game/scenary/illuminator.h index db9acfb..99b87eb 100644 --- a/game/scenary/illuminator.h +++ b/game/scenary/illuminator.h @@ -11,11 +11,27 @@ class Texture; class Illuminator : public Asset, public Renderable, public StdTypeDefs { Mesh::Ptr bodyMesh; std::shared_ptr texture; - glVertexArray instanceVAO; + glVertexArray instanceVAO, instancesSpotLightVAO; + +public: + struct SpotLightVertex { + RelativePosition3D position; + Direction3D direction; + RGB colour; + RelativeDistance kq; + Angle arc; + }; + + struct SpotLight : Persistence::Persistable, SpotLightVertex, StdTypeDefs { + private: + friend Persistence::SelectionPtrBase>; + bool persist(Persistence::PersistenceStore & store) override; + }; public: using LocationVertex = std::pair; mutable InstanceVertices instances; + mutable InstanceVertices instancesSpotLight; void render(const SceneShader &) const override; void lights(const SceneShader &) const override; @@ -23,4 +39,7 @@ protected: friend Persistence::SelectionPtrBase>; bool persist(Persistence::PersistenceStore & store) override; void postLoad() override; + + std::vector spotLight; + std::vector::InstanceProxy> spotLightInstances; }; -- cgit v1.2.3