diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-13 00:17:11 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-13 00:17:11 +0000 |
commit | 356e874050e5ad5af87b04a2bb01ce34a86640bb (patch) | |
tree | c3f2a5d548340821378f6d79b03c81bd63382282 /gfx/gl/sceneShader.h | |
parent | Refactor BufferedLocationT to use a callback (diff) | |
download | ilt-356e874050e5ad5af87b04a2bb01ce34a86640bb.tar.bz2 ilt-356e874050e5ad5af87b04a2bb01ce34a86640bb.tar.xz ilt-356e874050e5ad5af87b04a2bb01ce34a86640bb.zip |
Send position and rotation matrix to GPU separately
Diffstat (limited to 'gfx/gl/sceneShader.h')
-rw-r--r-- | gfx/gl/sceneShader.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index f46b842..154dc17 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -11,15 +11,16 @@ class SceneShader { public: template<typename... S> inline explicit SceneProgram(const S &... srcs) : - Program {srcs...}, viewProjectionLoc {*this, "viewProjection"}, viewPortLoc {*this, "viewPort"} + Program {srcs...}, viewProjectionLoc {*this, "viewProjection"}, viewPointLoc {*this, "viewPoint"}, + viewPortLoc {*this, "viewPort"} { } - void setViewProjection(const glm::mat4 &) const; + void setViewProjection(const Position3D &, const glm::mat4 &) const; void setViewPort(const ViewPort &) const; private: - RequiredUniformLocation viewProjectionLoc; + RequiredUniformLocation viewProjectionLoc, viewPointLoc; UniformLocation viewPortLoc; }; @@ -58,6 +59,7 @@ class SceneShader { private: UniformLocation colourLoc; UniformLocation kqLoc; + UniformLocation viewPointLoc; glVertexArray va; glBuffer b; }; @@ -74,6 +76,7 @@ class SceneShader { UniformLocation colourLoc; UniformLocation kqLoc; UniformLocation arcLoc; + UniformLocation viewPointLoc; glVertexArray va; glBuffer b; }; @@ -87,6 +90,6 @@ public: PointLightShader pointLight; SpotLightShader spotLight; - void setViewProjection(const glm::mat4 & viewProjection) const; + void setViewProjection(const Position3D & viewPoint, const glm::mat4 & viewProjection) const; void setViewPort(const ViewPort & viewPort) const; }; |