From d6e99a696aa582b81018078b68f6600c8030d643 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 7 Nov 2023 02:51:42 +0000 Subject: WIP typedefing all the things - headers --- gfx/gl/sceneShader.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gfx/gl/sceneShader.h') diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index ead184e..d1c6ef2 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -1,5 +1,6 @@ #pragma once +#include "config/types.h" #include "program.h" #include @@ -52,7 +53,7 @@ class SceneShader { public: PointLightShader(); - void add(const glm::vec3 & position, const glm::vec3 & colour, const float kq) const; + void add(const Position3D & position, const RGB & colour, const float kq) const; private: UniformLocation colourLoc; @@ -65,7 +66,7 @@ class SceneShader { public: SpotLightShader(); - void add(const glm::vec3 & position, const glm::vec3 & direction, const glm::vec3 & colour, const float kq, + void add(const Position3D & position, const Direction3D & direction, const RGB & colour, const float kq, const float arc) const; private: -- cgit v1.2.3 From d771fbda2c171cfbc36cc0eb3122c1a02ffbb081 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 9 Nov 2023 01:57:27 +0000 Subject: WIP typedefing just about everything else --- gfx/gl/sceneShader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gfx/gl/sceneShader.h') diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index d1c6ef2..f46b842 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -16,7 +16,7 @@ class SceneShader { } void setViewProjection(const glm::mat4 &) const; - void setViewPort(const glm::ivec4 &) const; + void setViewPort(const ViewPort &) const; private: RequiredUniformLocation viewProjectionLoc; @@ -88,5 +88,5 @@ public: SpotLightShader spotLight; void setViewProjection(const glm::mat4 & viewProjection) const; - void setViewPort(const glm::ivec4 & viewPort) const; + void setViewPort(const ViewPort & viewPort) const; }; -- cgit v1.2.3 From 356e874050e5ad5af87b04a2bb01ce34a86640bb Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 13 Nov 2023 00:17:11 +0000 Subject: Send position and rotation matrix to GPU separately --- gfx/gl/sceneShader.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gfx/gl/sceneShader.h') 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 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; }; -- cgit v1.2.3 From 9bbaa4df842bf350a5d05233140bb4d631212a11 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 25 Nov 2023 13:57:33 +0000 Subject: Send position and rotation matrix to GPU separately in basic program Missed from earlier commit --- gfx/gl/sceneShader.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gfx/gl/sceneShader.h') diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index 154dc17..83c234c 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -32,6 +32,7 @@ class SceneShader { private: RequiredUniformLocation modelLoc; + RequiredUniformLocation modelPosLoc; }; class AbsolutePosProgram : public SceneProgram { -- cgit v1.2.3 From 4e6f8db35ddc8fd3f310bb5616d257b5f9996d94 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 3 Dec 2023 12:37:46 +0000 Subject: Shader viewPoint now an integer --- gfx/gl/sceneShader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gfx/gl/sceneShader.h') diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index 83c234c..7ffaacd 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -16,7 +16,7 @@ class SceneShader { { } - void setViewProjection(const Position3D &, const glm::mat4 &) const; + void setViewProjection(const GlobalPosition3D &, const glm::mat4 &) const; void setViewPort(const ViewPort &) const; private: @@ -91,6 +91,6 @@ public: PointLightShader pointLight; SpotLightShader spotLight; - void setViewProjection(const Position3D & viewPoint, const glm::mat4 & viewProjection) const; + void setViewProjection(const GlobalPosition3D & viewPoint, const glm::mat4 & viewProjection) const; void setViewPort(const ViewPort & viewPort) const; }; -- cgit v1.2.3