diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-29 00:18:02 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-29 00:18:02 +0000 |
commit | a18ea136a540d271687fd88831bc14394107dba5 (patch) | |
tree | 05eb6b5a4a9e77240e572c62b5a1d455008e966e /gfx/gl/shadowMapper.h | |
parent | Geometry shader for single pass shadow maps (diff) | |
download | ilt-a18ea136a540d271687fd88831bc14394107dba5.tar.bz2 ilt-a18ea136a540d271687fd88831bc14394107dba5.tar.xz ilt-a18ea136a540d271687fd88831bc14394107dba5.zip |
Merge common parts of shadow programs into a base class
Diffstat (limited to 'gfx/gl/shadowMapper.h')
-rw-r--r-- | gfx/gl/shadowMapper.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h index 421e6a5..4f81e58 100644 --- a/gfx/gl/shadowMapper.h +++ b/gfx/gl/shadowMapper.h @@ -24,9 +24,10 @@ public: [[nodiscard]] Definitions update(const SceneProvider &, const Direction3D & direction, const Camera &) const; - class FixedPoint : public Program { + class ShadowProgram : public Program { public: - FixedPoint(const Shader & vs, const Shader & gs); + explicit ShadowProgram(const Shader & vs); + void setViewPoint(const GlobalPosition3D, size_t n) const; void setViewProjection(const glm::mat4 &, size_t n) const; void use() const; @@ -37,18 +38,18 @@ public: RequiredUniformLocation viewPointLoc; }; - class DynamicPoint : public Program { + class FixedPoint : public ShadowProgram { + public: + explicit FixedPoint(const Shader & vs); + }; + + class DynamicPoint : public ShadowProgram { public: DynamicPoint(); - void setViewPoint(const GlobalPosition3D, size_t n) const; - void setViewProjection(const glm::mat4 &, size_t n) const; void use(const Location &) const; void setModel(const Location &) const; private: - std::array<RequiredUniformLocation, 4> viewProjectionLoc; - RequiredUniformLocation viewProjectionsLoc; - RequiredUniformLocation viewPointLoc; RequiredUniformLocation modelLoc; RequiredUniformLocation modelPosLoc; }; |