VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtInstanceManager Class Reference

Manages data for instanced rendering system and kicks off DtInstanceProcessors to update instance state. More...

Inheritance diagram for makVrv::DtInstanceManager:
Inheritance graph
[legend]

Classes

class  AlwaysCull
 Callback to always cull out a drawable. More...
 
struct  DofAnimation
 Per instanced DOF animation data. More...
 
struct  Eyepoint
 Eyepoint for a view. More...
 
struct  Frustum
 Internal frustum record for culling. More...
 
struct  GeometryRenderList
 List of transforms for visible instances of a drawable. More...
 
struct  InstanceBuffer
 Per view buffer of instances. More...
 
struct  InstanceDataOffsets
 
struct  InstancedDof
 Per-instance DOF data. More...
 
struct  InstancedLight
 Per-instance light source data. More...
 
struct  InstancedLod
 Specifies an instanced LOD by min/max visible ranges and effected drawable range. More...
 
struct  InstancedSequence
 Specifies a per-instance flipbook sequence. More...
 
struct  InstancedSwitch
 Specifies a per-instance switch. More...
 
struct  InstanceTemplate
 Template data for an instance of a model. More...
 
struct  InstancingHit
 Instancing hit data structure. More...
 
struct  LightPoint
 Instance template light point data. More...
 
struct  LightSource
 
struct  ModelTypeDofData
 DOF data that is constant across all instances of a model type. More...
 
struct  ParserOutput
 results of the parsing visitor More...
 
struct  RenderState
 Transform matrix for an instanced drawable to render with. More...
 

Public Types

typedef std::vector
< osg::ref_ptr< osg::Geometry > > 
GeometryVec
 
typedef std::vector< charBoolVec
 
typedef std::vector< charByteVec
 
typedef std::map< osg::ref_ptr
< osgEarth::VirtualProgram >
, osg::ref_ptr
< osgEarth::VirtualProgram > > 
VpMap
 
typedef std::vector
< osg::ref_ptr
< osgEarth::VirtualProgram > > 
VpRefList
 
typedef std::vector< ArrayRangeDrawableRangeVec
 
typedef std::vector< osg::Vec2f > TextureCoordinateVec
 
typedef std::vector< float > FloatVec
 
typedef std::vector
< InstanceTemplate * > 
InstanceTemplateVec
 
typedef std::vector< LightSourceLightSourceVec
 
typedef std::vector
< ModelTypeDofData
PerDofDataVec
 
typedef std::vector
< InstancedSwitch
InstancedSwitchVec
 
typedef std::vector
< InstancedSequence
InstancedSequenceVec
 
typedef std::vector< DofAnimationDofAnimations
 
typedef std::vector< osg::Node * > NodeVec
 
typedef std::vector
< InstancedSwitch * > 
SwitchVec
 
typedef std::vector
< InstancedSequence * > 
SequenceVec
 
typedef std::vector
< InstancedLod * > 
LodVec
 
typedef std::vector< LightPointLightPointVec
 
typedef std::vector
< DtInstanceState
InstanceStateVec
 
typedef std::vector< DtModel * > ModelVec
 
typedef std::vector< InstancedLodInstancedLodVec
 
typedef std::vector< InstancedDofInstancedDofVec
 
typedef std::vector
< InstanceCullData
InstanceCullDataVec
 
typedef std::vector
< InstanceMatrix,
tbb::cache_aligned_allocator
< InstanceMatrix > > 
InstanceMatrixVec
 
typedef std::vector< float > InstanceScaleVec
 
typedef std::vector< DtElementIDInstanceElementIdVec
 
typedef std::vector
< InstancedLight
InstancedLightVec
 

Public Member Functions

bool intersect (const osg::Vec3d &start, const osg::Vec3d &end, const osg::Vec3d &reference, DtOsgIntersectorResult &result, std::list< DtUniqueID > *ignoreList=0)
 Find the closest instance intersection to the reference point along the line segment from start to end. More...
 
bool intersect (const osg::Vec3d &start, const osg::Vec3d &end, std::vector< DtOsgIntersectorResult > &results, std::list< DtUniqueID > *ignoreList=0)
 Find the instance intersections to the start point along a line segment. More...
 
void setElementId (DtUniqueID id, DtUniqueID elementId)
 Set the element ID for an instanced model. More...
 
osg::StateSet * getModelTypeRootStateSet (const std::string &modelType)
 Get the root state set for a particular type of model. More...
 
 DtInstanceManager (DtDe &de)
 CTOR. More...
 
virtual ~DtInstanceManager ()
 DTOR. More...
 
virtual void reset ()
 Clear everything in the instance manager. More...
 
virtual osg::Node * instanceRoot ()
 Get the root node containing all instanced geometry. More...
 
bool isRegistered (const std::string &modelType)
 Check whether a model is registered and ready for instancing. More...
 
void registerModel (const std::string &modelType, const ParserOutput &parseOutput, float boundingRadius, const DtVector &boundingCenter, unsigned int nodeMask, const osg::ref_ptr< osg::StateSet > &rootNodeSS, bool daylightControlledLights=false)
 Register a model for instancing. More...
 
osg::Geode * setupModelGeode (const std::string &modelType, unsigned int nodeMask)
 Set up a geode to contain instances of a model. More...
 
void allocateImage (const osg::View *view)
 Allocate an instance texture for the specified view. More...
 
void freeInstance (DtUniqueID id)
 Free the instance with the specified ID. More...
 
void drainFreeInstanceList ()
 Free the instance with the specified ID in main thread. More...
 
void setArtPartSmoothingEnabled (bool onOrOff)
 
bool artPartSmoothingEnabled () const
 
void setArtPartSmoothingPeriod (float period)
 
float artPartSmoothingPeriod () const
 
bool newInstance (const std::string &modelType, DtUniqueID id, DtElementID elementId, short modelSet, DtModel *model, const std::string &lightPointGroup, bool isSimpleModel)
 Set up a new instance of the specified model. More...
 
DtInstanceStatefindInstanceState (DtUniqueID id)
 Find the specified instance's state. More...
 
InstanceCullDatafindInstanceCullData (DtUniqueID id)
 Find the culling data for the specified instance. More...
 
void setPosition (DtUniqueID uniqueID, const DtVector &vPosition)
 Set Position and orientation off of Dt types. More...
 
void setPositionOffset (DtUniqueID uniqueID, const DtVector &vPosition)
 
void setOrientation (DtUniqueID uniqueID, const DtTaitBryan &orientation)
 
void setOrientationOffset (DtUniqueID uniqueID, const DtTaitBryan &orientation)
 
void setPosition (DtUniqueID uniqueID, const osg::Vec3d &vPosition)
 Set Position and orientation off of osg types. More...
 
void setPositionOffset (DtUniqueID uniqueID, const osg::Vec3d &vPosition)
 
void setOrientation (DtUniqueID uniqueID, const osg::Quat &orientation)
 
void setOrientationOffset (DtUniqueID uniqueID, const osg::Quat &orientation)
 
void setVisible (DtUniqueID uniqueID, bool bVisible)
 Set visibility. More...
 
void setBlendColor (DtUniqueID uniqueID, float r, float g, float b, float a)
 Set the blending color. More...
 
