Added replacement of the placeholder StateSet in the StateGraph with custom StateSet implemented just for the

needs of that particular frame.
This commit is contained in:
Robert Osfield
2011-08-09 06:54:44 +00:00
parent 4238629ebf
commit e4a73d121e
3 changed files with 50 additions and 36 deletions

View File

@@ -125,10 +125,11 @@ class OSGSHADOW_EXPORT ViewDependentShadowMap : public ShadowTechnique
virtual bool assignTexGenSettings(osgUtil::CullVisitor* cv, osg::Camera* camera, unsigned int textureUnit, osg::TexGen* texgen);
virtual void cullShadowReceivingScene(osgUtil::CullVisitor* cv, osg::StateSet* stateset) const;
virtual void cullShadowReceivingScene(osgUtil::CullVisitor* cv) const;
virtual void cullShadowCastingScene(osgUtil::CullVisitor* cv, osg::Camera* camera) const;
virtual osg::StateSet* selectStateSetForRenderingShadow(PositionedLightList& pll) const;
protected:
virtual ~ViewDependentShadowMap();
@@ -136,6 +137,8 @@ protected:
typedef std::map< osgUtil::CullVisitor*, osg::ref_ptr<ViewDependentData> > ViewDependentDataMap;
OpenThreads::Mutex _viewDependentDataMapMutex;
ViewDependentDataMap _viewDependentDataMap;
osg::ref_ptr<osg::StateSet> _shadowRecievingPlaceholderStateSet;
};

View File

@@ -100,7 +100,9 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
void setUserData(osg::Referenced* obj) { _userData = obj; }
osg::Referenced* getUserData() { return _userData.get(); }
const osg::Referenced* getUserData() const { return _userData.get(); }
void setStateSet(const osg::StateSet* stateset) { _stateset = stateset; }
#ifdef OSGUTIL_RENDERBACKEND_USE_REF_PTR
const osg::StateSet* getStateSet() const { return _stateset.get(); }
#else