![]() |
VR-Forces 4.7 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 | 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 | 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< LightPoint > | LightPointVec |
| 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, 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 | 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 | setElementId (DtUniqueID id, DtUniqueID elementId) |
| Set the element ID for an instanced model. | |
| osg::StateSet * | getModelTypeRootStateSet (const std::string &modelType) |
| Get the root state set for a particular type of model. | |
| 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, LightPointVec &lightPointNodes, float boundingRadius, const DtVector &boundingCenter, unsigned int nodeMask, osg::ref_ptr< osg::StateSet > rootNodeSS, bool daylightControlledLights=false) |
| Register a model for instancing. | |
| osg::Geode * | setupModelGeode (const std::string &modelType, unsigned int nodeMask) |
| Set up a geode to contain instances of a model. | |
| void | allocateImage (const 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, osg::Node *rootNode, const std::string &lightPointGroup, bool isSimpleModel) |
| 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. | |
| void | setPosition (DtUniqueID uniqueID, const DtVector &vPosition) |
| Set Position and orientation off of Dt types. | |
| void | setOrientation (DtUniqueID uniqueID, const DtTaitBryan &orientation) |
| void | setPosition (DtUniqueID uniqueID, const osg::Vec3d &vPosition) |
| Set Position and orientation off of osg types. | |
| void | setOrientation (DtUniqueID uniqueID, const osg::Quat &orientation) |
| void | setVisible (DtUniqueID uniqueID, bool bVisible) |
| Set visibility. | |
| void | setBlendColor (DtUniqueID uniqueID, float r, float g, float b, float a) |
| Set the blending color. | |
| 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, seperate from the global scale. | |
| void | setCullParameters (DtUniqueID uniqueID, short modelSet, unsigned int nodeMask, bool visible) |
| Set the various culling parameters. | |
| 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. | |
| const 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. | |
| const osg::View * | lastView () |
| View that most recently called update. | |
| const osg::Camera * | lastCamera () |
| Camera that was most recently used to udate. | |
| 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 () |
| unsigned int | visibleCount () const |
| unsigned int | dynamicBufferDataSize () const |
| virtual bool | isDaylight () |
| Returns whether or not the light level for this frame counts as daylight. | |
| virtual void | traverse (osg::NodeVisitor &nv) |
| needed to run material callbacks | |
| 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. | |
| virtual void | updateForDrawing (osgUtil::CullVisitor *cv, const DtOsgCullVisitorParameters *params) |
| update function for preparing the instance manager for being drawn called once per view. | |
| virtual float | lightpointRange (unsigned int instanceIx) |
| virtual void | setDefaultLightPointMaxDistance (float distance) |
| Set the max distance for lightpoints. | |
| virtual float | defaultLightPointMaxDistance () const |
| Get the max distance for lightpoints. | |
| virtual void | setLightPointFadeBias (float bias) |
| Lightpoint range is used to fade from max brightness (alpha = 1) to 0 at max range. | |
| virtual bool | cullDistanceEnabled () |
| Overridw the cull distance used in the instance manager. | |
| virtual float | cullDistance () |
| Get the distance used if culling override is enabled Set with the slider in the experimental features dialog. | |
| virtual std::string | modelDefinitionNameProxy (const std::string &modelDefName) |
| Returns proxy model definition name generated from the model definition. | |
| DtVirtualBaseClass * | findCachedData (const std::string &modelType, const std::string &name) |
| Lookup cached data. | |
| void | setCachedData (const std::string &modelType, const std::string &name, DtVirtualBaseClass *data) |
| Adds a data member to the cache. | |
| void | clearCachedData () |
| Clear previously allocated memory (to be called from the destructor) | |
| void | releaseGLObjects (void) |
| 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. | |
| void | setSequencePlayTime (const DtInstanceState &instance, unsigned int sequenceIndex, float loopTime) |
| Set the time the specified sequence should play for, starting now. | |
| 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. | |
| void | setDofTranslation (osg::Vec3f &trans, osg::Vec3f &transVel, const DtInstanceState &state, unsigned int partIndex) |
| Set the DOF translation state for the specified instanced DOF. | |
| void | setSwitchState (const 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) |
| void | setLightpointRange (DtUniqueID id, float range) |
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. | |
| boost::signal< void(const std::string &, DtUniqueID, DtElementID, osg::Node *)> | signal_instanceCreated |
| Emitted when a new instance of a model is added to the scene. | |
| boost::signal< void(const CullSet &)> | signal_updateFinished |
| Emitted when instance update is complete. | |
Static Public Attributes | |
| static const unsigned int | NumVec4PerInstance = 8 |
| Number of vec4 slots per instance in the instance data buffer. | |
Protected Types | |
| typedef boost::unordered_map < std::string, DtVirtualBaseClass * > | CacheMap |
| Cached data for model definitino specifc data. | |
| 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 std::vector < DtInstanceProcessor * > | InstanceProcessorVec |
| Vector of instance processors. | |
| typedef std::vector< osg::View * > | ViewVec |
| List of active views. | |
| typedef boost::unordered_map < const 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, const osg::View *view, osg::Camera *camera, unsigned int nodeMask, osgUtil::CullVisitor *cv, const DtOsgCullVisitorParameters *params, bool suppressLastUpdateTime) |
| Update the instances. | |
| void | registerGeometry (unsigned int templateIx, 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 | updateDistancesToEye (const Eyepoint &eye) |
| Update the insances' distance from the eye point. | |
| void | _updateDistancesToEye (const Eyepoint &eye, unsigned int instanceOffset, unsigned int numInstances) |
| Update the insances' distance from the eye point. | |
| void | allocateRenderList () |
| Resize myRenderList to fit the current set of instances and drawables. | |
| unsigned int | updateDataAndDrawables (const osg::View *view, const ArrayRange &drawableRange, unsigned int bufferOffset, osg::Vec4 *bufferStorage) |
| Update the instance texture for the specified view. | |
| 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. | |
| void | updateLights (const osg::View *view) |
| void | resizeBuffersIfNecessary (const osg::View *view, int visibleCount) |
| void | resizeTBOIfNecessary (const osg::View *view, int visibleCount) |
| void | updateBuffers (const osg::View *view) |
| 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. | |
| 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, const std::vector< osg::Vec4d > &planes, bool useScale, unsigned int nodeMask, unsigned int instanceOffset, unsigned int instanceCount) |
| 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 | |
| bool | isOnExcludeList (DtUniqueID elementId, const std::list< DtUniqueID > &ignoreList) |
| void | addInstanceRootToSceneGraphIfNecessary (void) |
| void | processNewInstanceLights (const InstanceTemplate &instanceTemplate) |
| void | processNewInstanceDOFs (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 | |
| void | preCull (unsigned int maxChunkSize) |
| void | frustumCull (const osg::View *view, const Eyepoint &eye, unsigned int nodeMask) |
| void | postCull (unsigned int maxChunkSize) |
| void | _fillRenderList (bool globalScaling, unsigned int instanceOffset, unsigned int numInstances) |
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. | |
| FloatVec | myInstanceLightpointRange |
| Array of per-instance max lightpoint distances squared. | |
| 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. | |
| const osg::View * | myLastView |
| Reference to view that most recently called update. | |
| const osg::Camera * | myLastCamera |
| Reference to the camera that most recently was used. | |
| CullSet | myCullSet |
| Storage for per-view cull set calculation. | |
| CacheMap | myRuntimeCache |
| bool | myIsDaylight |
| osg::Vec4 * | myDynamicBufferData |
| unsigned int | myDynamicBufferDataSz |
| unsigned int | myCurrentDynamicBufferDataSize |
| 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. | |
| 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< const DtOsgCullVisitorParameters > | myLastCullParameters |
| Most recent active cull vistor parameters. | |
| DtInstanceLpProcessor * | myLpProcessor |
| float | myDefaultLightPointRange |
| float | myLightPointFadeBias |
| std::vector< osg::Vec4d > | vecScratchPadPlanes |
| DtAtomicScalar< int > | myVisibleCount |
| class DtInstanceManagerTBOUpdater * | myDrawCallUpdater |
| int | myNeedsMainThreadTextureUpdate |
| std::string | myInstanceVS |
| std::string | myInstanceViewVS |
| std::string | myInstanceFS |
Instanced scene graph | |
Array of active instances | |
| InstanceStateVec | myInstances |
| 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 |
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 |
| class | DtInstanceManagerTBOUpdater |
Per-template buffer size tracking | |
| typedef boost::unordered_map < unsigned int, unsigned int > | PerTemplateCount |
| 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<LightPoint> makVrv::DtInstanceManager::LightPointVec |
| 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 |
Cached data for model definitino specifc data.
|
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 |
|
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, | ||
| 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::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, | ||
| 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 |
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, | ||
| LightPointVec & | lightPointNodes, | ||
| float | boundingRadius, | ||
| const DtVector & | boundingCenter, | ||
| unsigned int | nodeMask, | ||
| 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.
| bool makVrv::DtInstanceManager::newInstance | ( | const std::string & | modelType, |
| DtUniqueID | id, | ||
| DtElementID | elementId, | ||
| osg::Node * | rootNode, | ||
| 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::setOrientation | ( | 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::setOrientation | ( | 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, seperate from the global scale.
| void makVrv::DtInstanceManager::setCullParameters | ( | DtUniqueID | uniqueID, |
| short | modelSet, | ||
| unsigned int | nodeMask, | ||
| bool | visible | ||
| ) |
Set the various culling parameters.
|
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.
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.
|
inline |
Camera that was most recently used to udate.
Get the start index of the drawable spatial data for the specified instance.
| void makVrv::DtInstanceManager::reloadShaders | ( | ) |
Reload instancing shaders.
|
inline |
|
virtual |
Returns whether or not the light level for this frame counts as daylight.
|
virtual |
needed to run material callbacks
|
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 |
update function for preparing the instance manager for being drawn called once per view.
|
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 |
Get the max distance for lightpoints.
|
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 |
Overridw the cull distance used in the instance manager.
|
virtual |
Get the distance used if culling override is enabled Set with the slider in the experimental features dialog.
|
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.
| 0 | if 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 | ( | void | ) |
|
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).
|
protected |
Set up a geometry object for instanced rendering.
|
protected |
Compute the distance from an eyepoint to a point.
|
protected |
Update the insances' distance from the eye point.
|
protected |
Update the insances' distance from the eye 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 |
|
protected |
|
protected |
|
protected |
|
protected |
loop over the light point nodes and send down the model view matrix for each instance.
|
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
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
initialize a new instance with it's group that it belongs to
|
protected |
|
protected |
|
friend |
|
friend |
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, osg::Node *)> 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.
|
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 |
Array of per-instance max lightpoint distances squared.
|
protected |
|
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.
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 |
Reference to the camera that most recently was used.
|
protected |
Storage for per-view cull set calculation.
|
protected |
|
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.
Number of UV offsets required by current allocated instances.
|
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 |
Processors run after frustum culling.
|
protected |
Processors run before frustum culling.
|
protected |
|
protected |
|
protected |
|
protected |
Most recent active cull vistor parameters.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |