![]() |
VR-Forces 4.6.1 Class Documentation
|
The DtOsgShadowTechnique class implements a robust shadow mapping system. More...

Classes | |
| struct | CameraDescription |
| struct | CascadeImportanceData |
| struct | CloudShadowPreDrawCallback |
| struct | CsmSplitData |
| struct | PerChannelData |
Public Member Functions | |
| DtOsgShadowTechnique (DtDe &de) | |
| CTOR. | |
| DtOsgShadowTechnique (const DtOsgShadowTechnique &es, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
| DTOR. | |
| virtual osg::Object * | cloneType () const |
| Creates a new object of Type DtOsgShadowTechnique. | |
| virtual osg::Object * | clone (const osg::CopyOp ©op) const |
| Creates a new copy of DtOsgShadowTechnique object. | |
| virtual bool | isSameKindAs (const osg::Object *obj) const |
| Returns true if object is of the DtOsgShadowTechnique class. Otherwise, returns false. | |
| virtual const char * | libraryName () const |
| Returns the namespace string. | |
| virtual const char * | className () const |
| Returns the class name string. | |
| virtual void | init () |
| Overrides the osgShadow::ShadowTechnique::init method. | |
| virtual void | postConstructionInit () |
| another init function | |
| virtual void | update (osg::NodeVisitor &nv) |
| Overrides the osgShadow::ShadowTechnique::update method. | |
| virtual void | cull (osgUtil::CullVisitor &cv) |
| Overrides the osgShadow::ShadowTechnique::cull method. | |
| virtual void | cleanSceneGraph () |
| Overrides the osgShadow::ShadowTechnique::cleanSceneGraph method. | |
| void | setChannelShadowState (DtOsgChannel *osgChannel, bool enable) |
| Set the shadow mode for channels. | |
| bool | getChannelShadowSettings (DtOsgChannel *osgChannel, DtShadowSettingsObject **shadowSettingObject, bool *isPlanView) |
| Gets the shadow settings for this channel. | |
| bool | getCameraCloudShadowMap (osg::Camera *camera, unsigned int *textureIndex, osg::Matrix *textureViewProjMatrix, unsigned int *textureIndex2, osg::Matrix *textureViewProjMatrix2) |
| Gets the cloud shadow map for this camera. | |
| void | setGlobalLight (osg::LightSource *light) |
| Sets global light source. | |
| const osg::LightSource * | getGlobalLight () const |
| Gets global light source. | |
| const osg::StateSet * | mapCameraToStateSet (const osg::Camera *camera) const |
| returns shared state set uniform infor for this camera, may be null | |
Static Public Member Functions | |
| static const std::string & | shadowCameraPrefixString (void) |
| static const std::string & | shadowSDSMCameraPrefixString (void) |
Public Attributes | |
| class ShadowTweakables * | myShadowUI |
Static Public Attributes | |
| static const int | MAX_NUM_CASCADES = 6 |
Protected Types | |
| typedef std::map< const osg::Camera *, osg::ref_ptr < PerChannelData > > | PerChannelDataMap |
Protected Member Functions | |
| virtual void | reInitialize (unsigned int quality) |
| Re-initialize perChannelData using the specified quality setting. | |
| virtual bool | configureShadowTraversalNodeMask (bool traverseEntities, bool traverseProps, bool traverseTerrain) |
| virtual void | slot_refresh_maps () |
| virtual std::string | generateVertexShader (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| Generates an optimized vertex shader given the shadow settings. | |
| virtual std::string | generateFragmentShader (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| Generates an optimized fragment shader given the shadow settings. | |
| virtual std::string | generateCloudShadowVertexShader (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| Generates an cloud shadow vertex shader given the shadow settings. | |
| unsigned int | getFilterCount (DtShadowSettingsObject *shadowSettingObject) |
| Gets the number of taps for percentage closer filtering(PCF) | |
| virtual | ~DtOsgShadowTechnique () |
| DTOR. | |
Protected Attributes | |
| PerChannelDataMap | myPerChannelDataMap |
| osg::ref_ptr< osg::LightSource > | myGlobalLight |
| osg::ref_ptr< osg::Uniform > | myLightDirectionUniform |
| DtDe & | myDe |
| osg::ref_ptr< osg::Program > | myVsmBlurTextureProgram |
| osg::ref_ptr< osg::Program > | myVsmBlurTexArrayProgram |
| osg::ref_ptr< osg::Program > | myVsmPassthroughArrayProgram |
| osg::ref_ptr< osg::Program > | myVsmPassthroughProgram |
| osg::ref_ptr< osg::Program > | myEsmBlurTextureProgram |
| osg::ref_ptr< osg::Program > | myEsmBlurTexArrayProgram |
| osg::ref_ptr< osg::Program > | myEVsmBlurTextureProgram |
| osg::ref_ptr< osg::Program > | myEVsmBlurTexArrayProgram |
Static Protected Attributes | |
| static const std::string | myShadowCameraPrefixString |
| static const std::string | mySDSMShadowCameraPrefixString |
Private Member Functions | |
| std::string | generateFragmentComputeShadowFunction (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| Generates an optimized fragment compute shadow function given the shadow settings. | |
| std::string | generateFragmentUniformAndVariables (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| Generates an optimized fragment uniforms and variables given the shadow settings. | |
| std::string | generateFragmentMain (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| Generates an optimized fragment main given the shadow settings. | |
| bool | getCameraSettings (osg::Camera *viewCamera, PerChannelData **perChannelData, DtShadowSettingsObject **shadowSettingObject, bool *isPlanView) |
| Gets camera shadow settings. | |
| void | initPerChannelData (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| Initializes per channel data. | |
| void | installRecieverVPandSharedStateSet (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| Initializes the virtual program and shared stateset for perChannelData. | |
| void | triggerExternalModuleShaderRefresh () |
| void | packTextureAtlas (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| Computes the total width and height for perChannelData. | |
| void | installSDSM (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| Install SDSM. | |
| void | traverseSDSMCameras (CurrentPassData &d, osgUtil::CullVisitor &cv) |
| Traverses SDSM Cameras. | |
| void | installCloudShadows (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| Initializes per channel cloud shadows. | |
| void | updateCloudShadows (osg::RenderInfo &renderInfo, osg::Camera *camera) |
| Updates per camera cloud shadows. | |
| void | updateCascadeImportance (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| Updates Cascade Importance. | |
| osg::Program * | getProgramFromFile (const std::string &szVertexShader, const std::string &szFragmentShader) |
| Creates a Program with a vertex and fragment shader. | |
| void | installPreFilter (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject, osg::Camera *depthCamera, osg::Camera *xBlurCamera, osg::Camera *yBlurCamera, osg::Texture2D *texture, osg::StateSet *stateSet, unsigned int textureUnit) |
| Installs PreFilter for texture 2d. | |
| void | installPreFilter (PerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject, osg::Camera *depthCamera, osg::Camera *xBlurCamera, osg::Camera *yBlurCamera, unsigned int textureLayer, osg::Texture2DArray *texture2DArray, osg::Texture2DArray *preFilterTexture2DArray1, osg::Texture2DArray *preFilterTexture2DArray2) |
| Installs PreFilter for texture 2d Array. | |
| void | setupReverseZBuffer (osg::Camera *depthCamera, osg::Camera *xBlurCamera, osg::Camera *yBlurCamera) |
| void | setupBlurCamera (osg::Camera *camera, osg::ref_ptr< osg::Program > &blurProgram, const osg::Vec2 &direction) |
| osg::Texture2D * | createTexture2D (int width, int height, GLenum internalFormat, GLenum sourceFormat, GLenum sourceType, bool shadowComparisonMode, osg::Texture2D::FilterMode minFilter=osg::Texture2D::NEAREST, osg::Texture2D::FilterMode magFilter=osg::Texture2D::NEAREST) |
| Creates 2d texture. | |
| osg::Texture2DArray * | createTexture2DArray (int width, int height, int depth, GLenum internalFormat, GLenum sourceFormat, GLenum sourceType, bool shadowComparisonMode, osg::Texture2DArray::FilterMode minFilter=osg::Texture2DArray::NEAREST, osg::Texture2DArray::FilterMode magFilter=osg::Texture2DArray::NEAREST) |
| Creates 2d texture array. | |
| osg::Camera * | createCamera (int width, int height, GLbitfield clearMask) |
| Creates a simple camera. | |
| osg::Geode * | createFullScreenQuad (const osg::Vec2 &size, const osg::Vec2 &uvStart, const osg::Vec2 &uvStop) |
| Creates a full screen quad. | |
| osg::Camera * | createHudCamera (int width, int height, GLbitfield clearMask, const char *name=NULL) |
| Creates a hud camera with a full screen quad. | |
| double | computeUniformSplit (double nearDistance, double farDistance, unsigned int splitIndex, unsigned int numSplits) |
| Compute uniform split distance for specified cascade. | |
| double | computeLogarithmicSplit (double nearDistance, double farDistance, unsigned int splitIndex, unsigned int numSplits) |
| Compute logarithm split distance for specified cascade. | |
| CameraDescription | constructSplitLightCamera (const CurrentPassData &d, int split_index, bool farCascade=false) |
| Compute logarithm split distance for specified cascade. | |
| void | updateCameras (const CurrentPassData &d) |
| void | getSplitCameraDistances (const CurrentPassData &d, int split_index, double &splitCamNear, double &splitCamFar) |
| void | setDirty (bool dirty) |
| Sets dirty for shadow technique's to true or false. | |
| void | frustumBoundingBoxLightViewSpace (const CurrentPassData &d, int split_index, const osg::Matrix &lightViewMatrix, double nearPlane, double farPlane, osg::Vec3d &minFrustum, osg::Vec3d &maxFrustum) |
Friends | |
| struct | CurrentPassData |
The DtOsgShadowTechnique class implements a robust shadow mapping system.
|
protected |
| makVrv::DtOsgShadowTechnique::DtOsgShadowTechnique | ( | DtDe & | de | ) |
CTOR.
| makVrv::DtOsgShadowTechnique::DtOsgShadowTechnique | ( | const DtOsgShadowTechnique & | es, |
| const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY |
||
| ) |
DTOR.
|
protectedvirtual |
DTOR.
|
inlinevirtual |
Creates a new object of Type DtOsgShadowTechnique.
|
inlinevirtual |
Creates a new copy of DtOsgShadowTechnique object.
|
inlinevirtual |
Returns true if object is of the DtOsgShadowTechnique class. Otherwise, returns false.
|
inlinevirtual |
Returns the namespace string.
|
inlinevirtual |
Returns the class name string.
|
virtual |
Overrides the osgShadow::ShadowTechnique::init method.
|
virtual |
another init function
|
virtual |
Overrides the osgShadow::ShadowTechnique::update method.
|
virtual |
Overrides the osgShadow::ShadowTechnique::cull method.
|
virtual |
Overrides the osgShadow::ShadowTechnique::cleanSceneGraph method.
| void makVrv::DtOsgShadowTechnique::setChannelShadowState | ( | DtOsgChannel * | osgChannel, |
| bool | enable | ||
| ) |
Set the shadow mode for channels.
| bool makVrv::DtOsgShadowTechnique::getChannelShadowSettings | ( | DtOsgChannel * | osgChannel, |
| DtShadowSettingsObject ** | shadowSettingObject, | ||
| bool * | isPlanView | ||
| ) |
Gets the shadow settings for this channel.
| bool makVrv::DtOsgShadowTechnique::getCameraCloudShadowMap | ( | osg::Camera * | camera, |
| unsigned int * | textureIndex, | ||
| osg::Matrix * | textureViewProjMatrix, | ||
| unsigned int * | textureIndex2, | ||
| osg::Matrix * | textureViewProjMatrix2 | ||
| ) |
Gets the cloud shadow map for this camera.
|
inline |
Sets global light source.
|
inline |
Gets global light source.
|
static |
|
static |
| const osg::StateSet* makVrv::DtOsgShadowTechnique::mapCameraToStateSet | ( | const osg::Camera * | camera | ) | const |
returns shared state set uniform infor for this camera, may be null
Re-initialize perChannelData using the specified quality setting.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Generates an optimized vertex shader given the shadow settings.
|
protectedvirtual |
Generates an optimized fragment shader given the shadow settings.
|
protectedvirtual |
Generates an cloud shadow vertex shader given the shadow settings.
|
protected |
Gets the number of taps for percentage closer filtering(PCF)
|
private |
Generates an optimized fragment compute shadow function given the shadow settings.
|
private |
Generates an optimized fragment uniforms and variables given the shadow settings.
|
private |
Generates an optimized fragment main given the shadow settings.
|
private |
Gets camera shadow settings.
|
private |
Initializes per channel data.
|
private |
Initializes the virtual program and shared stateset for perChannelData.
|
private |
|
private |
Computes the total width and height for perChannelData.
|
private |
Install SDSM.
|
private |
Traverses SDSM Cameras.
|
private |
Initializes per channel cloud shadows.
|
private |
Updates per camera cloud shadows.
|
private |
Updates Cascade Importance.
|
private |
Creates a Program with a vertex and fragment shader.
|
private |
Installs PreFilter for texture 2d.
|
private |
Installs PreFilter for texture 2d Array.
|
private |
|
private |
|
private |
Creates 2d texture.
|
private |
Creates 2d texture array.
|
private |
Creates a simple camera.
|
private |
Creates a full screen quad.
|
private |
Creates a hud camera with a full screen quad.
|
private |
Compute uniform split distance for specified cascade.
|
private |
Compute logarithm split distance for specified cascade.
|
private |
Compute logarithm split distance for specified cascade.
|
private |
|
private |
|
inlineprivate |
Sets dirty for shadow technique's to true or false.
|
private |
|
friend |
| class ShadowTweakables* makVrv::DtOsgShadowTechnique::myShadowUI |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |