summaryrefslogtreecommitdiff
path: root/gfx/gl/shadowMapper.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gl/shadowMapper.h')
-rw-r--r--gfx/gl/shadowMapper.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h
index cd1b975..bf571f8 100644
--- a/gfx/gl/shadowMapper.h
+++ b/gfx/gl/shadowMapper.h
@@ -1,5 +1,6 @@
#pragma once
+#include "config/types.h"
#include "lib/glArrays.h"
#include "program.h"
#include <glm/vec2.hpp>
@@ -11,38 +12,39 @@ class Camera;
class ShadowMapper {
public:
- explicit ShadowMapper(const glm::ivec2 & size);
+ explicit ShadowMapper(const TextureAbsCoord & size);
static constexpr std::size_t SHADOW_BANDS {4};
struct Definitions {
std::array<glm::mat4x4, SHADOW_BANDS> projections {};
- std::array<glm::vec4, SHADOW_BANDS> regions {};
+ std::array<TextureRelRegion, SHADOW_BANDS> regions {};
size_t maps {};
};
- [[nodiscard]] Definitions update(const SceneProvider &, const glm::vec3 & direction, const Camera &) const;
+ [[nodiscard]] Definitions update(const SceneProvider &, const Direction3D & direction, const Camera &) const;
class FixedPoint : public Program {
public:
FixedPoint(const Shader & vs);
- void setViewProjection(const glm::mat4 &) const;
+ void setViewProjection(const GlobalPosition3D, const glm::mat4 &) const;
void use() const;
private:
- RequiredUniformLocation viewProjectionLoc;
+ RequiredUniformLocation viewProjectionLoc, viewPointLoc;
};
class DynamicPoint : public Program {
public:
DynamicPoint();
- void setViewProjection(const glm::mat4 &) const;
+ void setViewProjection(const GlobalPosition3D, const glm::mat4 &) const;
void use(const Location &) const;
void setModel(const Location &) const;
private:
- RequiredUniformLocation viewProjectionLoc;
+ RequiredUniformLocation viewProjectionLoc, viewPointLoc;
RequiredUniformLocation modelLoc;
+ RequiredUniformLocation modelPosLoc;
};
FixedPoint fixedPoint, dynamicPointInst;
@@ -55,9 +57,9 @@ public:
}
private:
- [[nodiscard]] static std::vector<std::array<glm::vec3, 4>> getBandViewExtents(
+ [[nodiscard]] static std::vector<std::array<RelativePosition3D, 4>> getBandViewExtents(
const Camera &, const glm::mat4 & lightView);
glFrameBuffer depthMapFBO;
glTexture depthMap;
- glm::ivec2 size;
+ TextureAbsCoord size;
};