void setModelScaling (DtUniqueID uniqueID, bool bModelScaling, float scale)
 Set the model scaling /param uniqueID the ID of the model /param bModelScaling if global modelScaling is enabled /param scale the individual scale from the model definition, separate from the global scale. More...
 
void setCullParameters (DtUniqueID uniqueID, unsigned int nodeMask, bool visible)
 Set the various culling parameters. More...
 
InstanceElementIdVecelementIds ()
 Element IDs of instances. More...
 
InstanceScaleVecinstanceScales ()
 Scale of instances. More...
 
ByteVecinstanceVisibleSet ()
 Visibility of instances in current view. More...
 
InstanceMatrixVecdrawableInstanceMatrix ()
 Spatial state of instanced drawables in current view. More...
 
InstanceCullDataVecinstanceCullData ()
 Per instance cull data. More...
 
InstanceStateVecinstances ()
 State of active instances. More...
 
TextureCoordinateVecuvOffsets ()
 UV Offset state of drawable instances. More...
 
InstanceTemplateVecinstanceTemplates ()
 Per model definition templates for creating instances. More...
 
std::vector< float > & distanceToEye ()
 Per-instance distances to eyepoint for the current camera. More...
 
DofAnimationsdofAnimations ()
 Array of DOF animation data. More...
 
doublelastUpdateTime ()
 Last time the instances were updated. More...
 
const DtOsgCullVisitorParameterslastCullParameters ()
 Last cull parameters from the renderer. More...
 
BoolVecvisibleSet ()
 Per instanced drawable visibility. More...
 
osg::Vec3d & cameraPosition ()
 Camera position of the most recent camera that called update. More...
 
const osg::View * lastView ()
 View that most recently called update. More...
 
const osg::Camera * lastCamera ()
 Camera that was most recently used to udate. More...
 
unsigned int drawableIndex (unsigned int instanceIx)
 Get the start index of the drawable spatial data for the specified instance. More...
 
unsigned int matrixIndex (unsigned int instanceIx)
 Get the start index of the drawable spatial data for the specified instance. More...
 
unsigned int drawableOffsetMatrixIndex (const DtInstanceState &instanceState, unsigned int instanceIx, unsigned int drawableOffset)
 Get the start index of the drawable spatial data for the specified instance. More...
 
void reloadShaders ()
 Reload instancing shaders. More...
 
GeometryVecdrawables ()
 
unsigned int visibleCount () const
 
unsigned int dynamicBufferDataSize () const
 
virtual void traverse (osg::NodeVisitor &nv)
 needed to run material callbacks More...
 
virtual void update (osg::NodeVisitor &nv)
 needed to run animation callbacks More...
 
virtual void updateForIntersection (double simTime, const osg::View *view, osg::Camera *camera, unsigned int nodeMask, DtOsgCullVisitorParameters *params)
 update function for preparing the instance manger for an intersection used by the DtInstanceManager::instersect call to update the locations of the geometry if necessary (if it has not already been done for this frame by updateForDrawing) this does not update the light point drawables using the cull visitor like the updateForDrawing does. More...
 
virtual void updateForDrawing (osgUtil::CullVisitor *cv, const DtOsgCullVisitorParameters *params)
 update function for preparing the instance manager for being drawn called once per view. More...
 
virtual float lightpointRange (unsigned int instanceIx)
 
virtual void setDefaultLightPointMaxDistance (float distance)
 Set the max distance for lightpoints. More...
 
virtual float defaultLightPointMaxDistance () const
 Get the max distance for lightpoints. More...
 
virtual void setLightPointFadeBias (float bias)
 Lightpoint range is used to fade from max brightness (alpha = 1) to 0 at max range. More...
 
virtual bool cullDistanceEnabled ()
 Overridw the cull distance used in the instance manager. More...
 
virtual float cullDistance ()
 Get the distance used if culling override is enabled Set with the slider in the experimental features dialog. More...
 
virtual std::string modelDefinitionNameProxy (const std::string &modelDefName)
 Returns proxy model definition name generated from the model definition. More...
 
DtVirtualBaseClassfindCachedData (const std::string &modelType, const std::string &name)
 Lookup cached data. More...
 
void setCachedData (const std::string &modelType, const std::string &name, DtVirtualBaseClass *data)
 Adds a data member to the cache. More...
 
void clearCachedData ()
 Clear previously allocated memory (to be called from the destructor) More...
 
void releaseGLObjects (osg::State *state)
 
void updateBuffers (const osg::View *view)
 should only be called by the tbo updater in order to update the tbos More...
 
void updateLightPoints (const osg::Camera *camera, const osg::FrameStamp *frameStamp, osgUtil::CullVisitor *cv, const osg::Camera *sceneCamera=NULL)
 loop over the light point nodes and send down the model view matrix for each instance. More...
 
void addImguiStats () const
 added stats More...
 
void resetTboSendFlag ()
 called by precull event More...
 
void setSequenceMode (const DtInstanceState &instance, unsigned int sequenceIndex, InstancedSequence::SequenceMode mode)
 
void setSequenceSpeed (const DtInstanceState &instance, unsigned int sequenceIndex, float speed)
 Set the playback speed for the specified sequence. More...
 
void setSequencePlayTime (const DtInstanceState &instance, unsigned int sequenceIndex, float loopTime)
 Set the time the specified sequence should play for, starting now. More...
 
InstanceMatrix dofState (const DtInstanceState &instanceState, unsigned int partIndex)
 
void setDofState (InstanceMatrix &m, const DtInstanceState &state, unsigned int partIndex)
 
void setDofAnimation (osg::Vec3f &hpr, const osg::Vec3f &hprVel, const DtInstanceState &state, unsigned int partIndex)
 Set the DOF animation state for the specified instanced DOF. More...
 
void setDofRotationalVelocity (const osg::Vec3f &hprVel, const DtInstanceState &state, unsigned int partIndex, bool forceUpdate=true)
 Set the DOF rotational velocity state for the specified instanced DOF. More...
 
void setDofTranslation (osg::Vec3f &trans, osg::Vec3f &transVel, const DtInstanceState &state, unsigned int partIndex)
 Set the DOF translation state for the specified instanced DOF. More...
 
void setSwitchState (const DtInstanceState &instance, unsigned int partIndex, unsigned int childIndex, bool state)
 
void setUVOffset (DtUniqueID id, unsigned int drawableIx, unsigned int count, const osg::Vec2f &uvOffset)
 
void setUserDefined (DtUniqueID id, float userDefined)
 
void setLightpointRange (DtUniqueID id, float range)
 
Instanced scene graph accessors
InstancedLodVecinstancedLods ()
 
InstancedSwitchVecinstancedSwitches ()
 
InstancedSequenceVecinstancedSequences ()
 
InstancedDofVecinstancedDofs ()
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 
- Public Member Functions inherited from makVrv::DtSignalConnectionManager
 DtSignalConnectionManager ()
 CTOR. More...
 
virtual ~DtSignalConnectionManager ()
 DTOR. More...
 
void manageConnection (const boost::signalslib::connection &conn)
 Connect a signal. More...
 
void manageConnection (const boost::signalslib2::connection &conn)
 
