diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-11-23 19:07:18 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-11-23 19:07:18 +0000 |
commit | 50d6f63fb28c82a35e68914fe941b685d26f6e89 (patch) | |
tree | 4a86d800d36341aedee7319307675cd1e6e5b784 /gfx/gl/sceneShader.h | |
parent | Support setting a viewPort uniform for those shaders which need it (diff) | |
download | ilt-50d6f63fb28c82a35e68914fe941b685d26f6e89.tar.bz2 ilt-50d6f63fb28c82a35e68914fe941b685d26f6e89.tar.xz ilt-50d6f63fb28c82a35e68914fe941b685d26f6e89.zip |
Add rendering support for point lights
Diffstat (limited to 'gfx/gl/sceneShader.h')
-rw-r--r-- | gfx/gl/sceneShader.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index 99431f1..62df9bf 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -1,6 +1,7 @@ #pragma once #include "program.h" +#include <glArrays.h> class Location; @@ -47,12 +48,26 @@ class SceneShader { RequiredUniformLocation waveLoc; }; + class PointLightShader : public SceneProgram { + public: + PointLightShader(); + + void add(const glm::vec3 & position, const glm::vec3 & colour, const float kq) const; + + private: + UniformLocation colourLoc; + UniformLocation kqLoc; + glVertexArray va; + glBuffer b; + }; + public: SceneShader(); BasicProgram basic; WaterProgram water; AbsolutePosProgram landmass, absolute; + PointLightShader pointLight; void setViewProjection(const glm::mat4 & viewProjection) const; void setViewPort(const glm::ivec4 & viewPort) const; |