summaryrefslogtreecommitdiff
path: root/gfx/gl/billboardPainter.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/billboardPainter.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/billboardPainter.h')
-rw-r--r--gfx/gl/billboardPainter.h4
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;
};