DtSignalConnectionManageroperator+= (const boost::signalslib::connection &conn)
 Connect a signal. More...
 
DtSignalConnectionManageroperator+= (const boost::signalslib2::connection &conn)
 
bool blockConnections (bool blocked)
 Blocks/unblocks connections. More...
 
int numberOfConnections () const
 Get the number of connections. More...
 
void disconnectSignals ()
 Disconnect all signals. More...
 
bool connectionsBlocked () const
 check whether connections are blocked. More...
 

Static Public Member Functions

static DtInstanceManagerinstance (DtDe &de)
 Get an instance of the instance manager. More...
 

Public Attributes

Signals
boost::signal< void(const
std::string &)> 
signal_modelTypeRegistered
 Emitted when a new model type is registered with the instancing system. More...
 
boost::signal< void(const
std::string &, DtUniqueID,
DtElementID, DtModel *)> 
signal_instanceCreated
 Emitted when a new instance of a model is added to the scene. More...
 
boost::signal< void(const
CullSet &)> 
signal_updateFinished
 Emitted when instance update is complete. More...
 

Static Public Attributes

static const unsigned int NumVec4PerInstance = 8
 Number of vec4 slots per instance in the instance data buffer. More...
 

Protected Types

typedef std::vector< RenderStateRenderStateVec
 List of transform matrices that will be used to render instances of a particular drawable. More...
 
typedef std::vector
< GeometryRenderList
RenderList
 Per drawable list of visible instance transforms. More...
 
typedef boost::unordered_map
< std::string,
DtVirtualBaseClass * > 
CacheMap
 Cached data for model definition specific data. More...
 
typedef boost::unordered_map
< DtUniqueID, unsigned int
InstanceStateMap
 Map from instance unique ID to the index into myInstances for that instance. More...
 
typedef std::vector
< InstanceBuffer
InstanceBufferVec
 Vector of per-view instance data buffers. More...
 
typedef boost::unordered_map
< std::string, int
modelTypeToTemplateMap
 Map from model type names to template index. More...
 
typedef std::vector
< DtInstanceProcessor * > 
InstanceProcessorVec
 Vector of instance processors. More...
 
typedef std::vector< osg::View * > ViewVec
 List of active views. More...
 
typedef boost::unordered_map
< const osg::View
*, osg::ref_ptr
< DtViewSpecificGroup > > 
ViewToGroup
 Map from views to the group node that activates their instance buffer. More...
 
typedef boost::unordered_map
< osg::Geometry
*, osg::ref_ptr
< DtPerViewUniformCallback > > 
GeometryToCallback
 Map from geometry (drawable) to the callback that updates its start index uniform. More...
 
- Protected Types inherited from makVrv::DtSignalConnectionManager
typedef std::vector
< boost::signalslib::connection > 
Connections
 A collection of signals. More...
 
typedef std::vector
< boost::signalslib2::connection > 
Connections2
 

Protected Member Functions

void update (double simTime, const osg::View *view, osg::Camera *camera, unsigned int nodeMask, osgUtil::CullVisitor *cv, const DtOsgCullVisitorParameters *params, bool suppressLastUpdateTime)
 Update the instances. More...
 
void registerGeometry (unsigned int templateIx, osg::Geometry *geometry, VpMap &vpMap)
 Set up a geometry object for instanced rendering. More...
 
float computeDistanceToEye (const Eyepoint &eye, const osg::Vec3d &pos) const
 Compute the distance from an eyepoint to a point. More...
 
void updateOffsetsAndDistancesToEye (const Eyepoint &eye)
 Apply any offsets to the instance and then update its distance from the eye point. More...
 
void _updateOffsetsAndDistancesToEye (const Eyepoint &eye, unsigned int instanceOffset, unsigned int numInstances)
 Apply any offsets to the instance and then update its distance from the eye point. More...
 
void allocateRenderList ()
 Resize myRenderList to fit the current set of instances and drawables. More...
 
void updateDataAndDrawables (unsigned int offset, unsigned int count)
 Update the instance texture for the specified view. More...
 
unsigned int updateRenderList (const Eyepoint &eye, const osg::Matrixd &viewMat, unsigned int nodeMask)
 Update the per-drawable render lists using the computed visibility and instance spatial data. More...
 
void updateLights (const osg::View *view)
 
void resizeBuffersIfNecessary (const osg::View *view, int visibleCount)
 
void resizeTBOIfNecessary (const osg::View *view, int visibleCount)
 
void allocateInstanceData ()
 Allocate space for instance data that isn't contained in the instance struct itself, for the current number of instances. More...
 
unsigned int fillRenderList (unsigned int instanceOffset, unsigned int numInstances)
 Fill the render list with data from the specified range of instances. More...
 
void cullRange (const Eyepoint &eye, const std::vector< osg::Vec4d > &planes, bool useScale, unsigned int nodeMask, unsigned int instanceOffset, unsigned int instanceCount)
 Frustum cull the specified range of instances. More...
 
void slot_channelAdded (DtChannelManager *mgr, DtChannel *channel)
 Update per-view resources when a channel is added. More...
 
void slot_channelRemoved (DtChannelManager *mgr, DtChannel *channel)
 Clean up per-view resources when a channel is removed. More...
 
void clearTBO (InstanceBuffer &instanceBuffer)
 Clean up a single texture buffer object Uses a reference to a pointer since it can set instTbo = NULL. More...
 
void createHitList (const osg::Vec3d &end, const osg::Vec3d &start, std::vector< InstancingHit > &hitList)
 Support function for intersect for generating list of hits. More...
 
void loadInstanceShaders (osgEarth::VirtualProgram *vp)
 reads the instance shaders from disk and attaches them to vp More...
 
bool isOnExcludeList (DtUniqueID elementId, const std::list< DtUniqueID > &ignoreList)
 
void addInstanceRootToSceneGraphIfNecessary (void)
 
void processNewInstanceLights (const InstanceTemplate &instanceTemplate)
 
void processNewInstanceDOFs (DtModel *model, const InstanceTemplate &instanceTemplate)
 
void processNewInstanceSwitches (const InstanceTemplate &instanceTemplate, bool isSimpleModel)
 
void processNewInstanceSequences (const InstanceTemplate &instanceTemplate)
 
void processNewInstanceLightPoints (const InstanceTemplate &instanceTemplate, const std::string &lightPointGroup)
 initialize a new instance with it's group that it belongs to More...
 
void preCull ()
 
void frustumCull (const osg::View *view, const Eyepoint &eye, unsigned int nodeMask)
 
void postCull ()
 
void _fillRenderList (bool globalScaling, unsigned int instanceOffset, unsigned int numInstances)
 
- Protected Member Functions inherited from makVrv::DtSignalConnectionManager
bool blockConnection (int index, bool blocked)
 Blocks/unblocks connections. More...
 
bool connectionBlocked (int index) const
 check whether connections are blocked. More...
 

Protected Attributes

InstanceTemplateVec myInstanceTemplates
 Per model definition templates for creating instances. More...
 
bool myRenderListDirty
 True when myRenderList needs to be resized. More...
 
RenderList myRenderList
 
GeometryVec myDrawables
 Drawables in registered instance templates. More...
 
