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/shadowMapper.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gfx/gl/shadowMapper.h') diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h index cd1b975..e5272a3 100644 --- a/gfx/gl/shadowMapper.h +++ b/gfx/gl/shadowMapper.h @@ -1,5 +1,6 @@ #pragma once +#include "config/types.h" #include "lib/glArrays.h" #include "program.h" #include @@ -11,7 +12,7 @@ class Camera; class ShadowMapper { public: - explicit ShadowMapper(const glm::ivec2 & size); + explicit ShadowMapper(const TextureAbsCoord & size); static constexpr std::size_t SHADOW_BANDS {4}; @@ -21,7 +22,7 @@ public: size_t maps {}; }; - [[nodiscard]] Definitions update(const SceneProvider &, const glm::vec3 & direction, const Camera &) const; + [[nodiscard]] Definitions update(const SceneProvider &, const Direction3D & direction, const Camera &) const; class FixedPoint : public Program { public: @@ -55,9 +56,9 @@ public: } private: - [[nodiscard]] static std::vector> getBandViewExtents( + [[nodiscard]] static std::vector> getBandViewExtents( const Camera &, const glm::mat4 & lightView); glFrameBuffer depthMapFBO; glTexture depthMap; - glm::ivec2 size; + TextureAbsCoord size; }; -- 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/shadowMapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gfx/gl/shadowMapper.h') diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h index e5272a3..d54734c 100644 --- a/gfx/gl/shadowMapper.h +++ b/gfx/gl/shadowMapper.h @@ -18,7 +18,7 @@ public: struct Definitions { std::array projections {}; - std::array regions {}; + std::array regions {}; size_t maps {}; }; -- cgit v1.2.3 From 916fafa028b0bc8c8b0abec8c072722907d85f43 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 25 Nov 2023 14:08:45 +0000 Subject: Send position and rotation matrix to GPU separately in shadowmapper dynamic --- gfx/gl/shadowMapper.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gfx/gl/shadowMapper.h') diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h index d54734c..b53a7f1 100644 --- a/gfx/gl/shadowMapper.h +++ b/gfx/gl/shadowMapper.h @@ -44,6 +44,7 @@ public: private: RequiredUniformLocation viewProjectionLoc; RequiredUniformLocation modelLoc; + RequiredUniformLocation modelPosLoc; }; FixedPoint fixedPoint, dynamicPointInst; -- cgit v1.2.3 From 57d02ec977e04003aadbca8fc18ed0f4b98b3288 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 3 Dec 2023 14:22:06 +0000 Subject: Set the viewPoint uniform in shadow shaders --- gfx/gl/shadowMapper.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gfx/gl/shadowMapper.h') diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h index b53a7f1..01520ca 100644 --- a/gfx/gl/shadowMapper.h +++ b/gfx/gl/shadowMapper.h @@ -27,22 +27,22 @@ public: class FixedPoint : public Program { public: FixedPoint(const Shader & vs); - void setViewProjection(const glm::mat4 &) const; + void setViewProjection(const GlobalPosition3D, const glm::mat4 &) const; void use() const; private: - RequiredUniformLocation viewProjectionLoc; + RequiredUniformLocation viewProjectionLoc, viewPointLoc; }; class DynamicPoint : public Program { public: DynamicPoint(); - void setViewProjection(const glm::mat4 &) const; + void setViewProjection(const GlobalPosition3D, const glm::mat4 &) const; void use(const Location &) const; void setModel(const Location &) const; private: - RequiredUniformLocation viewProjectionLoc; + RequiredUniformLocation viewProjectionLoc, viewPointLoc; RequiredUniformLocation modelLoc; RequiredUniformLocation modelPosLoc; }; -- cgit v1.2.3 From fe8f9775cce008465fcca2d6783bd7be0d64f77c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 1 Jan 2024 11:49:46 +0000 Subject: Remove legacy Position types from shadowMapper --- gfx/gl/shadowMapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gfx/gl/shadowMapper.h') diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h index 01520ca..bf571f8 100644 --- a/gfx/gl/shadowMapper.h +++ b/gfx/gl/shadowMapper.h @@ -57,7 +57,7 @@ public: } private: - [[nodiscard]] static std::vector> getBandViewExtents( + [[nodiscard]] static std::vector> getBandViewExtents( const Camera &, const glm::mat4 & lightView); glFrameBuffer depthMapFBO; glTexture depthMap; -- cgit v1.2.3