From 839bf2ab51c4ec55f06b4224716c564451758072 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 7 Jan 2023 15:41:04 +0000 Subject: 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 --- gfx/gl/shadowMapper.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gfx/gl/shadowMapper.h') 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 class ShadowMapper { public: explicit ShadowMapper(const glm::ivec2 & size); static constexpr std::size_t SHADOW_BANDS {4}; - template struct Definitions { - std::array projections; - std::array regions; + struct Definitions { + std::array projections; + std::array regions; + size_t maps {}; }; - Definitions 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: -- cgit v1.2.3