VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
makVrv::DtPerChannelData Class Reference
Inheritance diagram for makVrv::DtPerChannelData:
Inheritance graph
[legend]

Public Member Functions

 DtPerChannelData (makVrv::DtDe &de, makVrv::DtOsgChannel &channel)
 
 DtPerChannelData ()=delete
 
 DtPerChannelData (const DtPerChannelData &rhs)=delete
 
DtPerChannelData & operator= (const DtPerChannelData &rhs)=delete
 
void resizeCascades (unsigned int logicalSplitCount, unsigned int cameraCount)
 
void updateCascadeImportance (const DtShadowSettingsObject *shadowSettings)
 
void updateCascadeOrthoBoxVisualizer (int splitIndex, const osg::Matrix &lightViewMatrix, const osg::Vec3d &segmentMin, const osg::Vec3d &segmentMax, const osg::Vec3d &frustumMin, const osg::Vec3d &frustumMax, float zPadding)
 

Protected Member Functions

virtual ~DtPerChannelData ()
 
void removeVisualizers ()
 
void initCascadeSplitVisualizers ()
 

Protected Attributes

makVrv::DtDe & myDe
 
std::vector< DtCascadeData > myCascades
 
unsigned int myCameraCount
 
osg::ref_ptr
< osg::MatrixTransform > 
myFrustumCenterTarget
 
osg::ref_ptr
< osgEarth::VirtualProgram > 
myVirtualProgram
 
osg::ref_ptr< osg::StateSet > mySharedStateSet
 
osg::ref_ptr< osg::Uniform > myShadowTexGenUniform
 
osg::ref_ptr< osg::Uniform > myReceiveShadowsUniform
 
osg::ref_ptr< osg::Uniform > myInverseShadowMapSizeUniform
 
double myRefreshTimer
 
bool myJustInitialized
 
bool myNotInitialized
 
makVrv::DtOsgChannel & myChannel
 
osg::Vec3d myLastCameraPosition
 
osg::Vec3d myLastLargeShadowMapCameraPosition
 
double myCurrentSimTimeScale
 
float myLastFarDistance
 
osg::ref_ptr< osg::Uniform > mySplitDistancesWorldUniform
 
osg::ref_ptr< osg::Uniform > myUseReverseZBuffer
 
osg::ref_ptr< osg::Uniform > myShadowAmbientFactorUniform
 
osg::ref_ptr< osg::Uniform > myInvNumSplitsInterpUniform
 
osg::ref_ptr< osg::Group > myVisualizersGroup
 
osg::ref_ptr< osg::Geode > myVisualizers
 
osg::ref_ptr< osg::Camera > myOverlayDebugCamera
 
osg::ref_ptr< osg::Camera > myOverlayDebugFarCamera
 
osg::ref_ptr< DtOsgDebugFrustum > myCameraFrustum
 
osg::ref_ptr
< osg::MatrixTransform > 
myOrigin
 
unsigned int myShadowMapSize
 
unsigned int myPcfFilterCount
 
double myLastSimTime
 

Static Protected Attributes

static const int theMaxNumberOfCascades
 

Friends

class DtOsgShadowTechnique
 
struct DtCurrentPassData
 

Constructor & Destructor Documentation

makVrv::DtPerChannelData::DtPerChannelData ( makVrv::DtDe &  de,
makVrv::DtOsgChannel &  channel 
)

CTOR.

makVrv::DtPerChannelData::DtPerChannelData ( )
delete

not allowed

makVrv::DtPerChannelData::DtPerChannelData ( const DtPerChannelData &  rhs)
delete

not allowed

virtual makVrv::DtPerChannelData::~DtPerChannelData ( )
protectedvirtual

DTOR.

Member Function Documentation

DtPerChannelData& makVrv::DtPerChannelData::operator= ( const DtPerChannelData &  rhs)
delete

not allowed

void makVrv::DtPerChannelData::resizeCascades ( unsigned int  logicalSplitCount,
unsigned int  cameraCount 
)

Resizes myCascades to logicalSplitCount entries, initializing mySplitIndex on each entry, sets myCameraCount to cameraCount, and ensures there is always at least one cascade slot.

Parameters
logicalSplitCountThe desired logical split count. Values less than 1 are clamped to 1.
cameraCountThe number of actual shadow cameras to be created. Must be <= logicalSplitCount.
void makVrv::DtPerChannelData::updateCascadeImportance ( const DtShadowSettingsObject *  shadowSettings)

Updates per-cascade importance scores and refresh flags for the current frame.

Computes a priority score for each cascade based on its index (nearer cascades score higher) and how many frames have elapsed since its last refresh. Cascades marked as persistent are pinned to maximum importance and always refreshed. The remaining budget of additional passes is then allocated to the highest-scoring cascades, with lower-scoring cascades marked to skip rendering this frame.

