From 1e08193a1678675ac5869b76e8a2339f6de5b773 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 26 Feb 2026 18:04:06 +0000 Subject: Support for the BillboardPainter Based on the ShadowStenciller, creates flattened images of a model for simplified mass use in a scene. --- gfx/gl/billboardPainter.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 gfx/gl/billboardPainter.h (limited to 'gfx/gl/billboardPainter.h') 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 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; +}; -- cgit v1.3