From b8401062e1d3f5e6554ab7fd9b983ea63cfb05c5 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 10 Jan 2024 19:04:30 +0000 Subject: Initial commit with working light instancing --- gfx/gl/sceneShader.h | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'gfx/gl/sceneShader.h') diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index 7ffaacd..7e31cb8 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -65,31 +65,13 @@ class SceneShader { glBuffer b; }; - class SpotLightShader : public SceneProgram { - public: - SpotLightShader(); - - void add(const Position3D & position, const Direction3D & direction, const RGB & colour, const float kq, - const float arc) const; - - private: - UniformLocation directionLoc; - UniformLocation colourLoc; - UniformLocation kqLoc; - UniformLocation arcLoc; - UniformLocation viewPointLoc; - glVertexArray va; - glBuffer b; - }; - public: SceneShader(); BasicProgram basic; WaterProgram water; - AbsolutePosProgram basicInst, landmass, absolute; + AbsolutePosProgram basicInst, landmass, absolute, spotLightInst; PointLightShader pointLight; - SpotLightShader spotLight; void setViewProjection(const GlobalPosition3D & viewPoint, const glm::mat4 & viewProjection) const; void setViewPort(const ViewPort & viewPort) const; -- cgit v1.2.3 From 51eb25ea0f1373ca0442b02049406af38eae3b33 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 12 Jan 2024 19:35:58 +0000 Subject: Add model support for point lights Still invokes non-instanced point light shader --- gfx/gl/sceneShader.h | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'gfx/gl/sceneShader.h') diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index 7e31cb8..813c1bf 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -51,27 +51,12 @@ class SceneShader { RequiredUniformLocation waveLoc; }; - class PointLightShader : public SceneProgram { - public: - PointLightShader(); - - void add(const Position3D & position, const RGB & colour, const float kq) const; - - private: - UniformLocation colourLoc; - UniformLocation kqLoc; - UniformLocation viewPointLoc; - glVertexArray va; - glBuffer b; - }; - public: SceneShader(); BasicProgram basic; WaterProgram water; - AbsolutePosProgram basicInst, landmass, absolute, spotLightInst; - PointLightShader pointLight; + AbsolutePosProgram basicInst, landmass, absolute, spotLightInst, pointLightInst; void setViewProjection(const GlobalPosition3D & viewPoint, const glm::mat4 & viewProjection) const; void setViewPort(const ViewPort & viewPort) const; -- cgit v1.2.3