Added support for set/getUniform and set/getProgram into osg::StateSet.

This commit is contained in:
Robert Osfield
2005-03-11 20:29:21 +00:00
parent 3005f34cc4
commit a2e8bc6267
13 changed files with 1635 additions and 248 deletions

View File

@@ -18,8 +18,11 @@
#include <osg/ShadowVolumeOccluder>
#include <osg/Referenced>
namespace osg {
#define COMPILE_WITH_SHADOW_OCCLUSION_CULLING
/** A CullingSet class which contains a frustum and a list of occluders. */
class SG_EXPORT CullingSet : public Referenced
{
@@ -222,7 +225,7 @@ class SG_EXPORT CullingSet : public Referenced
{
if (((bs.center()*_pixelSizeVector)*_smallFeatureCullingPixelSize)>bs.radius()) return true;
}
#ifdef COMPILE_WITH_SHADOW_OCCLUSION_CULLING
if (_mask&SHADOW_OCCLUSION_CULLING)
{
// is it in one of the shadow occluder volumes.
@@ -236,7 +239,7 @@ class SG_EXPORT CullingSet : public Referenced
}
}
}
#endif
return false;
}
@@ -244,6 +247,7 @@ class SG_EXPORT CullingSet : public Referenced
{
_frustum.pushCurrentMask();
#ifdef COMPILE_WITH_SHADOW_OCCLUSION_CULLING
if (!_occluderList.empty())
{
for(OccluderList::iterator itr=_occluderList.begin();
@@ -253,12 +257,14 @@ class SG_EXPORT CullingSet : public Referenced
itr->pushCurrentMask();
}
}
#endif
}
inline void popCurrentMask()
{
_frustum.popCurrentMask();
#ifdef COMPILE_WITH_SHADOW_OCCLUSION_CULLING
if (!_occluderList.empty())
{
for(OccluderList::iterator itr=_occluderList.begin();
@@ -268,6 +274,7 @@ class SG_EXPORT CullingSet : public Referenced
itr->popCurrentMask();
}
}
#endif
}
void disableAndPushOccludersCurrentMask(NodePath& nodePath);