mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 20:16:16 +02:00
Stretch out shadow volume to encompass all avatars.
This commit is contained in:
parent
053d6b1e71
commit
88a84c733e
1 changed files with 4 additions and 0 deletions
|
@ -2800,6 +2800,10 @@ void Application::updateShadowMap() {
|
||||||
maxima = glm::max(maxima, points[i]);
|
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
|
// 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) *
|
_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) *
|
glm::ortho(minima.x, maxima.x, minima.y, maxima.y, -maxima.z, -minima.z) *
|
||||||
|
|
Loading…
Reference in a new issue