Added ShadowSettings::s/getMaximumShadowMapDistance(double) property, usage of these property in ViewDependentShadowMap,

and setting of it with --max-shadow-distance <double> in the osgshadow example.
This commit is contained in:
Robert Osfield
2012-08-15 12:40:48 +00:00
parent 52861ecbb0
commit 284f410436
4 changed files with 22 additions and 2 deletions

View File

@@ -799,9 +799,12 @@ void ViewDependentShadowMap::cull(osgUtil::CullVisitor& cv)
cv.computeNearPlane();
}
//minZNear = osg::maximum(10.0,minZNear);
//maxZFar = osg::minimum(60.0,maxZFar);
// clamp the minZNear and maxZFar to those provided by ShadowSettings
maxZFar = osg::minimum(settings->getMaximumShadowMapDistance(),maxZFar);
if (minZNear>maxZFar) minZNear = maxZFar*settings->getMinimumShadowMapNearFarRatio();
//OSG_NOTICE<<"maxZFar "<<maxZFar<<std::endl;
Frustum frustum(&cv, minZNear, maxZFar);
// return compute near far mode back to it's original settings