Better shadow map depth ranges

This commit is contained in:
Fernando García Liñán 2020-12-06 14:40:53 +01:00
parent 8641d3616a
commit 00ff35cdb7

View File

@ -518,7 +518,7 @@ public:
osg::Matrixd &light_view_matrix = camera->getViewMatrix(); osg::Matrixd &light_view_matrix = camera->getViewMatrix();
light_view_matrix.makeLookAt( light_view_matrix.makeLookAt(
aim + light_dir * (bs.radius() + 10.0f), aim + light_dir * (bs.radius() + 100.f),
aim, aim,
osg::Vec3(0.0f, 0.0f, 1.0f)); osg::Vec3(0.0f, 0.0f, 1.0f));
@ -526,7 +526,7 @@ public:
light_proj_matrix.makeOrtho( light_proj_matrix.makeOrtho(
-bs.radius(), bs.radius(), -bs.radius(), bs.radius(),
-bs.radius(), bs.radius(), -bs.radius(), bs.radius(),
1.0, bs.radius() * 10.0); 1.f, bs.radius() * 6.f + 100.f);
// Do texel snapping to prevent flickering or shimmering. // Do texel snapping to prevent flickering or shimmering.
// We are using double precision vectors and matrices because in FG // We are using double precision vectors and matrices because in FG