From 5273a03417b0bb1b1f9f0baabee22466c8ea440c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 4 Mar 2026 03:12:26 +0000 Subject: 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. --- gfx/gl/shadowStenciller.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gfx/gl/shadowStenciller.h') 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> viewProjections; }; -- cgit v1.3