diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-04 03:12:26 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-04 03:12:26 +0000 |
| commit | 5273a03417b0bb1b1f9f0baabee22466c8ea440c (patch) | |
| tree | ef13d3639f54bd62db95dccfa34c54e30e2f9f74 /gfx/gl/billboardPainter.h | |
| parent | Calculate an appropriate billboardSize and useMeshClipDist (diff) | |
| download | ilt-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/billboardPainter.h')
| -rw-r--r-- | gfx/gl/billboardPainter.h | 4 |
1 files changed, 3 insertions, 1 deletions
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; }; |