Parameters
shadowSettingsThe current shadow settings object.
void makVrv::DtPerChannelData::updateCascadeOrthoBoxVisualizer ( int  splitIndex,
const osg::Matrix &  lightViewMatrix,
const osg::Vec3d &  segmentMin,
const osg::Vec3d &  segmentMax,
const osg::Vec3d &  frustumMin,
const osg::Vec3d &  frustumMax,
float  zPadding 
)

Transforms the cascade's light-space bounding box back to world space and updates the debug ortho box visualizer geometry for the given split.

Parameters
splitIndexThe index of the cascade split to update.
lightViewMatrixThe light view matrix for this cascade.
segmentMinThe minimum corner of the cascade's shadow segment in light space.
segmentMaxThe maximum corner of the cascade's shadow segment in light space.
frustumMinThe minimum corner of the camera frustum slice in light space.
frustumMaxThe maximum corner of the camera frustum slice in light space.
zPaddingThe Z padding value from DtShadowTweakables applied to the frustum extents.
void makVrv::DtPerChannelData::removeVisualizers ( )
protected
void makVrv::DtPerChannelData::initCascadeSplitVisualizers ( )
protected

Creates and attaches the wireframe frustum and ortho box visualizers for each cascade split to the visualizer group and geode. Called during debug visualizer initialization.

Friends And Related Function Documentation

friend class DtOsgShadowTechnique
friend
friend struct DtCurrentPassData
friend

Member Data Documentation

const int makVrv::DtPerChannelData::theMaxNumberOfCascades
staticprotected
makVrv::DtDe& makVrv::DtPerChannelData::myDe
protected
std::vector<DtCascadeData> makVrv::DtPerChannelData::myCascades
protected

The logical cascade splits used for shadow rendering. Each entry represents one depth sub-frustum of the view camera, covering a progressively farther range from the viewer. The number of entries is the "logical split count" � the total number of shadow splits configured by the user via shadow settings (numberOfSplits), plus any far cascade.

In standard mode, one osg::Camera is created per cascade (myCameraCount == myCascades.size()). In viewport multicast mode, multiple logical splits are rendered in a single camera pass using the GPU multicast extension, so myCameraCount < myCascades.size(). In that case, myCascades.size() still reflects the full logical split count, but only myCameraCount cameras are actually created and submitted for rendering.

unsigned int makVrv::DtPerChannelData::myCameraCount
protected

Number of actual shadow cameras created and used for rendering.

In standard mode this equals myCascades.size() (one camera per logical split). When viewport multicast is enabled, the GPU can render multiple cascade splits in a single camera pass, so myCameraCount will be less than myCascades.size(). Use myCascades.size() to iterate over logical splits; use myCameraCount to iterate over the physical cameras submitted to the render graph.

osg::ref_ptr<osg::MatrixTransform> makVrv::DtPerChannelData::myFrustumCenterTarget
protected
osg::ref_ptr<osgEarth::VirtualProgram> makVrv::DtPerChannelData::myVirtualProgram
protected
osg::ref_ptr<osg::StateSet> makVrv::DtPerChannelData::mySharedStateSet
protected
osg::ref_ptr<osg::Uniform> makVrv::DtPerChannelData::myShadowTexGenUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtPerChannelData::myReceiveShadowsUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtPerChannelData::myInverseShadowMapSizeUniform
protected
double makVrv::DtPerChannelData::myRefreshTimer
protected
bool makVrv::DtPerChannelData::myJustInitialized
protected
bool makVrv::DtPerChannelData::myNotInitialized
protected
makVrv::DtOsgChannel& makVrv::DtPerChannelData::myChannel
protected
osg::Vec3d makVrv::DtPerChannelData::myLastCameraPosition
protected
osg::Vec3d makVrv::DtPerChannelData::myLastLargeShadowMapCameraPosition
protected
double makVrv::DtPerChannelData::myCurrentSimTimeScale
protected
float makVrv::DtPerChannelData::myLastFarDistance
protected
osg::ref_ptr<osg::Uniform> makVrv::DtPerChannelData::mySplitDistancesWorldUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtPerChannelData::myUseReverseZBuffer
protected
osg::ref_ptr<osg::Uniform> makVrv::DtPerChannelData::myShadowAmbientFactorUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtPerChannelData::myInvNumSplitsInterpUniform
protected
osg::ref_ptr<osg::Group> makVrv::DtPerChannelData::myVisualizersGroup
protected
osg::ref_ptr<osg::Geode> makVrv::DtPerChannelData::myVisualizers
protected
osg::ref_ptr<osg::Camera> makVrv::DtPerChannelData::myOverlayDebugCamera
protected
osg::ref_ptr<osg::Camera> makVrv::DtPerChannelData::myOverlayDebugFarCamera
protected
osg::ref_ptr<DtOsgDebugFrustum> makVrv::DtPerChannelData::myCameraFrustum
protected
osg::ref_ptr<osg::MatrixTransform> makVrv::DtPerChannelData::myOrigin
protected
unsigned int makVrv::DtPerChannelData::myShadowMapSize
protected
unsigned int makVrv::DtPerChannelData::myPcfFilterCount
protected
double makVrv::DtPerChannelData::myLastSimTime
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)