summaryrefslogtreecommitdiff
path: root/gfx/gl/shadowStenciller.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2026-03-04 03:12:26 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2026-03-04 03:12:26 +0000
commit5273a03417b0bb1b1f9f0baabee22466c8ea440c (patch)
treeef13d3639f54bd62db95dccfa34c54e30e2f9f74 /gfx/gl/shadowStenciller.h
parentCalculate an appropriate billboardSize and useMeshClipDist (diff)
downloadilt-5273a03417b0bb1b1f9f0baabee22466c8ea440c.tar.bz2
ilt-5273a03417b0bb1b1f9f0baabee22466c8ea440c.tar.xz
ilt-5273a03417b0bb1b1f9f0baabee22466c8ea440c.zip
Update stencils and billboards less often
No need to update these every frame when little of nothing has changed. Instead, track the angle previously rendered and updated only when the new angle has diverged sufficiently from this. Larger updates update more frequently.
Diffstat (limited to 'gfx/gl/shadowStenciller.h')
-rw-r--r--gfx/gl/shadowStenciller.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gfx/gl/shadowStenciller.h b/gfx/gl/shadowStenciller.h
index f774ac7..27ad9f9 100644
--- a/gfx/gl/shadowStenciller.h
+++ b/gfx/gl/shadowStenciller.h
@@ -16,6 +16,7 @@ public:
[[nodiscard]]
static glTexture createStencilTexture(GLsizei width, GLsizei height);
void setLightDirection(const LightDirection & lightDir);
+ [[nodiscard]] Direction2D getLightDirection() const;
void renderStencil(const glTexture &, const MeshBase &, Texture::AnyPtr texture) const;
private:
@@ -23,5 +24,6 @@ private:
Program shadowCaster;
Program::RequiredUniformLocation viewProjectionLoc {shadowCaster, "viewProjection"};
+ Direction2D lightDir;
std::array<glm::mat4, STENCIL_ANGLES<size_t>> viewProjections;
};