std::vector< unsigned intmyActiveDrawablesScratch
 
BoolVec myVisibleSet
 Per instanced drawable visibility state. More...
 
InstanceMatrixVec myDrawableInstanceMatrix
 Spatial data for drawables in myDrawables. More...
 
TextureCoordinateVec myUVOffsets
 Per instance UV offsets. More...
 
ByteVec myInstanceVisibleSet
 Array of Per instance visibility state. More...
 
std::vector< float > myDistanceToEye
 Per-instance distances to eyepoint for the current camera. More...
 
InstanceScaleVec myInstanceScales
 Array of per-instance model scale factors. More...
 
FloatVec myInstanceUserDefined
 Array of per-instance user-defined floats. More...
 
FloatVec myInstanceLightpointRange
 Array of per-instance max lightpoint distances squared. More...
 
InstanceCullDataVec myInstanceCullData
 Array of per-instance culling data. More...
 
InstanceElementIdVec myElementIds
 Array of per-instance element IDs. More...
 
DofAnimations myDofAnimations
 Array of DOF animation data. More...
 
double myLastUpdateTime
 Last time the instances were updated. More...
 
unsigned int myLastNodeMask
 Nodemask used for last update. More...
 
osg::Vec3d myCameraPosition
 Camera position of the most recent camera that called update. More...
 
const osg::View * myLastView
 Reference to view that most recently called update. More...
 
const osg::Camera * myLastCamera
 Reference to the camera that most recently was used. More...
 
CullSet myPerViewCullResults
 Storage for per-view cull set calculation. More...
 
CacheMap myRuntimeCache
 
tbb::concurrent_queue
< unsigned int
myListToRemove
 
InstanceStateMap myIdToInstances
 Map model DtUniqueID to instance index into myInstances array. More...
 
tbb::spin_rw_mutex myMapMutex
 
osg::Vec4 * myDynamicBufferData
 
unsigned int myDynamicBufferDataSz
 
unsigned int myCurrentDynamicBufferDataSize
 
InstanceBufferVec myInstanceBuffers
 
modelTypeToTemplateMap myModelTypeToTemplate
 Map model definition to its template index. More...
 
DtDemyDe
 
unsigned int myRequiredUvOffsets
 Number of UV offsets required by current allocated instances. More...
 
osg::ref_ptr< AlwaysCullmyAlwaysCullCallback
 
osg::ref_ptr< DtInstanceNodemyInstanceRoot
 
InstanceProcessorVec myPostCullInstanceProcessors
 Processors run after frustum culling. More...
 
InstanceProcessorVec myPreCullInstanceProcessors
 Processors run before frustum culling. More...
 
ViewVec myKnownViews
 
ViewToGroup myViewToGroup
 
GeometryToCallback myGeometryToCallback
 
osg::ref_ptr< const
DtOsgCullVisitorParameters
myLastCullParameters
 Most recent active cull vistor parameters. More...
 
float myDefaultLightPointRange
 
float myLightPointFadeBias
 
std::vector< osg::Vec4d > vecScratchPadPlanes
 
tbb::atomic< intmyVisibleCount
 
osg::ref_ptr
< DtInstanceManagerTboUpdater
myDrawCallUpdater
 
int myNeedsMainThreadTextureUpdate
 
std::string myInstanceVS
 
std::string myInstanceViewVS
 
std::string myInstanceFS
 
std::map< const
InstanceTemplate *, int
myNewTemplates
 
unsigned int myCurrentTBBChunkSize
 
bool myArtPartSmoothingEnabled
 
float myArtPartSmoothingPeriod
 
bool myTboSendFlag
 
Instanced scene graph

Array of active instances

InstanceStateVec myInstances
 
ModelVec myModelInstances
 
NodeVec myAnimatedModels
 list of nodes that have animated bits. More...
 
std::vector< InstanceDataOffsetsmyInstanceDataOffsets
 
InstancedLodVec myInstancedLods
 
InstancedSwitchVec myInstancedSwitches
 
InstancedSequenceVec myInstancedSequences
 
InstancedDofVec myInstancedDofs
 
InstancedLightVec myInstancedLights
 
LightPointVec myInstancedLightPoints
 
Instance processor thread data

Number of threads to use for processing instances during update

unsigned int myNumThreads
 
Per-template buffer size tracking
std::vector< intmyTemplateMaxInstances
 Map maximum number of instances for each template that we've allocated space for. More...
 
std::vector< intmyTemplateActiveInstances
 Map number of active instances per template. More...
 
local VirtualProgram cache
VpMap myVpMap
 
VpRefList myVpRefs
 
- Protected Attributes inherited from makVrv::DtSignalConnectionManager
Connections myConnections
 The connected signals. More...
 
Connections2 myConnections2
 
bool myConnectionsBlocked
 
bool myIndiviualConnectionedBlocked
 
std::vector
< boost::signalslib2::shared_connection_block * > 
mySharedConnectionsBlockManager
 blocking Connections manager for signal2 connection More...
 

Detailed Description

Manages data for instanced rendering system and kicks off DtInstanceProcessors to update instance state.

Use instance processor objects to modify instance spatial data/visibility

Member Typedef Documentation

typedef std::vector<osg::ref_ptr<osg::Geometry> > makVrv::DtInstanceManager::GeometryVec
typedef std::map<osg::ref_ptr< osgEarth::VirtualProgram >, osg::ref_ptr<osgEarth::VirtualProgram> > makVrv::DtInstanceManager::VpMap
typedef std::vector<osg::ref_ptr<osgEarth::VirtualProgram> > makVrv::DtInstanceManager::VpRefList
typedef std::vector<osg::Vec2f> makVrv::DtInstanceManager::TextureCoordinateVec
typedef std::vector<float> makVrv::DtInstanceManager::FloatVec
typedef std::vector<osg::Node*> makVrv::DtInstanceManager::NodeVec
typedef std::vector<InstanceMatrix, tbb::cache_aligned_allocator<InstanceMatrix> > makVrv::DtInstanceManager::InstanceMatrixVec
typedef std::vector<float> makVrv::DtInstanceManager::InstanceScaleVec

List of transform matrices that will be used to render instances of a particular drawable.

Per drawable list of visible instance transforms.

typedef boost::unordered_map<std::string, DtVirtualBaseClass*> makVrv::DtInstanceManager::CacheMap
protected

Cached data for model definition specific data.

typedef boost::unordered_map<DtUniqueID, unsigned int> makVrv::DtInstanceManager::InstanceStateMap
protected

Map from instance unique ID to the index into myInstances for that instance.

Vector of per-view instance data buffers.

typedef boost::unordered_map<std::string, int> makVrv::DtInstanceManager::modelTypeToTemplateMap
protected

Map from model type names to template index.

Vector of instance processors.

Processors are run in order once per frame to update instance visibility/spatial data

typedef std::vector<osg::View*> makVrv::DtInstanceManager::ViewVec
protected

List of active views.

Used to decide what buffers we need allocated/updated

typedef boost::unordered_map<const osg::View*, osg::ref_ptr<DtViewSpecificGroup> > makVrv::DtInstanceManager::ViewToGroup
protected

Map from views to the group node that activates their instance buffer.

