summaryrefslogtreecommitdiff
path: root/gfx/gl/billboardPainter.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2026-02-26 18:04:06 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2026-02-28 13:41:37 +0000
commit1e08193a1678675ac5869b76e8a2339f6de5b773 (patch)
treec9a47be9f06f69a06be2f43d371a88e1c507669e /gfx/gl/billboardPainter.h
parentTidy the preFrame logic into a single function in SceneRenderer (diff)
downloadilt-1e08193a1678675ac5869b76e8a2339f6de5b773.tar.bz2
ilt-1e08193a1678675ac5869b76e8a2339f6de5b773.tar.xz
ilt-1e08193a1678675ac5869b76e8a2339f6de5b773.zip
Support for the BillboardPainter
Based on the ShadowStenciller, creates flattened images of a model for simplified mass use in a scene.
Diffstat (limited to 'gfx/gl/billboardPainter.h')
-rw-r--r--gfx/gl/billboardPainter.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/gfx/gl/billboardPainter.h b/gfx/gl/billboardPainter.h
new file mode 100644
index 0000000..4ce7b10
--- /dev/null
+++ b/gfx/gl/billboardPainter.h
@@ -0,0 +1,28 @@
+#pragma once
+
+#include "gfx/gl/program.h"
+#include "gfx/models/mesh.h"
+#include "gfx/models/texture.h"
+#include "glArrays.h"
+
+class LightDirection;
+
+class BillboardPainter {
+public:
+ template<typename T> static constexpr T VIEW_ANGLES = 8;
+
+ BillboardPainter();
+
+ [[nodiscard]]
+ static glTextures<3> createBillBoardTextures(GLsizei width, GLsizei height);
+ void setView(const glm::mat4 &);
+ void renderBillBoard(const glTextures<3> &, const MeshBase &, Texture::AnyPtr texture) const;
+
+private:
+ glFrameBuffer fbo;
+ Program program;
+ Program::RequiredUniformLocation viewProjectionLoc {program, "viewProjection"};
+ Program::RequiredUniformLocation viewLoc {program, "view"};
+
+ glm::mat4 view;
+};