diff options
Diffstat (limited to 'gfx/gl/shadowStenciller.h')
| -rw-r--r-- | gfx/gl/shadowStenciller.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gfx/gl/shadowStenciller.h b/gfx/gl/shadowStenciller.h index f774ac7..ff88ff7 100644 --- a/gfx/gl/shadowStenciller.h +++ b/gfx/gl/shadowStenciller.h @@ -1,9 +1,9 @@ #pragma once -#include "gfx/gl/program.h" #include "gfx/models/mesh.h" #include "gfx/models/texture.h" -#include "glArrays.h" +#include "glFramebuffer.h" +#include "program.h" class LightDirection; @@ -13,15 +13,16 @@ public: ShadowStenciller(); - [[nodiscard]] - static glTexture createStencilTexture(GLsizei width, GLsizei height); + static void configureStencilTexture(glTexture<GL_TEXTURE_2D_ARRAY> &, ImageDimensions); void setLightDirection(const LightDirection & lightDir); - void renderStencil(const glTexture &, const MeshBase &, Texture::AnyPtr texture) const; + [[nodiscard]] Direction2D getLightDirection() const; + void renderStencil(const glTexture<GL_TEXTURE_2D_ARRAY> &, const MeshBase &, Texture::AnyPtr texture) const; private: - glFrameBuffer fbo; + mutable glFramebuffer fbo; Program shadowCaster; Program::RequiredUniformLocation viewProjectionLoc {shadowCaster, "viewProjection"}; + Direction2D lightDir; std::array<glm::mat4, STENCIL_ANGLES<size_t>> viewProjections; }; |
