OpenSceneGraph 3.6.5
ShadowSettings
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-20 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_SHADOWSETTINGS
15#define OSGSHADOW_SHADOWSETTINGS 1
16
17#include <osg/Uniform>
18#include <osg/CullSettings>
19#include <osgShadow/Export>
20
21namespace osgShadow {
22
25{
26 public:
29
31
34
35 void setCastsShadowTraversalMask(unsigned int mask) { _castsShadowTraversalMask = mask; }
37
40
41
45 void setLightNum(int lightNum) { _lightNum = lightNum; }
46 int getLightNum() const { return _lightNum; }
47
48 void setBaseShadowTextureUnit(unsigned int unit) { _baseShadowTextureUnit = unit; }
49 unsigned int getBaseShadowTextureUnit() const { return _baseShadowTextureUnit; }
50
53 void setUseOverrideForShadowMapTexture(bool useOverride) { _useShadowMapTextureOverride = useOverride; }
54
57
58
60 void setTextureSize(const osg::Vec2s& textureSize) { _textureSize = textureSize; }
61
63 const osg::Vec2s& getTextureSize() const { return _textureSize; }
64
67
68 void setMaximumShadowMapDistance(double distance) { _maximumShadowMapDistance = distance; }
70
71
77
80
89
90
91 void setNumShadowMapsPerLight(unsigned int numShadowMaps) { _numShadowMapsPerLight = numShadowMaps; }
92 unsigned int getNumShadowMapsPerLight() const { return _numShadowMapsPerLight; }
93
99
102
103
110
111 void setShaderHint(ShaderHint shaderHint) { _shaderHint = shaderHint; }
113
114 void setDebugDraw(bool debugDraw) { _debugDraw = debugDraw; }
115 bool getDebugDraw() const { return _debugDraw; }
116
117 protected:
118
120
121
124
126
131
136
139
142
143};
144
145}
146
147#endif
The osgShadow library is a NodeKit that extends the core scene graph to add support for a range of sh...
Definition ConvexPolyhedron:33
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
ComputeNearFarMode
Definition CullSettings:161
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Definition Vec2s:20
ShaderHint getShaderHint() const
Definition ShadowSettings:112
const osg::Vec2s & getTextureSize() const
Get the size of the shadow map textures.
Definition ShadowSettings:63
void setNumShadowMapsPerLight(unsigned int numShadowMaps)
Definition ShadowSettings:91
osg::CullSettings::ComputeNearFarMode _computeNearFearModeOverride
Definition ShadowSettings:125
void setMinimumShadowMapNearFarRatio(double ratio)
Definition ShadowSettings:65
ShadowSettings(const ShadowSettings &ss, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
void setDebugDraw(bool debugDraw)
Definition ShadowSettings:114
void setUseOverrideForShadowMapTexture(bool useOverride)
Set whether to use osg::StateAttribute::OVERRIDE for the shadow map texture.
Definition ShadowSettings:53
ShadowMapProjectionHint getShadowMapProjectionHint() const
Definition ShadowSettings:79
void setShadowMapProjectionHint(ShadowMapProjectionHint hint)
Definition ShadowSettings:78
double _minimumShadowMapNearFarRatio
Definition ShadowSettings:132
ShadowMapProjectionHint _shadowMapProjectionHint
Definition ShadowSettings:134
void setCastsShadowTraversalMask(unsigned int mask)
Definition ShadowSettings:35
void setLightNum(int lightNum)
Set the LightNum of the light in the scene to assign a shadow for.
Definition ShadowSettings:45
bool _debugDraw
Definition ShadowSettings:141
unsigned int getCastsShadowTraversalMask() const
Definition ShadowSettings:36
double getPerspectiveShadowMapCutOffAngle() const
Definition ShadowSettings:88
ShaderHint
Definition ShadowSettings:105
@ NO_SHADERS
Definition ShadowSettings:106
@ PROVIDE_FRAGMENT_SHADER
Definition ShadowSettings:107
@ PROVIDE_VERTEX_AND_FRAGMENT_SHADER
Definition ShadowSettings:108
bool getDebugDraw() const
Definition ShadowSettings:115
osg::CullSettings::ComputeNearFarMode getComputeNearFarModeOverride() const
Definition ShadowSettings:39
double _maximumShadowMapDistance
Definition ShadowSettings:133
bool _useShadowMapTextureOverride
Definition ShadowSettings:129
META_Object(osgShadow, ShadowSettings)
unsigned int getNumShadowMapsPerLight() const
Definition ShadowSettings:92
MultipleShadowMapHint getMultipleShadowMapHint() const
Definition ShadowSettings:101
void setMaximumShadowMapDistance(double distance)
Definition ShadowSettings:68
void setMultipleShadowMapHint(MultipleShadowMapHint hint)
Definition ShadowSettings:100
void setTextureSize(const osg::Vec2s &textureSize)
Set the size of the shadow map textures.
Definition ShadowSettings:60
unsigned int getReceivesShadowTraversalMask() const
Definition ShadowSettings:33
void setShaderHint(ShaderHint shaderHint)
Definition ShadowSettings:111
unsigned int _numShadowMapsPerLight
Definition ShadowSettings:137
int _lightNum
Definition ShadowSettings:127
unsigned int _receivesShadowTraversalMask
Definition ShadowSettings:122
bool getUseOverrideForShadowMapTexture() const
Get whether to use osg::StateAttribute::OVERRIDE for the shadow map texture.
Definition ShadowSettings:56
void setBaseShadowTextureUnit(unsigned int unit)
Definition ShadowSettings:48
double getMaximumShadowMapDistance() const
Definition ShadowSettings:69
MultipleShadowMapHint _multipleShadowMapHint
Definition ShadowSettings:138
unsigned int _baseShadowTextureUnit
Definition ShadowSettings:128
void setComputeNearFarModeOverride(osg::CullSettings::ComputeNearFarMode cnfn)
Definition ShadowSettings:38
void setPerspectiveShadowMapCutOffAngle(double angle)
Set the cut off angle, in degrees, between the light direction and the view direction that determines...
Definition ShadowSettings:87
MultipleShadowMapHint
Definition ShadowSettings:95
@ CASCADED
Definition ShadowSettings:97
@ PARALLEL_SPLIT
Definition ShadowSettings:96
double _perspectiveShadowMapCutOffAngle
Definition ShadowSettings:135
ShaderHint _shaderHint
Definition ShadowSettings:140
int getLightNum() const
Definition ShadowSettings:46
unsigned int _castsShadowTraversalMask
Definition ShadowSettings:123
osg::Vec2s _textureSize
Definition ShadowSettings:130
void setReceivesShadowTraversalMask(unsigned int mask)
Definition ShadowSettings:32
unsigned int getBaseShadowTextureUnit() const
Definition ShadowSettings:49
double getMinimumShadowMapNearFarRatio() const
Definition ShadowSettings:66
ShadowMapProjectionHint
Definition ShadowSettings:73
@ ORTHOGRAPHIC_SHADOW_MAP
Definition ShadowSettings:74
@ PERSPECTIVE_SHADOW_MAP
Definition ShadowSettings:75
#define OSGSHADOW_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 20 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.