![]() |
VR-Forces 5.0.2 Developer's Guide
|
The DtOsgShadowTechnique class implements a robust shadow mapping system.

Classes | |
| struct | CameraDescription |
Public Member Functions | |
| DtOsgShadowTechnique (DtDe &de) | |
| DtOsgShadowTechnique (const DtOsgShadowTechnique &es, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
| virtual osg::Object * | cloneType () const |
| virtual osg::Object * | clone (const osg::CopyOp ©op) const |
| virtual bool | isSameKindAs (const osg::Object *obj) const |
| virtual const char * | libraryName () const |
| virtual const char * | className () const |
| virtual void | init () |
| virtual void | postConstructionInit () |
| virtual void | update (osg::NodeVisitor &nv) |
| virtual void | cull (osgUtil::CullVisitor &cv) |
| virtual void | cleanSceneGraph () |
| void | setChannelShadowState (DtOsgChannel *osgChannel, bool enable) |
| bool | getChannelShadowSettings (DtOsgChannel *osgChannel, DtShadowSettingsObject **shadowSettingObject, bool *isPlanView) |
| bool | getCameraCloudShadowMap (osg::Camera *camera, unsigned int *textureIndex, osg::Matrix *textureViewProjMatrix, unsigned int *textureIndex2, osg::Matrix *textureViewProjMatrix2) |
| void | setGlobalLight (osg::LightSource *light) |
| const osg::LightSource * | getGlobalLight () const |
| const osg::StateSet * | mapCameraToStateSet (const osg::Camera *camera) const |
| virtual void | resizeGLObjectBuffers (unsigned int maxSize) override |
| virtual void | releaseGLObjects (osg::State *=0) const override |
Static Public Member Functions | |
| static const std::string & | shadowCameraPrefixString (void) |
| static const std::string & | shadowSDSMCameraPrefixString (void) |
Public Attributes | |
| class DtShadowTweakables * | myShadowUI |
Static Public Attributes | |
| static const int | MAX_NUM_CASCADES = 6 |
Protected Types | |
| typedef std::map< const osg::Camera *, osg::ref_ptr < DtPerChannelData > > | PerChannelDataMap |
| typedef std::vector < osg::ref_ptr < DtPerChannelData > > | PerChannelDataVector |
Protected Member Functions | |
| virtual void | reInitialize (unsigned int quality) |
| virtual void | cleanupOldPerChannelData () |
| virtual bool | configureShadowTraversalNodeMask (bool traverseEntities, bool traverseProps, bool traverseTerrain) |
| virtual void | slot_refresh_maps () |
| virtual std::string | generateVertexShader (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| virtual std::string | generateFragmentShader (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| virtual std::string | generateCloudShadowVertexShader (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| unsigned int | getFilterCount (DtShadowSettingsObject *shadowSettingObject) |
| bool | getReceiveShadows (const DtShadowSettingsObject *shadowSettings) const |
| virtual | ~DtOsgShadowTechnique () |
Protected Attributes | |
| PerChannelDataMap | myPerChannelDataMap |
| PerChannelDataVector | myPerChannelDataDeleteList |
| osg::ref_ptr< osg::LightSource > | myGlobalLight |
| osg::ref_ptr< osg::Uniform > | myLightDirectionUniform |
| osg::ref_ptr< osg::Uniform > | myReceiveShadowsUniform |
| 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 |
| std::vector< osg::ref_ptr < osg::Camera > > | myDeferredDeleteCamera |
| tbb::mutex | myDeferredCameraDeletionMutex |
| bool | myMulticastIsSupported |
| bool | myShadingRateIsSupported |
Static Protected Attributes | |
| static const std::string | myShadowCameraPrefixString |
| static const std::string | mySDSMShadowCameraPrefixString |
Private Member Functions | |
| std::string | generateFragmentComputeShadowFunction (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| std::string | generateFragmentUniformAndVariables (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| std::string | generateFragmentMain (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| bool | getCameraSettings (osg::Camera *viewCamera, DtPerChannelData **perChannelData, DtShadowSettingsObject **shadowSettingObject, bool *isPlanView) |
| void | initPerChannelData (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| void | installReceiverVPandSharedStateSet (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| void | triggerExternalModuleShaderRefresh () |
| void | installSDSM (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| void | traverseSDSMCameras (DtCurrentPassData &d, osgUtil::CullVisitor &cv) |
| void | installCloudShadows (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| void | updateCloudShadows (osg::RenderInfo &renderInfo, osg::Camera *shadowCamera) |
| void | updateCascadeImportance (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject) |
| osg::Program * | getProgramFromFile (const std::string &szVertexShader, const std::string &szFragmentShader) |
| void | installPreFilter (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject, osg::Camera *depthCamera, osg::Camera *xBlurCamera, osg::Camera *yBlurCamera, osg::Texture2DArray *texture, osg::StateSet *stateSet, unsigned int textureUnit) |
| void | installPreFilter (DtPerChannelData *perChannelData, DtShadowSettingsObject *shadowSettingObject, osg::Camera *depthCamera, osg::Camera *xBlurCamera, osg::Camera *yBlurCamera, unsigned int textureLayer, osg::Texture2DArray *texture2DArray, osg::Texture2DArray *preFilterTexture2DArray1, osg::Texture2DArray *preFilterTexture2DArray2) |
| 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) |
| 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) |
| osg::Camera * | createCamera (int width, int height, GLbitfield clearMask) |
| osg::Geode * | createFullScreenQuad (const osg::Vec2 &size, const osg::Vec2 &uvStart, const osg::Vec2 &uvStop) |
| osg::Camera * | createHudCamera (int width, int height, GLbitfield clearMask, const char *name=NULL) |
| double | computeUniformSplit (double nearDistance, double farDistance, unsigned int splitIndex, unsigned int numSplits) |
| double | computeLogarithmicSplit (double nearDistance, double farDistance, unsigned int splitIndex, unsigned int numSplits) |
| CameraDescription | constructSplitLightCamera (const DtCurrentPassData &d, int split_index, bool farCascade=false) |
| void | updateCameras (const DtCurrentPassData &d) |
| void | getSplitCameraDistances (const DtCurrentPassData &d, int split_index, double &splitCamNear, double &splitCamFar) |
| void | setDirty (bool dirty) |
| void | frustumBoundingBoxLightViewSpace (const DtCurrentPassData &d, int split_index, const osg::Matrix &lightViewMatrix, double nearPlane, double farPlane, osg::Vec3d &minFrustum, osg::Vec3d &maxFrustum) |
Friends | |
| struct | DtCurrentPassData |
| struct | DtCloudShadowPreDrawCallback |
|
protected |
|
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
|
overridevirtual |
override from osg::ShadowTechnique
|
overridevirtual |
override from osg::ShadowTechnique
Re-initialize perChannelData using the specified quality setting.
|
protectedvirtual |
Since the perChannelData can hold graphics objects we need to clear them in the main render thread. only call this from the main render thread.
|
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)
|
protected |
True if scene receives shadows from any light casting source. This is used to bypass some shadow work otherwise.
|
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 |
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 |
|
friend |
| class DtShadowTweakables* makVrv::DtOsgShadowTechnique::myShadowUI |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |