From c225f2758cb2b78249df3ed4d4a12e757754c6f3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 19 Dec 2011 09:09:30 +0000 Subject: [PATCH] Added --num-sm and --parallel-split and --cascaded command line options to set the appriopriate ViewDependentShadowMap settings. --- examples/osgshadow/osgshadow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/osgshadow/osgshadow.cpp b/examples/osgshadow/osgshadow.cpp index 03eb15099..f28f3fa42 100644 --- a/examples/osgshadow/osgshadow.cpp +++ b/examples/osgshadow/osgshadow.cpp @@ -931,6 +931,13 @@ int main(int argc, char** argv) double n=0.0; if (arguments.read("-n",n)) settings->setMinimumShadowMapNearFarRatio(n); + unsigned int numShadowMaps; + if (arguments.read("--num-sm",numShadowMaps)) settings->setNumShadowMapsPerLight(numShadowMaps); + + if (arguments.read("--parallel-split") || arguments.read("--ps") ) settings->setMultipleShadowMapHint(osgShadow::ShadowSettings::PARALLEL_SPLIT); + if (arguments.read("--cascaded")) settings->setMultipleShadowMapHint(osgShadow::ShadowSettings::CASCADED); + + int mapres = 1024; while (arguments.read("--mapres", mapres)) settings->setTextureSize(osg::Vec2s(mapres,mapres));