From 7c1e9b25fa4062a69ea00c20cdbcc745d1b82659 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 5 Jan 2023 19:45:36 +0000 Subject: Add rendering support for spot lights --- gfx/gl/sceneShader.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gfx/gl/sceneShader.h') diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index 9db6ebf..ed1bb79 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -61,6 +61,21 @@ class SceneShader { glBuffer b; }; + class SpotLightShader : public SceneProgram { + public: + SpotLightShader(); + + void add(const glm::vec3 & position, const glm::vec3 & direction, const glm::vec3 & colour, const float kq, + const float arc) const; + + private: + UniformLocation colourLoc; + UniformLocation kqLoc; + UniformLocation arcLoc; + glVertexArray va; + glBuffer b; + }; + public: SceneShader(); @@ -68,6 +83,7 @@ public: WaterProgram water; AbsolutePosProgram landmass, absolute; PointLightShader pointLight; + SpotLightShader spotLight; void setViewProjection(const glm::mat4 & viewProjection) const; void setViewPort(const glm::ivec4 & viewPort) const; -- cgit v1.2.3