diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-01 17:56:26 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-01 17:56:26 +0000 |
commit | d5cdbbf38380239524e351cb69aec94090884ca5 (patch) | |
tree | 5d7dff2f2775701069806eceb4eaef23b22eba3f /gfx/gl/shadowMapper.h | |
parent | Reformat with new clang-format (diff) | |
parent | Remove more use of legacy types (diff) | |
download | ilt-d5cdbbf38380239524e351cb69aec94090884ca5.tar.bz2 ilt-d5cdbbf38380239524e351cb69aec94090884ca5.tar.xz ilt-d5cdbbf38380239524e351cb69aec94090884ca5.zip |
Merge remote-tracking branch 'origin/terrain'
Diffstat (limited to 'gfx/gl/shadowMapper.h')
-rw-r--r-- | gfx/gl/shadowMapper.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h index cd1b975..bf571f8 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 <glm/vec2.hpp> @@ -11,38 +12,39 @@ class Camera; class ShadowMapper { public: - explicit ShadowMapper(const glm::ivec2 & size); + explicit ShadowMapper(const TextureAbsCoord & size); static constexpr std::size_t SHADOW_BANDS {4}; struct Definitions { std::array<glm::mat4x4, SHADOW_BANDS> projections {}; - std::array<glm::vec4, SHADOW_BANDS> regions {}; + std::array<TextureRelRegion, SHADOW_BANDS> regions {}; 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: 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; }; FixedPoint fixedPoint, dynamicPointInst; @@ -55,9 +57,9 @@ public: } private: - [[nodiscard]] static std::vector<std::array<glm::vec3, 4>> getBandViewExtents( + [[nodiscard]] static std::vector<std::array<RelativePosition3D, 4>> getBandViewExtents( const Camera &, const glm::mat4 & lightView); glFrameBuffer depthMapFBO; glTexture depthMap; - glm::ivec2 size; + TextureAbsCoord size; }; |