typedef boost::unordered_map<osg::Geometry*, osg::ref_ptr<DtPerViewUniformCallback> > makVrv::DtInstanceManager::GeometryToCallback
protected

Map from geometry (drawable) to the callback that updates its start index uniform.

Constructor & Destructor Documentation

makVrv::DtInstanceManager::DtInstanceManager ( DtDe de)

CTOR.

virtual makVrv::DtInstanceManager::~DtInstanceManager ( )
virtual

DTOR.

Member Function Documentation

bool makVrv::DtInstanceManager::intersect ( const osg::Vec3d &  start,
const osg::Vec3d &  end,
const osg::Vec3d &  reference,
DtOsgIntersectorResult result,
std::list< DtUniqueID > *  ignoreList = 0 
)

Find the closest instance intersection to the reference point along the line segment from start to end.

bool makVrv::DtInstanceManager::intersect ( const osg::Vec3d &  start,
const osg::Vec3d &  end,
std::vector< DtOsgIntersectorResult > &  results,
std::list< DtUniqueID > *  ignoreList = 0 
)

Find the instance intersections to the start point along a line segment.

void makVrv::DtInstanceManager::setSequenceMode ( const DtInstanceState instance,
unsigned int  sequenceIndex,
InstancedSequence::SequenceMode  mode 
)

Set the playback mode for the specified sequence

void makVrv::DtInstanceManager::setSequenceSpeed ( const DtInstanceState instance,
unsigned int  sequenceIndex,
float  speed 
)

Set the playback speed for the specified sequence.

void makVrv::DtInstanceManager::setSequencePlayTime ( const DtInstanceState instance,
unsigned int  sequenceIndex,
float  loopTime 
)

Set the time the specified sequence should play for, starting now.

InstanceMatrix makVrv::DtInstanceManager::dofState ( const DtInstanceState instanceState,
unsigned int  partIndex 
)

Get the current transform matrix of an instanced articulated part

void makVrv::DtInstanceManager::setDofState ( InstanceMatrix m,
const DtInstanceState state,
unsigned int  partIndex 
)

Set the transform for the specified instanced DOF

void makVrv::DtInstanceManager::setDofAnimation ( osg::Vec3f &  hpr,
const osg::Vec3f &  hprVel,
const DtInstanceState state,
unsigned int  partIndex 
)

Set the DOF animation state for the specified instanced DOF.

void makVrv::DtInstanceManager::setDofRotationalVelocity ( const osg::Vec3f &  hprVel,
const DtInstanceState state,
unsigned int  partIndex,
bool  forceUpdate = true 
)

Set the DOF rotational velocity state for the specified instanced DOF.

void makVrv::DtInstanceManager::setDofTranslation ( osg::Vec3f &  trans,
osg::Vec3f &  transVel,
const DtInstanceState state,
unsigned int  partIndex 
)

Set the DOF translation state for the specified instanced DOF.

void makVrv::DtInstanceManager::setSwitchState ( const DtInstanceState instance,
unsigned int  partIndex,
unsigned int  childIndex,
bool  state 
)

Set the state of an instanced switch

void makVrv::DtInstanceManager::setUVOffset ( DtUniqueID  id,
unsigned int  drawableIx,
unsigned int  count,
const osg::Vec2f &  uvOffset 
)

Set the UV coordinate offset for a drawable

void makVrv::DtInstanceManager::setUserDefined ( DtUniqueID  id,
float  userDefined 
)

Set the user defined float for a drawable

void makVrv::DtInstanceManager::setLightpointRange ( DtUniqueID  id,
float  range 
)

Set the lightpoint range float for all lightpoints in an instance

void makVrv::DtInstanceManager::setElementId ( DtUniqueID  id,
DtUniqueID  elementId 
)

Set the element ID for an instanced model.

osg::StateSet* makVrv::DtInstanceManager::getModelTypeRootStateSet ( const std::string &  modelType)

Get the root state set for a particular type of model.

static DtInstanceManager& makVrv::DtInstanceManager::instance ( DtDe de)
static

Get an instance of the instance manager.

virtual void makVrv::DtInstanceManager::reset ( )
virtual

Clear everything in the instance manager.

Deletes all current instances and instance templates

virtual osg::Node* makVrv::DtInstanceManager::instanceRoot ( )
virtual

Get the root node containing all instanced geometry.

bool makVrv::DtInstanceManager::isRegistered ( const std::string &  modelType)

Check whether a model is registered and ready for instancing.

void makVrv::DtInstanceManager::registerModel ( const std::string &  modelType,
const ParserOutput parseOutput,
float  boundingRadius,
const DtVector boundingCenter,
unsigned int  nodeMask,
const osg::ref_ptr< osg::StateSet > &  rootNodeSS,
bool  daylightControlledLights = false 
)

Register a model for instancing.

osg::Geode* makVrv::DtInstanceManager::setupModelGeode ( const std::string &  modelType,
unsigned int  nodeMask 
)

Set up a geode to contain instances of a model.

void makVrv::DtInstanceManager::allocateImage ( const osg::View *  view)

Allocate an instance texture for the specified view.

void makVrv::DtInstanceManager::freeInstance ( DtUniqueID  id)

Free the instance with the specified ID.

void makVrv::DtInstanceManager::drainFreeInstanceList ( )

Free the instance with the specified ID in main thread.

void makVrv::DtInstanceManager::setArtPartSmoothingEnabled ( bool  onOrOff)
bool makVrv::DtInstanceManager::artPartSmoothingEnabled ( ) const
void makVrv::DtInstanceManager::setArtPartSmoothingPeriod ( float  period)
float makVrv::DtInstanceManager::artPartSmoothingPeriod ( ) const
bool makVrv::DtInstanceManager::newInstance ( const std::string &  modelType,
DtUniqueID  id,
DtElementID  elementId,
short  modelSet,
DtModel model,
const std::string &  lightPointGroup,
bool  isSimpleModel 
)

Set up a new instance of the specified model.

modelType should match a model that was registered previously with registerModel and id should be the id of the distributed object controlling the instance

DtInstanceState* makVrv::DtInstanceManager::findInstanceState ( DtUniqueID  id)

Find the specified instance's state.

Instance states may be rearranged in memory during allocation/deallocation, so this pointer is only valid for immediate use

InstanceCullData* makVrv::DtInstanceManager::findInstanceCullData ( DtUniqueID  id)

Find the culling data for the specified instance.

Cull data may be rearranged in memory during allocation/deallocation, so this pointer is only valid for immediate use

void makVrv::DtInstanceManager::setPosition ( DtUniqueID  uniqueID,
const DtVector vPosition 
)

Set Position and orientation off of Dt types.

void makVrv::DtInstanceManager::setPositionOffset ( DtUniqueID  uniqueID,
const DtVector vPosition 
)
void makVrv::DtInstanceManager::setOrientation ( DtUniqueID  uniqueID,
const DtTaitBryan &  orientation 
)
void makVrv::DtInstanceManager::setOrientationOffset ( DtUniqueID  uniqueID,
const DtTaitBryan &  orientation 
)
void makVrv::DtInstanceManager::setPosition ( DtUniqueID  uniqueID,
const osg::Vec3d &  vPosition 
)

Set Position and orientation off of osg types.

