![]() |
VR-Forces Developer's Guide
|
Holds all state for a single shadow cascade split.
The cascaded shadow map (CSM) technique divides the view frustum into a series of progressively farther depth ranges (splits). Each split gets its own shadow map rendered from the light's point of view, allowing high-resolution shadows near the viewer that gracefully fall off at greater distances.
A DtCascadeData instance owns everything needed to render and sample one such split: the shadow camera, the texture-space projection matrix used by receivers, the per-split polygon offset, and bookkeeping state for selective refresh and debug visualization. Instances are stored in DtPerChannelData::myCascades, indexed by their logical split order (nearest to farthest, with the optional far cascade last).
Public Attributes | |
| osg::ref_ptr< osg::Camera > | myCamera |
| osg::ref_ptr< osg::Uniform > | myAtlasTexOffsetAndScaleUniform |
| osg::ref_ptr< osg::PolygonOffset > | myPolygonOffset |
| unsigned int | mySplitIndex |
| unsigned int | myRefreshAge |
| bool | myRefresh |
| float | myImportance |
| double | mySplitFarDistance |
| osg::Matrix | myTextureViewProjMatrix |
| osg::ref_ptr< DtOsgDebugFrustum > | myFrustum |
| osg::ref_ptr < osg::MatrixTransform > | myTarget |
| osg::ref_ptr< osg::Geometry > | myOrthoBox |
| osg::ref_ptr<osg::Camera> makVrv::DtCascadeData::myCamera |
The OSG camera used to render this cascade's shadow map from the light's point of view. May be null if viewport multicast is active and this split shares a physical camera with adjacent splits.
| osg::ref_ptr<osg::Uniform> makVrv::DtCascadeData::myAtlasTexOffsetAndScaleUniform |
Uniform that provides the UV offset and scale needed to locate this cascade's shadow map tile within the shadow atlas texture.
| osg::ref_ptr<osg::PolygonOffset> makVrv::DtCascadeData::myPolygonOffset |
Polygon offset applied during shadow map rendering for this split to reduce self-shadowing artifacts (shadow acne). Each split may have its own tuned values.
The logical index of this cascade within DtPerChannelData::myCascades (0 = nearest). Used to identify the split in shader uniforms and during selective refresh decisions.
Tracks how many frames have elapsed since this cascade was last refreshed. Used to implement the cached far cascade feature, where distant splits are re-rendered less frequently than near splits.
| bool makVrv::DtCascadeData::myRefresh |
When true, this cascade's shadow map will be re-rendered on the current frame. Set by the refresh scheduling logic based on importance, age, and whether the camera or light has moved significantly.
| float makVrv::DtCascadeData::myImportance |
A normalized priority score [0, 1] used by the refresh scheduler to determine how urgently this cascade needs to be updated. Higher importance cascades (typically nearer splits or those covering fast-moving regions) are refreshed more often. Updated each frame by DtPerChannelData::updateCascadeImportance().
| double makVrv::DtCascadeData::mySplitFarDistance |
The far plane distance (in view space) for this cascade split. Defines the boundary between this split and the next farther one. Used when computing the split's light-space projection matrix and for updating the split distance shader uniforms.
| osg::Matrix makVrv::DtCascadeData::myTextureViewProjMatrix |
The combined light-view and texture-projection matrix for this cascade. Transforms world-space positions into the shadow map's UV and depth space, allowing shadow receivers to look up depth values in the shadow texture.
| osg::ref_ptr<DtOsgDebugFrustum> makVrv::DtCascadeData::myFrustum |
Debug visualization of this cascade's light-space frustum, rendered as a wireframe in the scene when shadow visualization is enabled.
| osg::ref_ptr<osg::MatrixTransform> makVrv::DtCascadeData::myTarget |
Scene graph node used to position this cascade's debug frustum visualization at the correct world-space location.
| osg::ref_ptr<osg::Geometry> makVrv::DtCascadeData::myOrthoBox |
Geometry representing the orthographic bounding box of this cascade in light space. Used for debug visualization of the shadow camera's coverage area.