From 88a84c733e3df7ba16e85432b77a2f558746ec79 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 21 Nov 2013 14:14:09 -0800 Subject: [PATCH] Stretch out shadow volume to encompass all avatars. --- interface/src/Application.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b0d4611ac1..085725ba07 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2800,6 +2800,10 @@ void Application::updateShadowMap() { maxima = glm::max(maxima, points[i]); } + // stretch out our extents in z so that we get all of the avatars + minima.z -= _viewFrustum.getFarClip() * 0.5f; + maxima.z += _viewFrustum.getFarClip() * 0.5f; + // save the combined matrix for rendering _shadowMatrix = glm::transpose(glm::translate(0.5f, 0.5f, 0.5f) * glm::scale(0.5f, 0.5f, 0.5f) * glm::ortho(minima.x, maxima.x, minima.y, maxima.y, -maxima.z, -minima.z) *