void makVrv::DtInstanceManager::setPositionOffset ( DtUniqueID  uniqueID,
const osg::Vec3d &  vPosition 
)
void makVrv::DtInstanceManager::setOrientation ( DtUniqueID  uniqueID,
const osg::Quat &  orientation 
)
void makVrv::DtInstanceManager::setOrientationOffset ( DtUniqueID  uniqueID,
const osg::Quat &  orientation 
)
void makVrv::DtInstanceManager::setVisible ( DtUniqueID  uniqueID,
bool  bVisible 
)

Set visibility.

void makVrv::DtInstanceManager::setBlendColor ( DtUniqueID  uniqueID,
float  r,
float  g,
float  b,
float  a 
)

Set the blending color.

void makVrv::DtInstanceManager::setModelScaling ( DtUniqueID  uniqueID,
bool  bModelScaling,
float  scale 
)

Set the model scaling /param uniqueID the ID of the model /param bModelScaling if global modelScaling is enabled /param scale the individual scale from the model definition, separate from the global scale.

void makVrv::DtInstanceManager::setCullParameters ( DtUniqueID  uniqueID,
unsigned int  nodeMask,
bool  visible 
)

Set the various culling parameters.

InstanceElementIdVec& makVrv::DtInstanceManager::elementIds ( )
inline

Element IDs of instances.

InstanceScaleVec& makVrv::DtInstanceManager::instanceScales ( )
inline

Scale of instances.

ByteVec& makVrv::DtInstanceManager::instanceVisibleSet ( )
inline

Visibility of instances in current view.

InstanceMatrixVec& makVrv::DtInstanceManager::drawableInstanceMatrix ( )
inline

Spatial state of instanced drawables in current view.

InstanceCullDataVec& makVrv::DtInstanceManager::instanceCullData ( )
inline

Per instance cull data.

InstanceStateVec& makVrv::DtInstanceManager::instances ( )
inline

State of active instances.

TextureCoordinateVec& makVrv::DtInstanceManager::uvOffsets ( )
inline

UV Offset state of drawable instances.

InstancedLodVec& makVrv::DtInstanceManager::instancedLods ( )
inline
InstancedSwitchVec& makVrv::DtInstanceManager::instancedSwitches ( )
inline
InstancedSequenceVec& makVrv::DtInstanceManager::instancedSequences ( )
inline
InstancedDofVec& makVrv::DtInstanceManager::instancedDofs ( )
inline
InstanceTemplateVec& makVrv::DtInstanceManager::instanceTemplates ( )
inline

Per model definition templates for creating instances.

std::vector<float>& makVrv::DtInstanceManager::distanceToEye ( )
inline

Per-instance distances to eyepoint for the current camera.

DofAnimations& makVrv::DtInstanceManager::dofAnimations ( )
inline

Array of DOF animation data.

double& makVrv::DtInstanceManager::lastUpdateTime ( )
inline

Last time the instances were updated.

const DtOsgCullVisitorParameters* makVrv::DtInstanceManager::lastCullParameters ( )
inline

Last cull parameters from the renderer.

BoolVec& makVrv::DtInstanceManager::visibleSet ( )
inline

Per instanced drawable visibility.

osg::Vec3d& makVrv::DtInstanceManager::cameraPosition ( )
inline

Camera position of the most recent camera that called update.

const osg::View* makVrv::DtInstanceManager::lastView ( )
inline

View that most recently called update.

const osg::Camera* makVrv::DtInstanceManager::lastCamera ( )
inline

Camera that was most recently used to udate.

unsigned int makVrv::DtInstanceManager::drawableIndex ( unsigned int  instanceIx)
inline

Get the start index of the drawable spatial data for the specified instance.

unsigned int makVrv::DtInstanceManager::matrixIndex ( unsigned int  instanceIx)
inline

Get the start index of the drawable spatial data for the specified instance.

unsigned int makVrv::DtInstanceManager::drawableOffsetMatrixIndex ( const DtInstanceState instanceState,
unsigned int  instanceIx,
unsigned int  drawableOffset 
)
inline

Get the start index of the drawable spatial data for the specified instance.

References makVrv::ArrayRange::count, and makVrv::DtInstanceState::dofRange.

void makVrv::DtInstanceManager::reloadShaders ( )

Reload instancing shaders.

GeometryVec& makVrv::DtInstanceManager::drawables ( )
inline
unsigned int makVrv::DtInstanceManager::visibleCount ( ) const
inline
unsigned int makVrv::DtInstanceManager::dynamicBufferDataSize ( ) const
inline
virtual void makVrv::DtInstanceManager::traverse ( osg::NodeVisitor &  nv)
virtual

needed to run material callbacks

virtual void makVrv::DtInstanceManager::update ( osg::NodeVisitor &  nv)
virtual

needed to run animation callbacks

virtual void makVrv::DtInstanceManager::updateForIntersection ( double  simTime,
const osg::View *  view,
osg::Camera *  camera,
unsigned int  nodeMask,
DtOsgCullVisitorParameters params 
)
virtual

update function for preparing the instance manger for an intersection used by the DtInstanceManager::instersect call to update the locations of the geometry if necessary (if it has not already been done for this frame by updateForDrawing) this does not update the light point drawables using the cull visitor like the updateForDrawing does.

virtual void makVrv::DtInstanceManager::updateForDrawing ( osgUtil::CullVisitor *  cv,
const DtOsgCullVisitorParameters params 
)
virtual

update function for preparing the instance manager for being drawn called once per view.

virtual float makVrv::DtInstanceManager::lightpointRange ( unsigned int  instanceIx)
virtual
virtual void makVrv::DtInstanceManager::setDefaultLightPointMaxDistance ( float  distance)
virtual

Set the max distance for lightpoints.

Lightpoints will be culled at this distance if not 'small-feature' culled. If not set, and no max distance is set for the individual LightPointNode, then 20km is used

virtual float makVrv::DtInstanceManager::defaultLightPointMaxDistance ( ) const
virtual

Get the max distance for lightpoints.

virtual void makVrv::DtInstanceManager::setLightPointFadeBias ( float  bias)
virtual

Lightpoint range is used to fade from max brightness (alpha = 1) to 0 at max range.

The lightpoint will be culled at the specified range, but the range used to reduce the alpha is biased by multiplying it by this value. This allows the user to tune the brightness at the point it is clipped to guarantee it is visible for the entire desired range

virtual bool makVrv::DtInstanceManager::cullDistanceEnabled ( )
virtual

Overridw the cull distance used in the instance manager.

virtual float makVrv::DtInstanceManager::cullDistance ( )
virtual

Get the distance used if culling override is enabled Set with the slider in the experimental features dialog.

virtual std::string makVrv::DtInstanceManager::modelDefinitionNameProxy ( const std::string &  modelDefName)
virtual

Returns proxy model definition name generated from the model definition.

Used to group models using texture skinning that share the same filename attribute into the same instance group.

DtVirtualBaseClass* makVrv::DtInstanceManager::findCachedData ( const std::string &  modelType,
const std::string &  name 
)

Lookup cached data.

The modelType and name are case sensitive.

Return values
0if no data is cached.
void makVrv::DtInstanceManager::setCachedData ( const std::string &  modelType,
const std::string &  name,
DtVirtualBaseClass data 
)

