summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'gfx')
-rw-r--r--gfx/gl/shadowStenciller.cpp5
-rw-r--r--gfx/gl/shadowStenciller.h3
2 files changed, 4 insertions, 4 deletions
diff --git a/gfx/gl/shadowStenciller.cpp b/gfx/gl/shadowStenciller.cpp
index 6d5fa40..e20eda1 100644
--- a/gfx/gl/shadowStenciller.cpp
+++ b/gfx/gl/shadowStenciller.cpp
@@ -32,8 +32,7 @@ ShadowStenciller::createStencilTexture(GLsizei width, GLsizei height)
}
void
-ShadowStenciller::renderStencil(const glTexture & stencil, const MeshBase & mesh, const RelativePosition3D & mins,
- const RelativePosition3D & maxs) const
+ShadowStenciller::renderStencil(const glTexture & stencil, const MeshBase & mesh) const
{
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, stencil, 0);
@@ -44,6 +43,8 @@ ShadowStenciller::renderStencil(const glTexture & stencil, const MeshBase & mesh
glClear(GL_DEPTH_BUFFER_BIT);
glViewport(0, 0, 256, 256);
glEnable(GL_DEPTH_TEST);
+ const auto & mins = mesh.minExtent();
+ const auto & maxs = mesh.maxExtent();
const auto extents = glm::ortho(mins.x, maxs.x, mins.z, maxs.z, mins.y, maxs.y);
const auto lightDir = glm::lookAt({}, north, up);
glUniform(viewProjectionLoc, extents * lightDir);
diff --git a/gfx/gl/shadowStenciller.h b/gfx/gl/shadowStenciller.h
index 460fa68..5a22a7e 100644
--- a/gfx/gl/shadowStenciller.h
+++ b/gfx/gl/shadowStenciller.h
@@ -11,8 +11,7 @@ public:
[[nodiscard]]
static glTexture createStencilTexture(GLsizei width, GLsizei height);
- void renderStencil(const glTexture &, const MeshBase &, const RelativePosition3D & mins,
- const RelativePosition3D & maxs) const;
+ void renderStencil(const glTexture &, const MeshBase &) const;
private:
glFrameBuffer fbo;