update SDRender

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5475 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 4eaacf85417298ff7d7a2d1761546aa5bae9712d
Former-commit-id: 637875b30256a9c1a6ab23ce7ebdf9555f9ad87e
This commit is contained in:
torcs-ng 2013-05-25 20:38:42 +00:00
parent d119767485
commit d81af8b3db

View file

@ -37,7 +37,7 @@
#include <osgShadow/ParallelSplitShadowMap>
#include <osgShadow/LightSpacePerspectiveShadowMap>
#include <osgShadow/StandardShadowMap>
#include <osgShadow/ViewDependentShadowMap>
//#include <osgShadow/ViewDependentShadowMap>
#include "OsgMain.h"
#include "OsgRender.h"
@ -453,15 +453,27 @@ void SDRender::ShadowedScene()
}
else if (SHADOW_TECHNIQUE == 2)
{
osg::ref_ptr<osgShadow::ViewDependentShadowMap> vdsm = new osgShadow::ViewDependentShadowMap;
//vdsm->setLight(sunLight.get());
//vdsm->setTextureSize(osg::Vec2s(4096, 4096));
osg::ref_ptr<osgShadow::SoftShadowMap> vdsm = new osgShadow::SoftShadowMap;
vdsm->setLight(sunLight.get());
vdsm->setTextureSize(osg::Vec2s(4096, 4096));
vdsm->setTextureUnit(1);
shadowRoot = new osgShadow::ShadowedScene;
osgShadow::ShadowSettings* settings = shadowRoot->getShadowSettings();
settings->setReceivesShadowTraversalMask(rcvShadowMask);
settings->setCastsShadowTraversalMask(castShadowMask);
shadowRoot->setShadowTechnique((vdsm.get()));
}
else if (SHADOW_TECHNIQUE == 3)
{
osg::ref_ptr<osgShadow::ShadowVolume> sv = new osgShadow::ShadowVolume;
sv->setDynamicShadowVolumes(TRUE);
sv->setDrawMode(osgShadow::ShadowVolumeGeometry::STENCIL_TWO_PASS);
shadowRoot = new osgShadow::ShadowedScene;
osgShadow::ShadowSettings* settings = shadowRoot->getShadowSettings();
settings->setReceivesShadowTraversalMask(rcvShadowMask);
settings->setCastsShadowTraversalMask(castShadowMask);
shadowRoot->setShadowTechnique((sv.get()));
}
shadowRoot->addChild(m_scene.get());
shadowRoot->addChild(m_CarRoot.get());