Adds a data member to the cache.

If an existing data pointer is stored with key f(modelType, name) that key it is deleted. The modelType and name are case sensitive To delete cached data, pass a null pointer.

void makVrv::DtInstanceManager::clearCachedData ( )

Clear previously allocated memory (to be called from the destructor)

void makVrv::DtInstanceManager::releaseGLObjects ( osg::State *  state)
void makVrv::DtInstanceManager::updateBuffers ( const osg::View *  view)

should only be called by the tbo updater in order to update the tbos

void makVrv::DtInstanceManager::updateLightPoints ( const osg::Camera *  camera,
const osg::FrameStamp *  frameStamp,
osgUtil::CullVisitor *  cv,
const osg::Camera *  sceneCamera = NULL 
)

loop over the light point nodes and send down the model view matrix for each instance.

only called by DtInstanceNode

void makVrv::DtInstanceManager::addImguiStats ( ) const

added stats

void makVrv::DtInstanceManager::resetTboSendFlag ( )

called by precull event

void makVrv::DtInstanceManager::update ( double  simTime,
const osg::View *  view,
osg::Camera *  camera,
unsigned int  nodeMask,
osgUtil::CullVisitor *  cv,
const DtOsgCullVisitorParameters params,
bool  suppressLastUpdateTime 
)
protected

Update the instances.

Must be called once per frame per view for correct rendering. Updates in camera-relative coordinates, so the resulting drawables should be rendered with the view matrix's translation set to (0, 0, 0). The suppressLastUpdateTime parameter is used by intersect() to insure that myLastUpdateTime flag is not set for an intersect call that happens before the channels are updated (which would prevent updated camera-relative conversions for the new views).

void makVrv::DtInstanceManager::registerGeometry ( unsigned int  templateIx,
osg::Geometry *  geometry,
VpMap vpMap 
)
protected

Set up a geometry object for instanced rendering.

float makVrv::DtInstanceManager::computeDistanceToEye ( const Eyepoint eye,
const osg::Vec3d &  pos 
) const
protected

Compute the distance from an eyepoint to a point.

void makVrv::DtInstanceManager::updateOffsetsAndDistancesToEye ( const Eyepoint eye)
protected

Apply any offsets to the instance and then update its distance from the eye point.

void makVrv::DtInstanceManager::_updateOffsetsAndDistancesToEye ( const Eyepoint eye,
unsigned int  instanceOffset,
unsigned int  numInstances 
)
protected

Apply any offsets to the instance and then update its distance from the eye point.

void makVrv::DtInstanceManager::allocateRenderList ( )
protected

Resize myRenderList to fit the current set of instances and drawables.

void makVrv::DtInstanceManager::updateDataAndDrawables ( unsigned int  offset,
unsigned int  count 
)
protected

Update the instance texture for the specified view.

unsigned int makVrv::DtInstanceManager::updateRenderList ( const Eyepoint eye,
const osg::Matrixd &  viewMat,
unsigned int  nodeMask 
)
protected

Update the per-drawable render lists using the computed visibility and instance spatial data.

Returns the number of visible drawable instances for the current view

void makVrv::DtInstanceManager::updateLights ( const osg::View *  view)
protected
void makVrv::DtInstanceManager::resizeBuffersIfNecessary ( const osg::View *  view,
int  visibleCount 
)
protected
void makVrv::DtInstanceManager::resizeTBOIfNecessary ( const osg::View *  view,
int  visibleCount 
)
protected
void makVrv::DtInstanceManager::allocateInstanceData ( )
protected

Allocate space for instance data that isn't contained in the instance struct itself, for the current number of instances.

Includes visibility set, scale factors, user defined floats, etc.

unsigned int makVrv::DtInstanceManager::fillRenderList ( unsigned int  instanceOffset,
unsigned int  numInstances 
)
protected

Fill the render list with data from the specified range of instances.

Returns the number of visible drawable instances for the current view

void makVrv::DtInstanceManager::cullRange ( const Eyepoint eye,
const std::vector< osg::Vec4d > &  planes,
bool  useScale,
unsigned int  nodeMask,
unsigned int  instanceOffset,
unsigned int  instanceCount 
)
protected

Frustum cull the specified range of instances.

void makVrv::DtInstanceManager::slot_channelAdded ( DtChannelManager mgr,
DtChannel channel 
)
protected

Update per-view resources when a channel is added.

void makVrv::DtInstanceManager::slot_channelRemoved ( DtChannelManager mgr,
DtChannel channel 
)
protected

Clean up per-view resources when a channel is removed.

void makVrv::DtInstanceManager::clearTBO ( InstanceBuffer instanceBuffer)
protected

Clean up a single texture buffer object Uses a reference to a pointer since it can set instTbo = NULL.

void makVrv::DtInstanceManager::createHitList ( const osg::Vec3d &  end,
const osg::Vec3d &  start,
std::vector< InstancingHit > &  hitList 
)
protected

Support function for intersect for generating list of hits.

void makVrv::DtInstanceManager::loadInstanceShaders ( osgEarth::VirtualProgram *  vp)
protected

reads the instance shaders from disk and attaches them to vp

bool makVrv::DtInstanceManager::isOnExcludeList ( DtUniqueID  elementId,
const std::list< DtUniqueID > &  ignoreList 
)
protected
void makVrv::DtInstanceManager::addInstanceRootToSceneGraphIfNecessary ( void  )
protected
void makVrv::DtInstanceManager::processNewInstanceLights ( const InstanceTemplate instanceTemplate)
protected
void makVrv::DtInstanceManager::processNewInstanceDOFs ( DtModel model,
const InstanceTemplate instanceTemplate 
)
protected
void makVrv::DtInstanceManager::processNewInstanceSwitches ( const InstanceTemplate instanceTemplate,
bool  isSimpleModel 
)
protected
void makVrv::DtInstanceManager::processNewInstanceSequences ( const InstanceTemplate instanceTemplate)
protected
void makVrv::DtInstanceManager::processNewInstanceLightPoints ( const InstanceTemplate instanceTemplate,
const std::string &  lightPointGroup 
)
protected

initialize a new instance with it's group that it belongs to

void makVrv::DtInstanceManager::preCull ( )
protected
void makVrv::DtInstanceManager::frustumCull ( const osg::View *  view,
const Eyepoint eye,
unsigned int  nodeMask 
)
protected
void makVrv::DtInstanceManager::postCull ( )
protected
void makVrv::DtInstanceManager::_fillRenderList ( bool  globalScaling,
unsigned int  instanceOffset,
unsigned int  numInstances 
)
protected

Member Data Documentation

const unsigned int makVrv::DtInstanceManager::NumVec4PerInstance = 8
static

Number of vec4 slots per instance in the instance data buffer.

boost::signal<void(const std::string&)> makVrv::DtInstanceManager::signal_modelTypeRegistered

Emitted when a new model type is registered with the instancing system.

boost::signal<void(const std::string&, DtUniqueID, DtElementID, DtModel *)> makVrv::DtInstanceManager::signal_instanceCreated

Emitted when a new instance of a model is added to the scene.

