diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-08-26 13:38:55 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-08-26 13:38:55 +0100 |
commit | c493369c5686fdd66175024444aca196cff54502 (patch) | |
tree | 33528fba72eecf890582ad3182a289da0a5f36c3 /gfx/gl/shadowMapper.h | |
parent | test-render loads all assets into gameState (diff) | |
download | ilt-c493369c5686fdd66175024444aca196cff54502.tar.bz2 ilt-c493369c5686fdd66175024444aca196cff54502.tar.xz ilt-c493369c5686fdd66175024444aca196cff54502.zip |
Include sizes of shadow box extents as uniforms to shaders
Diffstat (limited to 'gfx/gl/shadowMapper.h')
-rw-r--r-- | gfx/gl/shadowMapper.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h index 280a0cd..19c3d23 100644 --- a/gfx/gl/shadowMapper.h +++ b/gfx/gl/shadowMapper.h @@ -19,6 +19,7 @@ public: static constexpr std::size_t SHADOW_BANDS {4}; using Definitions = std::vector<glm::mat4x4>; + using Sizes = std::vector<RelativePosition3D>; [[nodiscard]] Definitions update(const SceneProvider &, const Direction3D & direction, const Camera &) const; @@ -27,12 +28,14 @@ public: explicit ShadowProgram(const Shader & vs); explicit ShadowProgram(const Shader & vs, const Shader & gs, const Shader & fs); - void setView(const std::span<const glm::mat4>, const GlobalPosition3D) const; + void setView(const std::span<const glm::mat4x4>, const std::span<const RelativePosition3D>, + const GlobalPosition3D) const; void use() const; private: RequiredUniformLocation viewProjectionLoc {*this, "viewProjection"}; RequiredUniformLocation viewProjectionsLoc {*this, "viewProjections"}; + UniformLocation sizesLoc {*this, "sizes"}; RequiredUniformLocation viewPointLoc {*this, "viewPoint"}; }; |