diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-01-07 15:41:04 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-01-07 15:41:04 +0000 |
commit | 839bf2ab51c4ec55f06b4224716c564451758072 (patch) | |
tree | 63800794b1bcff504947cde45472d0c893f0aeda /gfx/gl/shadowMapper.h | |
parent | min/mag filter for shadow mapper depth map texture (diff) | |
download | ilt-839bf2ab51c4ec55f06b4224716c564451758072.tar.bz2 ilt-839bf2ab51c4ec55f06b4224716c564451758072.tar.xz ilt-839bf2ab51c4ec55f06b4224716c564451758072.zip |
Only generate the first N shadow maps which are useful
Note: we don't yet optimise the use of the shadow map texture, each still renders into its own corner
Diffstat (limited to 'gfx/gl/shadowMapper.h')
-rw-r--r-- | gfx/gl/shadowMapper.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h index 0ce6898..bdbd39f 100644 --- a/gfx/gl/shadowMapper.h +++ b/gfx/gl/shadowMapper.h @@ -7,16 +7,18 @@ class SceneProvider; class Camera; +#include <gfx/models/texture.h> class ShadowMapper { public: explicit ShadowMapper(const glm::ivec2 & size); static constexpr std::size_t SHADOW_BANDS {4}; - template<std::size_t S> struct Definitions { - std::array<glm::mat4x4, S> projections; - std::array<glm::vec4, S> regions; + struct Definitions { + std::array<glm::mat4x4, SHADOW_BANDS> projections; + std::array<glm::vec4, SHADOW_BANDS> regions; + size_t maps {}; }; - Definitions<SHADOW_BANDS> update(const SceneProvider &, const glm::vec3 & direction, const Camera &) const; + Definitions update(const SceneProvider &, const glm::vec3 & direction, const Camera &) const; class FixedPoint : public Program { public: |