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/billboardPainter.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gfx/gl/billboardPainter.h') diff --git a/gfx/gl/billboardPainter.h b/gfx/gl/billboardPainter.h index 4ce7b10..33c807c 100644 --- a/gfx/gl/billboardPainter.h +++ b/gfx/gl/billboardPainter.h @@ -15,7 +15,8 @@ public: [[nodiscard]] static glTextures<3> createBillBoardTextures(GLsizei width, GLsizei height); - void setView(const glm::mat4 &); + void setView(Angle angle, const glm::mat4 &); + [[nodiscard]] Angle getAngle() const; void renderBillBoard(const glTextures<3> &, const MeshBase &, Texture::AnyPtr texture) const; private: @@ -24,5 +25,6 @@ private: Program::RequiredUniformLocation viewProjectionLoc {program, "viewProjection"}; Program::RequiredUniformLocation viewLoc {program, "view"}; + Angle angle; glm::mat4 view; }; -- cgit v1.3