summaryrefslogtreecommitdiff
path: root/gfx/gl/billboardPainter.h
diff options
context:
space:
mode:
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;
+};