![]() |
VR-Forces 4.6 Class Documentation
|
Indirect geometry can have multiple models and their corresponding ids registered in it, via multiple threads. More...
Classes | |
| struct | RebuildResult |
| Structure for exactly what changed when the indirect geometry got rebuild. More... | |
| class | RegisterModelLodOp |
Public Types | |
| typedef boost::signal< void(const RebuildResult &result) > | RebuildSignal |
| Signal interested parties that our geometries/textures changed. The listeners are typically DtIndirectGeometry'ies. | |
Public Member Functions | |
| DtIndirectGeometryRegistrar (const DtIndirectTextureCollectionPolicy &textureCollectionPolicy) | |
| CTOR. | |
| virtual | ~DtIndirectGeometryRegistrar () |
| DTOR. | |
| virtual void | queueUpRegisterModelLod (int modelId, int lodId, const DtLodInfo &lodInfo, osg::ref_ptr< const osg::Node > model, const std::string &modelFileName) |
| virtual void | rebuildIfNeeded (unsigned int contextID) |
| invoked via the main thread by one (or multiple indirect geometries) | |
| virtual int | numModels (void) const |
| number of models registered here | |
| virtual int | modelId (int index) const |
| the actual model id of the model with index | |
| virtual const VectorGeometryLocations & | getVectorGeometryLocations (int modelId) const |
| vector of the 'specs' for the model | |
| virtual bool | hasVectorGeometryLocations (int modelId) const |
| This being true indicates that the model with id modelId was in fact registered here. | |
| virtual const VectorMaterials & | getVectorMaterials (int modelId) const |
| get the materials for modelId | |
| virtual const VectorOsgTextures & | getVectorOsgTextures (const int modelId) const |
| vector of osg textures encountered within the model | |
| virtual const DtIndirectTextureCollectionPolicy & | textureCollectionPolicy (void) const |
| Access the texture collection policy. | |
| virtual DtIndirectTextureProcessor & | textureProcessor () |
| Access the texture processor. | |
| virtual void | releaseGLObjects (osg::State *state) const |
| virtual void | bindBuffers () |
| Used internally by DtIndirectGeometry to bind the Vertex/Index/Texture Buffers corresponding to the registrar. | |
| virtual void | unbindBuffers () |
Static Public Member Functions | |
| static osgEarth::VirtualProgram * | findCachedVirtualProgram (const std::string &vp_hash) |
| quick caching of virtual programs to avoid parsing them constantly | |
| static void | cacheVirtualProgram (const std::string &vp_hash, osgEarth::VirtualProgram *virtualProgram) |
Public Attributes | |
| RebuildSignal | mySignalRebuild |
| DtIndirectGeometry'ies connect to this signal so that they can update their own internal book-keeping when the models/textures come in/change. | |
Protected Types | |
| typedef tbb::concurrent_queue < RegisterModelLodOp > | QueueRegisterModelLodOps |
| typedef osg::ref_ptr < osgEarth::VirtualProgram > | VirtualProgramRef |
| typedef std::map< std::string, VirtualProgramRef > | StringVpMap |
Protected Member Functions | |
| virtual void | registerModelLod (int modelId, int lodId, const DtLodInfo &lodInfo, osg::ref_ptr< const osg::Node > model, const std::string &modelFileName, VectorOsgTextures &newTexturesFound) |
| actually register it in the main thread called from rebuildIfNeeded, which is in turn called from main thread | |
| virtual void | deleteGpuData () const |
| delete the buffers that are on the GPU (the ones above) | |
| virtual bool | allTexturesReady (const int modelId, unsigned int contextID) const |
| Textures are not loaded directly, but indirectly (and possibly incrementally) by osg. | |
| virtual void | bindVAO () |
| VAO helps us to bind all the buffers above using a single draw call. | |
| virtual void | unbindVAO () |
Static Protected Attributes | |
| static StringVpMap | s_VirtualProgramMap |
Private Member Functions | |
| DtIndirectGeometryRegistrar () | |
| unimplemented default ctor | |
Indirect geometry can have multiple models and their corresponding ids registered in it, via multiple threads.
When this happens, the geometry specs/bindless textures need to be updated/maintained in a form that DtIndirectGeometry can use and consume to further upload pertinent information to the GPU. This class manages the registration and the rebuild of the interim GPU data needed The registrar rebuild can be triggered by one (or more) DtIndirectGeometry'ies (when they get drawn). This is done when they are drawn because a context is present at that point (because we are generating GPU data here). This structure below indicates to the listeners of the IndirectGeoRegistrarRebuildResultSignal what exactly change The listeners themselves are typically also the other DtIndirectGeometry'ies which then update their respective gpu data, based on the interim data generated here The general use case of a 'registrar' is that the DtIndirectGeometryLayerManager creates a single registrar for a layer. This enables several DtIndirectGeometry instances within the layer to efficiently share the same registrar (and hence share the models/textures) CDB is a slightly different use case. In the case of Geo Typical layers, the use case is the same as the general use case. In the case of Geo Specific layers, it merits a single indirect geometry to be associated with a single registrar. This is wholly on account of the nature of the CDB data base itself Generally speaking, geospecific tiles (and hence indirect rendering geometries), hardly ever share models/textures, so creating a common registrar per layer is hugely wasteful as well as slow (given how IndirectRendering works). So one is created per tile/indirect geometry and this mapping maintained by the cdb pager Indirect Rendering works best when multiple models can be combined into a single Vertex Buffer, Index Buffer and the textures are in an array of bindless texture addresses. This allows us to fold what would be multiple binds of vertex buffers, index buffers & texture binds per instance, per model into a single indirect draw call for a tile The registrar allows us to register such models that the instances within the DtIndirectGeometry contain We have generalized the concept of a 'model' for this purpose. A 'model' is a top level node (coming from say reading an flt file) An lod is of a model is also a top level node (coming from say reading an flt file) For example, f the original file has 3 lods, then we need to 3 lods of that single model with the top level nodes for those 3 lods Several such models can be registered here
| typedef boost::signal< void(const RebuildResult& result) > makVrv::DtIndirectGeometryRegistrar::RebuildSignal |
Signal interested parties that our geometries/textures changed. The listeners are typically DtIndirectGeometry'ies.
|
protected |
|
protected |
|
protected |
| makVrv::DtIndirectGeometryRegistrar::DtIndirectGeometryRegistrar | ( | const DtIndirectTextureCollectionPolicy & | textureCollectionPolicy | ) |
CTOR.
|
virtual |
DTOR.
|
private |
unimplemented default ctor
|
virtual |
invoked via the main thread by one (or multiple indirect geometries)
|
virtual |
number of models registered here
the actual model id of the model with index
|
virtual |
vector of the 'specs' for the model
|
virtual |
This being true indicates that the model with id modelId was in fact registered here.
|
virtual |
get the materials for modelId
|
virtual |
vector of osg textures encountered within the model
|
virtual |
Used internally by DtIndirectGeometry to bind the Vertex/Index/Texture Buffers corresponding to the registrar.
The DtIndirectGeometry needs this for rendering because its instances refer to (a subset) of the models registered here
|
virtual |
|
virtual |
Access the texture collection policy.
|
virtual |
Access the texture processor.
|
virtual |
|
static |
quick caching of virtual programs to avoid parsing them constantly
|
static |
|
protectedvirtual |
actually register it in the main thread called from rebuildIfNeeded, which is in turn called from main thread
|
protectedvirtual |
delete the buffers that are on the GPU (the ones above)
|
protectedvirtual |
VAO helps us to bind all the buffers above using a single draw call.
|
protectedvirtual |
|
protectedvirtual |
Textures are not loaded directly, but indirectly (and possibly incrementally) by osg.
This call indicates whether all of them for a given model/context have in fact been correctly loaded for a given model id
| RebuildSignal makVrv::DtIndirectGeometryRegistrar::mySignalRebuild |
DtIndirectGeometry'ies connect to this signal so that they can update their own internal book-keeping when the models/textures come in/change.
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |