SoftShadowMap
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGSHADOW_SOFTSHADOWMAP
#define OSGSHADOW_SOFTSHADOWMAP 1
#include <osg/Camera>
#include <osg/Material>
#include <osg/MatrixTransform>
#include <osg/LightSource>
#include <osgShadow/ShadowMap>
namespace osgShadow {
class OSGSHADOW_EXPORT SoftShadowMap : public ShadowMap
{
public :
SoftShadowMap();
SoftShadowMap(const SoftShadowMap& es, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgShadow, SoftShadowMap);
void setSoftnessWidth(float softnessWidth);
float getSoftnessWidth() const { return _softnessWidth; }
void setJitteringScale(float jitteringScale);
float getJitteringScale() const { return _jitteringScale; }
void setJitterTextureUnit(unsigned int jitterTextureUnit);
unsigned int getJitterTextureUnit() const { return _jitterTextureUnit; }
void setBias(float bias) { setPolygonOffset(osg::Vec2(bias,0)); }
float getBias() const { return getPolygonOffset().x(); }
protected:
virtual ~SoftShadowMap(void) {};
void createUniforms();
void createShaders();
void initJittering(osg::StateSet *ss);
osg::ref_ptr<osg::Uniform> _softnessWidthUniform;
osg::ref_ptr<osg::Uniform> _jitteringScaleUniform;
float _softnessWidth;
float _jitteringScale;
unsigned int _jitterTextureUnit;
};
}
#endif
Camera
LightSource
Material
MatrixTransform
ShadowMap
osgShadow::ShadowMap::ShadowMap
ShadowMap()
osgShadow::ShadowMap::setPolygonOffset
void setPolygonOffset(const osg::Vec2 &polyOffset)
osgShadow::ShadowMap::getPolygonOffset
const osg::Vec2 & getPolygonOffset() const
Definition ShadowMap:46
osgShadow::SoftShadowMap::createUniforms
void createUniforms()
osgShadow::SoftShadowMap::META_Object
META_Object(osgShadow, SoftShadowMap)
osgShadow::SoftShadowMap::_jitteringScale
float _jitteringScale
Definition SoftShadowMap:83
osgShadow::SoftShadowMap::getJitteringScale
float getJitteringScale() const
Definition SoftShadowMap:52
osgShadow::SoftShadowMap::SoftShadowMap
SoftShadowMap(const SoftShadowMap &es, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgShadow::SoftShadowMap::createShaders
void createShaders()
osgShadow::SoftShadowMap::_jitteringScaleUniform
osg::ref_ptr< osg::Uniform > _jitteringScaleUniform
Definition SoftShadowMap:81
osgShadow::SoftShadowMap::setJitterTextureUnit
void setJitterTextureUnit(unsigned int jitterTextureUnit)
osgShadow::SoftShadowMap::initJittering
void initJittering(osg::StateSet *ss)
osgShadow::SoftShadowMap::setJitteringScale
void setJitteringScale(float jitteringScale)
osgShadow::SoftShadowMap::SoftShadowMap
SoftShadowMap()
osgShadow::SoftShadowMap::_softnessWidth
float _softnessWidth
Definition SoftShadowMap:82
osgShadow::SoftShadowMap::_jitterTextureUnit
unsigned int _jitterTextureUnit
Definition SoftShadowMap:84
osgShadow::SoftShadowMap::getBias
float getBias() const
Definition SoftShadowMap:69
osgShadow::SoftShadowMap::setBias
void setBias(float bias)
Definition SoftShadowMap:66
osgShadow::SoftShadowMap::getJitterTextureUnit
unsigned int getJitterTextureUnit() const
Definition SoftShadowMap:58
osgShadow::SoftShadowMap::getSoftnessWidth
float getSoftnessWidth() const
Definition SoftShadowMap:42
osgShadow::SoftShadowMap::~SoftShadowMap
virtual ~SoftShadowMap(void)
Definition SoftShadowMap:73
osgShadow::SoftShadowMap::_softnessWidthUniform
osg::ref_ptr< osg::Uniform > _softnessWidthUniform
Definition SoftShadowMap:80
osgShadow::SoftShadowMap::setSoftnessWidth
void setSoftnessWidth(float softnessWidth)
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::StateSet
Definition StateSet:46
osg::ref_ptr
Definition ref_ptr:32
osgShadow
Definition ConvexPolyhedron:33
osg::Vec2
Vec2f Vec2
Definition Vec2:21
OSGSHADOW_EXPORT
#define OSGSHADOW_EXPORT
Definition osgShadow/Export:39