boost::signal<void(const CullSet&)> makVrv::DtInstanceManager::signal_updateFinished

Emitted when instance update is complete.

InstanceTemplateVec makVrv::DtInstanceManager::myInstanceTemplates
protected

Per model definition templates for creating instances.

bool makVrv::DtInstanceManager::myRenderListDirty
protected

True when myRenderList needs to be resized.

RenderList makVrv::DtInstanceManager::myRenderList
protected
GeometryVec makVrv::DtInstanceManager::myDrawables
protected

Drawables in registered instance templates.

std::vector<unsigned int> makVrv::DtInstanceManager::myActiveDrawablesScratch
protected
BoolVec makVrv::DtInstanceManager::myVisibleSet
protected

Per instanced drawable visibility state.

InstanceMatrixVec makVrv::DtInstanceManager::myDrawableInstanceMatrix
protected

Spatial data for drawables in myDrawables.

Computed in camera relative coordinates per view

TextureCoordinateVec makVrv::DtInstanceManager::myUVOffsets
protected

Per instance UV offsets.

ByteVec makVrv::DtInstanceManager::myInstanceVisibleSet
protected

Array of Per instance visibility state.

std::vector<float> makVrv::DtInstanceManager::myDistanceToEye
protected

Per-instance distances to eyepoint for the current camera.

InstanceScaleVec makVrv::DtInstanceManager::myInstanceScales
protected

Array of per-instance model scale factors.

FloatVec makVrv::DtInstanceManager::myInstanceUserDefined
protected

Array of per-instance user-defined floats.

FloatVec makVrv::DtInstanceManager::myInstanceLightpointRange
protected

Array of per-instance max lightpoint distances squared.

InstanceCullDataVec makVrv::DtInstanceManager::myInstanceCullData
protected

Array of per-instance culling data.

InstanceElementIdVec makVrv::DtInstanceManager::myElementIds
protected

Array of per-instance element IDs.

InstanceStateVec makVrv::DtInstanceManager::myInstances
protected
ModelVec makVrv::DtInstanceManager::myModelInstances
protected
NodeVec makVrv::DtInstanceManager::myAnimatedModels
protected

list of nodes that have animated bits.

std::vector<InstanceDataOffsets> makVrv::DtInstanceManager::myInstanceDataOffsets
protected
InstancedLodVec makVrv::DtInstanceManager::myInstancedLods
protected
InstancedSwitchVec makVrv::DtInstanceManager::myInstancedSwitches
protected
InstancedSequenceVec makVrv::DtInstanceManager::myInstancedSequences
protected
InstancedDofVec makVrv::DtInstanceManager::myInstancedDofs
protected
InstancedLightVec makVrv::DtInstanceManager::myInstancedLights
protected
LightPointVec makVrv::DtInstanceManager::myInstancedLightPoints
protected
DofAnimations makVrv::DtInstanceManager::myDofAnimations
protected

Array of DOF animation data.

double makVrv::DtInstanceManager::myLastUpdateTime
protected

Last time the instances were updated.

unsigned int makVrv::DtInstanceManager::myLastNodeMask
protected

Nodemask used for last update.

osg::Vec3d makVrv::DtInstanceManager::myCameraPosition
protected

Camera position of the most recent camera that called update.

const osg::View* makVrv::DtInstanceManager::myLastView
protected

Reference to view that most recently called update.

const osg::Camera* makVrv::DtInstanceManager::myLastCamera
protected

Reference to the camera that most recently was used.

CullSet makVrv::DtInstanceManager::myPerViewCullResults
protected

Storage for per-view cull set calculation.

CacheMap makVrv::DtInstanceManager::myRuntimeCache
protected
tbb::concurrent_queue<unsigned int> makVrv::DtInstanceManager::myListToRemove
protected
InstanceStateMap makVrv::DtInstanceManager::myIdToInstances
protected

Map model DtUniqueID to instance index into myInstances array.

tbb::spin_rw_mutex makVrv::DtInstanceManager::myMapMutex
protected
osg::Vec4* makVrv::DtInstanceManager::myDynamicBufferData
protected
unsigned int makVrv::DtInstanceManager::myDynamicBufferDataSz
protected
unsigned int makVrv::DtInstanceManager::myCurrentDynamicBufferDataSize
protected
InstanceBufferVec makVrv::DtInstanceManager::myInstanceBuffers
protected
modelTypeToTemplateMap makVrv::DtInstanceManager::myModelTypeToTemplate
protected

Map model definition to its template index.

DtDe& makVrv::DtInstanceManager::myDe
protected
unsigned int makVrv::DtInstanceManager::myRequiredUvOffsets
protected

Number of UV offsets required by current allocated instances.

unsigned int makVrv::DtInstanceManager::myNumThreads
protected
std::vector<int> makVrv::DtInstanceManager::myTemplateMaxInstances
protected

Map maximum number of instances for each template that we've allocated space for.

std::vector<int> makVrv::DtInstanceManager::myTemplateActiveInstances
protected

Map number of active instances per template.

VpMap makVrv::DtInstanceManager::myVpMap
protected
VpRefList makVrv::DtInstanceManager::myVpRefs
protected
osg::ref_ptr<AlwaysCull> makVrv::DtInstanceManager::myAlwaysCullCallback
protected
osg::ref_ptr<DtInstanceNode> makVrv::DtInstanceManager::myInstanceRoot
protected
InstanceProcessorVec makVrv::DtInstanceManager::myPostCullInstanceProcessors
protected

Processors run after frustum culling.

InstanceProcessorVec makVrv::DtInstanceManager::myPreCullInstanceProcessors
protected

Processors run before frustum culling.

ViewVec makVrv::DtInstanceManager::myKnownViews
protected
ViewToGroup makVrv::DtInstanceManager::myViewToGroup
protected
GeometryToCallback makVrv::DtInstanceManager::myGeometryToCallback
protected
osg::ref_ptr<const DtOsgCullVisitorParameters> makVrv::DtInstanceManager::myLastCullParameters
protected

Most recent active cull vistor parameters.

float makVrv::DtInstanceManager::myDefaultLightPointRange
protected
float makVrv::DtInstanceManager::myLightPointFadeBias
protected
std::vector<osg::Vec4d> makVrv::DtInstanceManager::vecScratchPadPlanes
protected
tbb::atomic<int> makVrv::DtInstanceManager::myVisibleCount
protected
osg::ref_ptr<DtInstanceManagerTboUpdater> makVrv::DtInstanceManager::myDrawCallUpdater
protected
int makVrv::DtInstanceManager::myNeedsMainThreadTextureUpdate
protected
std::string makVrv::DtInstanceManager::myInstanceVS
protected
std::string makVrv::DtInstanceManager::myInstanceViewVS
protected
std::string makVrv::DtInstanceManager::myInstanceFS
protected
std::map<const InstanceTemplate*, int> makVrv::DtInstanceManager::myNewTemplates
protected
unsigned int makVrv::DtInstanceManager::myCurrentTBBChunkSize
protected
bool makVrv::DtInstanceManager::myArtPartSmoothingEnabled
protected
float makVrv::DtInstanceManager::myArtPartSmoothingPeriod
protected
bool makVrv::DtInstanceManager::myTboSendFlag
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)