summaryrefslogtreecommitdiff
path: root/gfx/gl
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-08-11 19:32:23 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-08-11 19:32:23 +0100
commit064864eac61e936af909470fcccc5c67ef6d3169 (patch)
tree079ebd953589207cf70b87648eedd543013b078a /gfx/gl
parentUse texture alpha in shadow stencil (diff)
downloadilt-064864eac61e936af909470fcccc5c67ef6d3169.tar.bz2
ilt-064864eac61e936af909470fcccc5c67ef6d3169.tar.xz
ilt-064864eac61e936af909470fcccc5c67ef6d3169.zip
Calculate centre and size of mesh, wrap it all in a Dimensions object
Diffstat (limited to 'gfx/gl')
-rw-r--r--gfx/gl/shadowStenciller.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/gfx/gl/shadowStenciller.cpp b/gfx/gl/shadowStenciller.cpp
index 2ba519f..dc87d76 100644
--- a/gfx/gl/shadowStenciller.cpp
+++ b/gfx/gl/shadowStenciller.cpp
@@ -47,8 +47,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 & mins = mesh.getDimensions().minExtent;
+ const auto & maxs = mesh.getDimensions().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);