summaryrefslogtreecommitdiff
path: root/gfx/gl/shadowStenciller.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-08-19 23:26:32 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-08-19 23:26:32 +0100
commitdd452f3e9238be954c3ecd325ed11e97a50ec1c3 (patch)
treeffe8390a875dbd252085ec0ee3ec1cd8cd68a0c7 /gfx/gl/shadowStenciller.h
parentShuffle some GL state setting (diff)
downloadilt-dd452f3e9238be954c3ecd325ed11e97a50ec1c3.tar.bz2
ilt-dd452f3e9238be954c3ecd325ed11e97a50ec1c3.tar.xz
ilt-dd452f3e9238be954c3ecd325ed11e97a50ec1c3.zip
Persist a single ShadowStenciller within ShadowMapper
Diffstat (limited to 'gfx/gl/shadowStenciller.h')
-rw-r--r--gfx/gl/shadowStenciller.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gfx/gl/shadowStenciller.h b/gfx/gl/shadowStenciller.h
index 87dc044..009285c 100644
--- a/gfx/gl/shadowStenciller.h
+++ b/gfx/gl/shadowStenciller.h
@@ -7,15 +7,17 @@
class ShadowStenciller {
public:
- ShadowStenciller(const Direction3D & lightDir, const Direction3D & lightDirUp);
+ ShadowStenciller();
[[nodiscard]]
static glTexture createStencilTexture(GLsizei width, GLsizei height);
+ void setLightDirection(const Direction3D & lightDir, const Direction3D & lightDirUp);
void renderStencil(const glTexture &, const MeshBase &, const Texture::AnyPtr texture) const;
private:
glFrameBuffer fbo;
Program shadowCaster;
- glm::mat4 lightDirMat;
Program::UniformLocation viewProjectionLoc {shadowCaster, "viewProjection"};
+
+ glm::mat4 lightDirMat {};
};