openscenegraph
SoftShadowMap
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGSHADOW_SOFTSHADOWMAP
15#define OSGSHADOW_SOFTSHADOWMAP 1
16
17#include <osg/Camera>
18#include <osg/Material>
19#include <osg/MatrixTransform>
20#include <osg/LightSource>
21
22#include <osgShadow/ShadowMap>
23
24namespace osgShadow {
25
28{
29 public :
31
33
35
39 void setSoftnessWidth(float softnessWidth);
40
42 float getSoftnessWidth() const { return _softnessWidth; }
43
49 void setJitteringScale(float jitteringScale);
50
52 float getJitteringScale() const { return _jitteringScale; }
53
55 void setJitterTextureUnit(unsigned int jitterTextureUnit);
56
58 unsigned int getJitterTextureUnit() const { return _jitterTextureUnit; }
59
60
66 void setBias(float bias) { setPolygonOffset(osg::Vec2(bias,0)); }
67
69 float getBias() const { return getPolygonOffset().x(); }
70
71
72 protected:
73 virtual ~SoftShadowMap(void) {};
74
79
84 unsigned int _jitterTextureUnit;
85
86
87
88};
89
90}
91
92#endif
Definition ShadowMap:28
Definition SoftShadowMap:28
META_Object(osgShadow, SoftShadowMap)
float _jitteringScale
Definition SoftShadowMap:83
float getJitteringScale() const
Definition SoftShadowMap:52
SoftShadowMap(const SoftShadowMap &es, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osg::ref_ptr< osg::Uniform > _jitteringScaleUniform
Definition SoftShadowMap:81
void setJitterTextureUnit(unsigned int jitterTextureUnit)
void initJittering(osg::StateSet *ss)
void setJitteringScale(float jitteringScale)
float _softnessWidth
Definition SoftShadowMap:82
unsigned int _jitterTextureUnit
Definition SoftShadowMap:84
float getBias() const
Definition SoftShadowMap:69
void setBias(float bias)
Definition SoftShadowMap:66
unsigned int getJitterTextureUnit() const
Definition SoftShadowMap:58
float getSoftnessWidth() const
Definition SoftShadowMap:42
virtual ~SoftShadowMap(void)
Definition SoftShadowMap:73
osg::ref_ptr< osg::Uniform > _softnessWidthUniform
Definition SoftShadowMap:80
void setSoftnessWidth(float softnessWidth)
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Definition StateSet:46
Definition Vec2f:29
Definition ref_ptr:32
Definition ConvexPolyhedron:33
#define OSGSHADOW_EXPORT
Definition osgShadow/Export:39