#pragma once #include "lib/glArrays.h" #include "program.h" #include class SceneProvider; class Camera; class ShadowMapper { public: ShadowMapper(const glm::ivec2 & size); template struct Definitions { std::array projections; std::array regions; }; Definitions<1> update(const SceneProvider &, const glm::vec3 & direction, const Camera &) const; class FixedPoint : public Program { public: FixedPoint(); void setViewProjection(const glm::mat4 &) const; void use() const; private: RequiredUniformLocation viewProjectionLoc; }; class DynamicPoint : public Program { public: DynamicPoint(); void setViewProjection(const glm::mat4 &) const; void use(const Location &) const; private: RequiredUniformLocation viewProjectionLoc; RequiredUniformLocation modelLoc; }; FixedPoint fixedPoint; DynamicPoint dynamicPoint; operator GLuint() const { return depthMap; } private: glFrameBuffer depthMapFBO; glTexture depthMap; glm::ivec2 size; };