From Adrian Egli, further work on PSSM implementation.

This commit is contained in:
Robert Osfield
2007-09-24 15:24:23 +00:00
parent a4f79e7a37
commit d11d5b819a
3 changed files with 143 additions and 31 deletions

View File

@@ -20,8 +20,9 @@
#include <osg/Material>
#include <osgShadow/ShadowTechnique>
namespace osgShadow {
class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique
{
public:
@@ -56,6 +57,38 @@ class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique
/** Set the texture resolution */
inline void setTextureResolution(unsigned int resolution) { _resolution = resolution; }
/** Set the max far distance */
inline void setMaxFarDistance(double farDist) { _setMaxFarDistance = farDist; _isSetMaxFarDistance = true; }
/** Force to add a osg::CullFace::FRONT state */
inline void forceFrontCullFace() { _useFrontCullFace = true; }
/** Set min near distance for splits */
inline void setMinNearDistanceForSplits(double nd){ _split_min_near_dist=nd; }
/** use linear split (default: linear) */
inline void useLinearSplit(bool flag) { _linearSplit = flag;}
/**
light / |
\ / |
min near dist / |
for splits / |
\ / <20> |
./ \ <20> |
| \ <20> |
| x <20> |
| <20> |
. | |
\ <20> |
\ <20> |
\ |
\ |
\ |
.<- max far dist. ->.
*/
protected :
virtual ~ParallelSplitShadowMap() {}
@@ -119,6 +152,15 @@ class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique
unsigned int _resolution;
double _setMaxFarDistance;
bool _isSetMaxFarDistance;
bool _useFrontCullFace;
double _split_min_near_dist;
bool _linearSplit;
};
}
#endif