![]() |
VR-Forces 4.3 Class Documentation
|
Manages data for instanced rendering system and kicks off DtInstanceProcessors to update instance state. More...

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 | 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 | LightSource |
| struct | ModelTypeDofData |
| DOF data that is constant across all instances of a model type. 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< char > | BoolVec |
| typedef std::vector< char > | ByteVec |
| 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< ArrayRange > | DrawableRangeVec |
| typedef std::vector< osg::Vec2f > | TextureCoordinateVec |
| typedef std::vector< float > | FloatVec |
| typedef std::vector < InstanceTemplate > | InstanceTemplateVec |
| typedef std::vector< LightSource > | LightSourceVec |
| typedef std::vector < ModelTypeDofData > | PerDofDataVec |
| typedef std::vector < InstancedSwitch > | InstancedSwitchVec |
| typedef std::vector < InstancedSequence > | InstancedSequenceVec |
| typedef std::vector< DofAnimation > | DofAnimations |
| typedef std::vector< osg::Node * > | NodeVec |
| typedef std::vector < InstancedSwitch * > | SwitchVec |
| typedef std::vector < InstancedSequence * > | SequenceVec |
| typedef std::vector < InstancedLod * > | LodVec |
| typedef std::vector < DtInstanceState > | InstanceStateVec |
| typedef std::vector< InstancedLod > | InstancedLodVec |
| typedef std::vector< InstancedDof > | InstancedDofVec |
| typedef std::vector < InstanceCullData > | InstanceCullDataVec |
| typedef std::vector < InstanceMatrix > | InstanceMatrixVec |
| typedef std::vector< float > | InstanceScaleVec |
| typedef std::vector< DtElementID > | InstanceElementIdVec |
| typedef std::vector < InstancedLight > | InstancedLightVec |
Public Member Functions | |
| bool | intersect (const osg::Vec3d &start, const osg::Vec3d &end, DtOsgIntersectorResult &result) |
| Find the closest instance intersection to the start point along a line segment. | |
| bool | intersect (const osg::Vec3d &start, const osg::Vec3d &end, std::vector< DtOsgIntersectorResult > &results) |
| Find the instance intersections to the start point along a line segment. | |
| DtInstanceManager (DtDe &de) | |
| CTOR. | |
| virtual | ~DtInstanceManager () |
| DTOR. | |
| virtual void | reset () |
| Clear everything in the instance manager. | |
| virtual osg::Node * | instanceRoot () |
| Get the root node containing all instanced geometry. | |
| bool | isRegistered (const std::string &modelType) |
| Check whether a model is registered and ready for instancing. | |
| void | registerModel (const std::string &modelType, GeometryVec &drawables, LodVec &lods, SwitchVec &switches, SequenceVec &sequences, PerDofDataVec &perDofData, LightSourceVec &lightSources, float boundingRadius, const DtVector &boundingCenter, unsigned int nodeMask, osg::ref_ptr< osg::StateSet > rootNodeSS) |
| Register a model for instancing. | |
| void | setupModelGeode (const std::string &modelType, unsigned int nodeMask) |
| Set up a geode to contain instances of a model. | |
| void | allocateImage (osg::View *view) |
| Allocate an instance texture for the specified view. | |
| void | freeInstance (DtUniqueID id) |
| Free the instance with the specified ID. | |
| bool | newInstance (const std::string &modelType, DtUniqueID id, DtElementID elementId) |
| Set up a new instance of the specified model. | |
| DtInstanceState * | findInstanceState (DtUniqueID id) |
| Find the specified instance's state. | |
| InstanceCullData * | findInstanceCullData (DtUniqueID id) |
| Find the culling data for the specified instance. | |
| InstanceElementIdVec & | elementIds () |
| Element IDs of instances. | |
| InstanceScaleVec & | instanceScales () |
| Scale of instances. | |
| ByteVec & | instanceVisibleSet () |
| Visibility of instances in current view. | |
| InstanceMatrixVec & | drawableInstanceMatrix () |
| Spatial state of instanced drawables in current view. | |
| InstanceCullDataVec & | instanceCullData () |
| Per instance cull data. | |
| InstanceStateVec & | instances () |
| State of active instances. | |
| TextureCoordinateVec & | uvOffsets () |
| UV Offset state of drawable instances. | |
| InstanceTemplateVec & | instanceTemplates () |
| Per model definition templates for creating instances. | |
| std::vector< float > & | distanceToEye () |
| Per-instance distances to eyepoint for the current camera. | |
| DofAnimations & | dofAnimations () |
| Array of DOF animation data. | |
| double & | lastUpdateTime () |
| Last time the instances were updated. | |
| DtOsgCullVisitorParameters * | lastCullParameters () |
| Last cull parameters from the renderer. | |
| unsigned int | visibleSetStride () |
| Stride between each instance's drawable visibility state in the myVisibleSet. | |
| BoolVec & | visibleSet () |
| Per instanced drawable visibility. | |
| osg::Vec3d & | cameraPosition () |
| Camera position of the most recent camera that called update. | |
| osg::View * | lastView () |
| View that most recently called update. | |
| unsigned int | drawableIndex (unsigned int instanceIx) |
| Get the start index of the drawable spatial data for the specified instance. | |
| void | reloadShaders () |
| Reload instancing shaders. | |
| GeometryVec & | drawables () |
| void | setSequenceMode (DtInstanceState &instance, unsigned int sequenceIndex, InstancedSequence::SequenceMode mode) |
| void | setSequenceSpeed (DtInstanceState &instance, unsigned int sequenceIndex, float speed) |
| Set the playback speed for the specified sequence. | |
| void | setSequencePlayTime (DtInstanceState &instance, unsigned int sequenceIndex, float loopTime) |
| Set the time the specified sequence should play for, starting now. | |
| InstanceMatrix | dofState (DtInstanceState &instanceState, unsigned int partIndex) |
| void | setDofState (InstanceMatrix &m, DtInstanceState &state, unsigned int partIndex) |
| void | setDofAnimation (osg::Vec3f &hpr, osg::Vec3f hprVel, DtInstanceState &state, unsigned int partIndex) |
| Set the DOF animation state for the specified instanced DOF. | |
| void | setDofTranslation (osg::Vec3f &trans, DtInstanceState &state, unsigned int partIndex) |
| Set the DOF translation state for the specified instanced DOF. | |
| void | setSwitchState (DtInstanceState &instance, unsigned int partIndex, unsigned int childIndex, bool state) |
| void | setUVOffset (DtUniqueID id, unsigned int drawableIx, osg::Vec2f uvOffset) |
| void | setUserDefined (DtUniqueID id, float userDefined) |
Instanced scene graph accessors | |
| InstancedLodVec & | instancedLods () |
| InstancedSwitchVec & | instancedSwitches () |
| InstancedSequenceVec & | instancedSequences () |
| InstancedDofVec & | instancedDofs () |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| Do nothing constructor. | |
| virtual | ~DtVirtualBaseClass () |
| Virtual do nothing destructor. | |
Public Member Functions inherited from makVrv::DtSignalConnectionManager | |
| DtSignalConnectionManager () | |
| CTOR. | |
| virtual | ~DtSignalConnectionManager () |
| DTOR. | |
| void | manageConnection (const boost::signalslib::connection &conn) |
| Connect a signal. | |
| DtSignalConnectionManager & | operator+= (const boost::signalslib::connection &conn) |
| Connect a signal. | |
| int | numberOfConnections () const |
| Get the number of connections. | |
| void | disconnectSignals () |
| Disconnect all signals. | |
| bool | blockConnections (bool blocked) |
| Blocks/unblocks connections. | |
| bool | blockConnection (int index, bool blocked) |
| Blocks/unblocks connections. | |
| bool | connectionsBlocked () const |
| check whether connections are blocked. | |
| bool | connectionBlocked (int index) const |
| check whether connections are blocked. | |
Static Public Member Functions | |
| static DtInstanceManager & | instance (DtDe &de) |
| Get an instance of the instance manager. | |
Public Attributes | |
Signals | |
| boost::signal< void(const std::string &)> | signal_modelTypeRegistered |
| Emitted when a new model type is registered with the instancing system. | |
Static Public Attributes | |
| static const unsigned int | NumVec4PerInstance = 8 |
| Number of vec4 slots per instance in the instance data buffer. | |
Protected Types | |
| typedef std::vector< RenderState > | RenderStateVec |
| List of transform matrices that will be used to render instances of a particular drawable. | |
| typedef std::vector < GeometryRenderList > | RenderList |
| Per drawable list of visible instance transforms. | |
| typedef boost::unordered_map < DtUniqueID, unsigned int > | InstanceStateMap |
| Map from instance unique ID to the index into myInstances for that instance. | |
| typedef std::vector < InstanceBuffer > | InstanceBufferVec |
| Vector of per-view instance data buffers. | |
| typedef boost::unordered_map < std::string, int > | modelTypeToTemplateMap |
| Map from model type names to template index. | |
| typedef boost::unordered_map < std::string, osg::ref_ptr < osg::Geode > > | modelTypeToGroup |
| Map of model type name to geode containing that model's drawables. | |
| typedef std::vector < DtInstanceProcessor * > | InstanceProcessorVec |
| Vector of instance processors. | |
| typedef std::vector< osg::View * > | ViewVec |
| List of active views. | |
| typedef boost::unordered_map < osg::View *, osg::ref_ptr < DtViewSpecificGroup > > | ViewToGroup |
| Map from views to the group node that activates their instance buffer. | |
| typedef boost::unordered_map < osg::Geometry *, osg::ref_ptr < DtPerViewUniformCallback > > | GeometryToCallback |
| Map from geometry (drawable) to the callback that updates its start index uniform. | |
Protected Types inherited from makVrv::DtSignalConnectionManager | |
| typedef std::vector < boost::signalslib::connection > | Connections |
| A collection of signals. | |
Protected Member Functions | |
| void | update (double simTime, osg::View *view, DtOsgCullVisitorParameters *params, unsigned int nodeMask) |
| Update the instances. | |
| void | registerGeometry (const std::string &modelType, osg::Geometry *geometry, VpMap &vpMap) |
| Set up a geometry object for instanced rendering. | |
| float | computeDistanceToEye (const Eyepoint &eye, const osg::Vec3d &pos) const |
| Compute the distance from an eyepoint to a point. | |
| void | allocateRenderList () |
| Resize myRenderList to fit the current set of instances and drawables. | |
| unsigned int | updateBuffers (osg::View *view, DtGLTextureBufferObject *tbo, const ArrayRange &drawableRange, unsigned int bufferOffset, osg::Vec4 *bufferStorage) |
| Update the instance texture for the specified view. | |
| unsigned int | updateRenderList (const Eyepoint &eye, const Frustum &frustum, const osg::Matrixd &viewMat, unsigned int nodeMask) |
| Update the per-drawable render lists using the computed visibility and instance spatial data. | |
| void | allocateInstanceData () |
| Allocate space for instance data that isn't contained in the instance struct itself, for the current number of instances. | |
| unsigned int | fillRenderList (unsigned visibleSetStride, unsigned int instanceOffset, unsigned int numInstances) |
| Fill the render list with data from the specified range of instances. | |
| void | cullRange (const Eyepoint &eye, unsigned int instanceOffset, unsigned int instanceCount, std::vector< osg::Vec4d > &planes, bool useScale, unsigned int nodeMask) |
| Frustum cull the specified range of instances. | |
| void | slot_channelAdded (DtChannelManager *mgr, DtChannel *channel) |
| Update per-view resources when a channel is added. | |
| void | slot_channelRemoved (DtChannelManager *mgr, DtChannel *channel) |
| Clean up per-view resources when a channel is removed. | |
| void | createHitList (const osg::Vec3d &end, const osg::Vec3d &start, std::vector< InstancingHit > &hitList) |
| Support function for intersect for generating list of hits. | |
| void | loadInstanceShaders (osg::ref_ptr< osgEarth::VirtualProgram > vp) |
| reads the instance shaders from disk and attaches them to vp | |
Protected Attributes | |
| BoolVec | myVisibleSet |
| Per instanced drawable visibility state. | |
| ByteVec | myInstanceVisibleSet |
| Per instance visibility state. | |
| TextureCoordinateVec | myUVOffsets |
| Per instance UV offsets. | |
| InstanceMatrixVec | myDrawableInstanceMatrix |
| Spatial data for drawables in myDrawables. | |
| InstanceCullDataVec | myInstanceCullData |
| Array of per-instance culling data. | |
| InstanceScaleVec | myInstanceScales |
| Array of per-instance model scale factors. | |
| InstanceElementIdVec | myElementIds |
| Array of per-instance element IDs. | |
| FloatVec | myInstanceUserDefined |
| Array of per-instance user-defined floats. | |
| InstanceTemplateVec | myInstanceTemplates |
| Per model definition templates for creating instances. | |
| std::vector< float > | myDistanceToEye |
| Per-instance distances to eyepoint for the current camera. | |
| DofAnimations | myDofAnimations |
| Array of DOF animation data. | |
| double | myLastUpdateTime |
| Last time the instances were updated. | |
| unsigned int | myLastNodeMask |
| Nodemask used for last update. | |
| unsigned int | myVisibleSetStride |
| Stride between each instance's drawable visibility state in the myVisibleSet. | |
| osg::Vec3d | myCameraPosition |
| Camera position of the most recent camera that called update. | |
| osg::View * | myLastView |
| Reference to view that most recently called update. | |
| osg::Vec4 * | myDynamicBufferData |
| unsigned int | myDynamicBufferDataSz |
| RenderList | myRenderList |
| bool | myRenderListDirty |
| True when myRenderList needs to be resized. | |
| InstanceStateMap | myIdToInstances |
| Map model DtUniqueID to instance index into myInstances array. | |
| InstanceBufferVec | myInstanceBuffers |
| modelTypeToTemplateMap | myModelTypeToTemplate |
| Map model definition to its template index. | |
| DtDe & | myDe |
| GeometryVec | myDrawables |
| Drawables in registered instance templates. | |
| unsigned int | myRequiredUvOffsets |
| Number of UV offsets required by current allocated instances. | |
| modelTypeToGroup | myModelTypeToGeometryGroup |
| osg::ref_ptr< AlwaysCull > | myAlwaysCullCallback |
| osg::ref_ptr< DtInstanceNode > | myInstanceRoot |
| InstanceProcessorVec | myPostCullInstanceProcessors |
| Processors run after frustum culling. | |
| InstanceProcessorVec | myPreCullInstanceProcessors |
| Processors run before frustum culling. | |
| ViewVec | myKnownViews |
| ViewToGroup | myViewToGroup |
| GeometryToCallback | myGeometryToCallback |
| osg::ref_ptr < DtOsgCullVisitorParameters > | myLastCullParameters |
| Most recent active cull vistor parameters. | |
Instanced scene graph | |
Array of active instances | |
| InstanceStateVec | myInstances |
| InstancedLodVec | myInstancedLods |
| InstancedSwitchVec | myInstancedSwitches |
| InstancedSequenceVec | myInstancedSequences |
| InstancedDofVec | myInstancedDofs |
| InstancedLightVec | myInstancedLights |
Instance processor thread data | |
Number of threads to use for processing instances during update | |
| unsigned int | myNumThreads |
local VirtualProgram cache | |
| VpMap | myVpMap |
| VpRefList | myVpRefs |
Protected Attributes inherited from makVrv::DtSignalConnectionManager | |
| Connections | myConnections |
| The connected signals. | |
| bool | myConnectionsBlocked |
| bool | myIndiviualConnectionedBlocked |
Friends | |
| class | DtInstanceNode |
Per-template buffer size tracking | |
| typedef boost::unordered_map < unsigned int, unsigned int > | PerTemplateCount |
| Map maximum number of instances for each template that we've allocated space for. | |
| PerTemplateCount | myTemplateMaxInstances |
| Map maximum number of instances for each template that we've allocated space for. | |
| PerTemplateCount | myTemplateActiveInstances |
| Map number of active instances per template. | |
Manages data for instanced rendering system and kicks off DtInstanceProcessors to update instance state.
Use instance processor objects to modify instance spatial data/visibility
| typedef std::vector<osg::ref_ptr<osg::Geometry> > makVrv::DtInstanceManager::GeometryVec |
| typedef std::vector<char> makVrv::DtInstanceManager::BoolVec |
| typedef std::vector<char> makVrv::DtInstanceManager::ByteVec |
| 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<ArrayRange> makVrv::DtInstanceManager::DrawableRangeVec |
| typedef std::vector<osg::Vec2f> makVrv::DtInstanceManager::TextureCoordinateVec |
| typedef std::vector<float> makVrv::DtInstanceManager::FloatVec |
| typedef std::vector<LightSource> makVrv::DtInstanceManager::LightSourceVec |
| typedef std::vector<ModelTypeDofData> makVrv::DtInstanceManager::PerDofDataVec |
| typedef std::vector<InstancedSwitch> makVrv::DtInstanceManager::InstancedSwitchVec |
| typedef std::vector<InstancedSequence> makVrv::DtInstanceManager::InstancedSequenceVec |
| typedef std::vector<DofAnimation> makVrv::DtInstanceManager::DofAnimations |
| typedef std::vector<osg::Node*> makVrv::DtInstanceManager::NodeVec |
| typedef std::vector<InstancedSwitch*> makVrv::DtInstanceManager::SwitchVec |
| typedef std::vector<InstancedSequence*> makVrv::DtInstanceManager::SequenceVec |
| typedef std::vector<InstancedLod*> makVrv::DtInstanceManager::LodVec |
| typedef std::vector<DtInstanceState> makVrv::DtInstanceManager::InstanceStateVec |
| typedef std::vector<InstancedLod> makVrv::DtInstanceManager::InstancedLodVec |
| typedef std::vector<InstancedDof> makVrv::DtInstanceManager::InstancedDofVec |
| typedef std::vector<InstanceCullData> makVrv::DtInstanceManager::InstanceCullDataVec |
| typedef std::vector<InstanceMatrix> makVrv::DtInstanceManager::InstanceMatrixVec |
| typedef std::vector<float> makVrv::DtInstanceManager::InstanceScaleVec |
| typedef std::vector<DtElementID> makVrv::DtInstanceManager::InstanceElementIdVec |
| typedef std::vector<InstancedLight> makVrv::DtInstanceManager::InstancedLightVec |
| typedef std::vector<InstanceTemplate> makVrv::DtInstanceManager::InstanceTemplateVec |
|
protected |
List of transform matrices that will be used to render instances of a particular drawable.
|
protected |
Per drawable list of visible instance transforms.
|
protected |
Map from instance unique ID to the index into myInstances for that instance.
|
protected |
Vector of per-view instance data buffers.
|
protected |
Map from model type names to template index.
|
protected |
Map maximum number of instances for each template that we've allocated space for.
|
protected |
Map of model type name to geode containing that model's drawables.
|
protected |
Vector of instance processors.
Processors are run in order once per frame to update instance visibility/spatial data
|
protected |
List of active views.
Used to decide what buffers we need allocated/updated
|
protected |
Map from views to the group node that activates their instance buffer.
|
protected |
Map from geometry (drawable) to the callback that updates its start index uniform.
| makVrv::DtInstanceManager::DtInstanceManager | ( | DtDe & | de | ) |
CTOR.
|
virtual |
DTOR.
| bool makVrv::DtInstanceManager::intersect | ( | const osg::Vec3d & | start, |
| const osg::Vec3d & | end, | ||
| DtOsgIntersectorResult & | result | ||
| ) |
Find the closest instance intersection to the start point along a line segment.
| bool makVrv::DtInstanceManager::intersect | ( | const osg::Vec3d & | start, |
| const osg::Vec3d & | end, | ||
| std::vector< DtOsgIntersectorResult > & | results | ||
| ) |
Find the instance intersections to the start point along a line segment.
| void makVrv::DtInstanceManager::setSequenceMode | ( | DtInstanceState & | instance, |
| unsigned int | sequenceIndex, | ||
| InstancedSequence::SequenceMode | mode | ||
| ) |
Set the playback mode for the specified sequence
| void makVrv::DtInstanceManager::setSequenceSpeed | ( | DtInstanceState & | instance, |
| unsigned int | sequenceIndex, | ||
| float | speed | ||
| ) |
Set the playback speed for the specified sequence.
| void makVrv::DtInstanceManager::setSequencePlayTime | ( | DtInstanceState & | instance, |
| unsigned int | sequenceIndex, | ||
| float | loopTime | ||
| ) |
Set the time the specified sequence should play for, starting now.
| InstanceMatrix makVrv::DtInstanceManager::dofState | ( | DtInstanceState & | instanceState, |
| unsigned int | partIndex | ||
| ) |
Get the current transform matrix of an instanced articulated part
| void makVrv::DtInstanceManager::setDofState | ( | InstanceMatrix & | m, |
| DtInstanceState & | state, | ||
| unsigned int | partIndex | ||
| ) |
Set the transform for the specified instanced DOF
| void makVrv::DtInstanceManager::setDofAnimation | ( | osg::Vec3f & | hpr, |
| osg::Vec3f | hprVel, | ||
| DtInstanceState & | state, | ||
| unsigned int | partIndex | ||
| ) |
Set the DOF animation state for the specified instanced DOF.
| void makVrv::DtInstanceManager::setDofTranslation | ( | osg::Vec3f & | trans, |
| DtInstanceState & | state, | ||
| unsigned int | partIndex | ||
| ) |
Set the DOF translation state for the specified instanced DOF.
| void makVrv::DtInstanceManager::setSwitchState | ( | 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, | ||
| 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
|
static |
Get an instance of the instance manager.
|
virtual |
Clear everything in the instance manager.
Deletes all current instances and instance templates
|
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, |
| GeometryVec & | drawables, | ||
| LodVec & | lods, | ||
| SwitchVec & | switches, | ||
| SequenceVec & | sequences, | ||
| PerDofDataVec & | perDofData, | ||
| LightSourceVec & | lightSources, | ||
| float | boundingRadius, | ||
| const DtVector & | boundingCenter, | ||
| unsigned int | nodeMask, | ||
| osg::ref_ptr< osg::StateSet > | rootNodeSS | ||
| ) |
Register a model for instancing.
| void makVrv::DtInstanceManager::setupModelGeode | ( | const std::string & | modelType, |
| unsigned int | nodeMask | ||
| ) |
Set up a geode to contain instances of a model.
| void makVrv::DtInstanceManager::allocateImage | ( | osg::View * | view | ) |
Allocate an instance texture for the specified view.
| void makVrv::DtInstanceManager::freeInstance | ( | DtUniqueID | id | ) |
Free the instance with the specified ID.
| bool makVrv::DtInstanceManager::newInstance | ( | const std::string & | modelType, |
| DtUniqueID | id, | ||
| DtElementID | elementId | ||
| ) |
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
|
inline |
Element IDs of instances.
|
inline |
Scale of instances.
|
inline |
Visibility of instances in current view.
|
inline |
Spatial state of instanced drawables in current view.
|
inline |
Per instance cull data.
|
inline |
State of active instances.
|
inline |
UV Offset state of drawable instances.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Per model definition templates for creating instances.
|
inline |
Per-instance distances to eyepoint for the current camera.
|
inline |
Array of DOF animation data.
|
inline |
Last time the instances were updated.
|
inline |
Last cull parameters from the renderer.
|
inline |
Stride between each instance's drawable visibility state in the myVisibleSet.
|
inline |
Per instanced drawable visibility.
|
inline |
Camera position of the most recent camera that called update.
|
inline |
View that most recently called update.
Get the start index of the drawable spatial data for the specified instance.
| void makVrv::DtInstanceManager::reloadShaders | ( | ) |
Reload instancing shaders.
|
inline |
|
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).
|
protected |
Set up a geometry object for instanced rendering.
|
protected |
Compute the distance from an eyepoint to a point.
|
protected |
Resize myRenderList to fit the current set of instances and drawables.
|
protected |
Update the instance texture for the specified view.
|
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
|
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.
|
protected |
Fill the render list with data from the specified range of instances.
Returns the number of visible drawable instances for the current view
|
protected |
Frustum cull the specified range of instances.
|
protected |
Update per-view resources when a channel is added.
|
protected |
Clean up per-view resources when a channel is removed.
|
protected |
Support function for intersect for generating list of hits.
|
protected |
reads the instance shaders from disk and attaches them to vp
|
friend |
|
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.
|
protected |
Per instanced drawable visibility state.
|
protected |
Per instance visibility state.
|
protected |
Per instance UV offsets.
|
protected |
Spatial data for drawables in myDrawables.
Computed in camera relative coordinates per view
|
protected |
Array of per-instance culling data.
|
protected |
Array of per-instance model scale factors.
|
protected |
Array of per-instance element IDs.
|
protected |
Array of per-instance user-defined floats.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Per model definition templates for creating instances.
|
protected |
Per-instance distances to eyepoint for the current camera.
|
protected |
Array of DOF animation data.
|
protected |
Last time the instances were updated.
|
protected |
Nodemask used for last update.
|
protected |
Stride between each instance's drawable visibility state in the myVisibleSet.
|
protected |
Camera position of the most recent camera that called update.
|
protected |
Reference to view that most recently called update.
|
protected |
|
protected |
|
protected |
|
protected |
True when myRenderList needs to be resized.
|
protected |
Map model DtUniqueID to instance index into myInstances array.
|
protected |
|
protected |
Map model definition to its template index.
|
protected |
|
protected |
Drawables in registered instance templates.
|
protected |
Number of UV offsets required by current allocated instances.
|
protected |
|
protected |
Map maximum number of instances for each template that we've allocated space for.
|
protected |
Map number of active instances per template.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Processors run after frustum culling.
|
protected |
Processors run before frustum culling.
|
protected |
|
protected |
|
protected |
|
protected |
Most recent active cull vistor parameters.