summaryrefslogtreecommitdiff
path: root/gfx/gl/sceneShader.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-01-05 19:45:36 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-01-05 19:45:36 +0000
commit7c1e9b25fa4062a69ea00c20cdbcc745d1b82659 (patch)
tree03a200a82211016a70420930ee88d2afd01f60a5 /gfx/gl/sceneShader.h
parentInclude uniform name in required uniform does not exist error message (diff)
downloadilt-7c1e9b25fa4062a69ea00c20cdbcc745d1b82659.tar.bz2
ilt-7c1e9b25fa4062a69ea00c20cdbcc745d1b82659.tar.xz
ilt-7c1e9b25fa4062a69ea00c20cdbcc745d1b82659.zip
Add rendering support for spot lights
Diffstat (limited to 'gfx/gl/sceneShader.h')
-rw-r--r--gfx/gl/sceneShader.h16
1 files changed, 16 insertions, 0 deletions
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;