![]() |
VR-Forces Developer's Guide
|
\ ::,
which allows us to hook into our indirect engine to render using indirect rendering. In the case of features, the

Classes | |
| struct | TotalCounter |
Public Member Functions | |
| virtual void | setName (const std::string &name) override |
| virtual void | setRenderer (DtIndirectGeometryRenderer *drawerNode) |
| virtual void | setRegistrar (DtIndirectGeometryRegistrar *registrar) |
| virtual DtIndirectGeometryRegistrar * | registrar () |
| virtual const char * | className () const |
| virtual void | drawImplementation (osg::RenderInfo &renderInfo) const |
| virtual void | debugDrawImplementation (osg::RenderInfo &renderInfo, const osg::Matrixd &modelViewMatrix) |
| virtual int | addInstance (const DtIndirectGeometryInstance &instance) |
| virtual int | addInstance (int modelId, const osg::Matrixd &xForm, float modelScale, float modelRadius, int lightPointGroupId, bool trackLifeTime, const std::string &trackName, bool defaultVisibility=true) |
| virtual void | accept (osg::NodeVisitor &nv) |
| virtual void | setParent (const osg::Group *parent) |
| virtual void | setRegistrarInvalid (void) |
| virtual void | releaseGLObjects (osg::State *state) const override |
| virtual void | accept (osg::PrimitiveFunctor &functor) const override |
| virtual void | setupIndirectShaders () |
| virtual void | setLocalOriginTransform (const osg::Matrixd &localOriginTransform) |
| virtual const osg::Matrixd & | localOriginTransform () const |
| virtual bool | actuallyAddQueuedUpInstances (bool backgroundThreadLoadWaitForLock=false) |
| virtual void | launchOneTimeInitOp () |
| virtual void | updateGpuBuffers (bool amortizeTextures, size_t &statsObjectsRemaining) |
| virtual void | setFadeParameters (const DtIndirectFadeParameters &fadeParameters) |
| virtual const DtIndirectFadeParameters & | fadeParameters (void) const |
| virtual void | perCameraUpdateAndCull (const osg::Camera *camera, const osg::Matrix &modelViewMatrix, const osg::FrameStamp *frameStamp) |
| virtual void | fillViewParameters (DtIndirectViewParameters &destViewParameters, const osg::Matrix &modelViewMatrix, const osg::Camera *osgCamera) const |
| virtual void | fillAltitude3d (DtIndirectViewParameters &destViewParameters, const Vector3_64 &eye) const |
| virtual bool | readyToRender (const int instanceIdInIndirect) const |
| virtual bool | hasQueuedInstances (void) const |
| virtual bool | allInstancesAreToBeDeleted () const |
| virtual bool | instanceEverAdded (void) const |
| virtual int | numValidInstances (void) const |
| virtual void | setCellId (const Vector3_int &cellId) |
| virtual const Vector3_int & | cellId (void) const |
| virtual const unsigned int | id (void) const |
| virtual void | update (const osg::FrameStamp *frameStamp) |
| virtual void | submitOneTimeOpForFrame () |
| virtual DtIndirectGeometrySubType | subType () const |
| virtual void | setInstanceOtherData0 (int instanceIdIndirect, const Vector4_32 &data) |
| virtual Vector4_32 | instanceOtherData0 (int instanceIdIndirect) const |
| virtual const osg::Geode * | parentGeode (void) const |
| virtual osg::Geode * | parentGeode (void) |
Static Public Member Functions | |
| static int | numIndirectGeometries (void) |
| static void | initializeDtDeKeyedInstances (DtDe &de) |
| static int | numUpdateGpuBuffersRanThisFrame () |
| static void | clearNumUpdateGpuBuffersRanThisFrame () |
| static void | setTrackObjects (bool val) |
| static bool | trackObjects (void) |
Public Attributes | |
| friend | DtIndirectGeometryCreator |
Protected Types | |
| typedef boost::unique_lock < boost::shared_mutex > | InstanceMutexWriteLock |
| typedef boost::shared_lock < boost::shared_mutex > | InstanceMutexReadLock |
| typedef std::unordered_map < int, int > | MapIndirectIdToInstanceContainerId |
Protected Member Functions | |
| DtIndirectGeometry (DtDe &de, const DtCullShaderConfig &cullShaderConfig, const DtIndirectGeometrySubType &geometrySubType, bool managesIndividualInstances) | |
| virtual | ~DtIndirectGeometry () |
| virtual bool | addInstanceActual (const DtIndirectGeometryInstance &instance) |
| virtual void | setupShadersIfNecessary () |
| virtual void | setupDebugUniforms () |
| virtual void | installDefaultMaterial (osg::StateSet *ss) |
| virtual void | slot_reloadShaders () |
| virtual void | updateIndicesCount (const DtIndirectModelInfo &modelInfo, int instanceContainerIndex) |
| virtual void | updateModelIdsToInstances (int modelId, int instanceId, bool add) |
| virtual void | drawFromCommandBuffer (osg::RenderInfo &renderInfo, const DtIndirectViewParameters &viewParameters, const osg::Camera *camera, bool isLightBin, bool isDepthBin, bool isShadowPass, bool viaExternalRenderer) const |
| virtual void | syncViewParametersToGpu (const DtIndirectViewParameters &viewParameters, osg::State *state) const |
| virtual void | updateInstancePositionOrientationAddedActual (const DtIndirectGeometryInstance &instance, int outInstanceIndex) |
| virtual void | updateInstanceSwitchesAddedActual (const DtIndirectGeometryInstance &instance, int outInstanceIndex) |
| virtual void | updateInstanceSequencesAddedActual (const DtIndirectGeometryInstance &instance, int outInstanceIndex) |
| virtual void | updateInstanceUvOffsetsAddedActual (const DtIndirectGeometryInstance &instance, int outInstanceIndex) |
| virtual void | updateInstanceColorAddedActual (const DtIndirectGeometryInstance &instance, int outInstanceIndex) |
| virtual void | updateInstanceOtherData0AddedActual (const DtIndirectGeometryInstance &instance, int outInstanceIndex) |
| virtual void | updateInstanceLightPointGroupIdActual (const DtIndirectGeometryInstance &instance, int outInstanceIndex) |
| virtual void | updateInstanceVisibilityLightPointMaxDistanceActual (const DtIndirectGeometryInstance &instance, int outInstanceIndex) |
| virtual bool | updateInstanceDeletionBeforeAddedActual (const DtIndirectGeometryInstance &instance) |
| virtual void | updateInstancesDofsAddedActual (const DtIndirectGeometryInstance &instance, int outInstanceIndex) |
| virtual void | updateInstanceModelIdAddedActual (const DtIndirectGeometryInstance &instance, int outInstanceIndex) |
| virtual void | reloadShadersIfNecessary (void) const |
| virtual void | adjustDofConstraintsIfNecessary (osgSim::DOFTransform *clone) |
| virtual DtIndirectDrawComponent * | drawComponent (int stateId) const |
| virtual bool | hasLightPoints (void) const |
| virtual bool | hasDepthOnly (void) const |
| virtual bool | isDepthOnly (int stateId) const |
| virtual void | nullOutDrawComponents (void) |
| virtual void | initDrawComponents (void) |
| virtual void | setPureSignalBasedUpdates (bool val) |
| virtual void | initializeUbosIfNecessary (osg::RenderInfo &renderInfo) const |
| virtual void | slot_coordinateSystemChanged () |
| virtual void | trackInstanceLifeTime (int instanceIdInIndirectGeometry, bool trackLifeTime, const std::string &trackName) |
| virtual std::pair< bool, std::string > | trackInfo (int instanceIdInIndirectGeometry) const |
| virtual void | drawImplementation (osg::RenderInfo &renderInfo, const osg::Matrixd &modelViewMatrix, bool isLightBin, bool isDepthBin, bool isShadowPass) const |
| virtual bool | isTerrainPatch (const DtIndirectGeometrySubType &geometrySubType) const |
| virtual bool | disableExternalRenderForSensorFx (const osg::Camera *camera) const |
| virtual bool | useExternalRenderer (const osg::Camera *camera) const |
| virtual std::string | modelName (int instanceId) const |
| virtual void | registerUpdateComponent () |
| virtual DtIndirectDrawComponent * | component (int component) |
Static Protected Attributes | |
| static bool | theTrackObjects |
| static TotalCounter | theTotalCounter |
| static int | theNumUpdateGpuBuffersRanThisFrame |
Private Member Functions | |
| DtIndirectGeometry ()=delete | |
| DtIndirectGeometry (const DtIndirectGeometry &other)=delete | |
| DtIndirectGeometry & | operator= (const DtIndirectGeometry &other)=delete |
Friends | |
| class | DtIndirectGeometryRenderer |
| class | DtIndirectGeometryRendererUserData |
|
protected |
|
protected |
|
protected |
Map of instances' id in indirect geometry to their id in the instance container.
|
protected |
purposely protected. only creator can create
| terrainPatch | : whether a terrain patch |
| managesIndividualInstances | : only true for entities |
|
protectedvirtual |
purposely protected
|
privatedelete |
not allowed
|
privatedelete |
Copy Constructor not implemented – Copy Not Allowed.
|
privatedelete |
Assignment Operator Not implemented – Assignment Not Allowed.
|
overridevirtual |
set the name for the base class, the culling
|
virtual |
set external renderer (see DtIndirectGeometryRenderer)
|
virtual |
set the registrar
| registrar | The indirect geometry registrar which will contain the 'specs' corresponding to models whose instances this DtIndirectGeometry rendered This is purposely separated out from DtIndirectGeometry, because several DtIndirectGeometry'ies may share the same models (for example cdb gt layers), in which case all DtIndirectGeometry'ies share the same registrar or use the 1 registrar per tile (as is the case with cdb gs layers) in which case one registrar is made per geometry(tile) |
|
virtual |
provide access to this indirect geometries indirect registrar
|
virtual |
get the classes name in a char pointer. Used by OSG to identify objects of this class
|
virtual |
inherited from osg::drawable will do the culling/lod'ing of the instances (via compute shaders) , and subsequent rendering of the instances
|
virtual |
called when debug indirect culling is active do debug drawing of bounding boxes of all geometries within each instance
|
virtual |
Add an 'instance' of a model which has lod, transform, switch and node path information used by vrvOsg to add instances from: -paging databases and terrain patches -osgEarth features returns the instance id in the indirect geometry for the added instance.
|
virtual |
Add a simple instance of a model which only has lod and transform information used by vrvOsg to add instances from: -entity indirect path instances -CDB instances returns the instance id in the indirect geometry for the added instance.
|
virtual |
set/get the otherdata0 for a particular instance.
|
virtual |
set/get the otherdata0 for a particular instance.
|
virtual |
overridden: because we do certain processing (state set modification, etc) that needs to happen outside of the draw pass. So, we check for and do this in the cull visitor pass
|
virtual |
Typically a feature tile node/cdb group node.
|
virtual |
Indicate to us that our registrar is now invalid registrars are externally held, and the DtIndirectGeometry needs to know this because it may be deleted much after the registrar has been deleted, and possibly internally to osg.
|
overridevirtual |
release all gl objects used by this indirect geometry
|
overridevirtual |
override of Drawable function which allows the osg Statistics to work for Indirect Geometry
|
virtual |
Makes sure Indirect Geometry is ready to go, can be called from multiple threads (e.g. cdb) -draw components' effect textures' state is setup correctly -debug uniforms are set up correctly.
|
virtual |
internal. Access the parent geode for this indirect geometry
|
virtual |
internal. Access the parent geode for this indirect geometry
|
virtual |
set the matrix used to adjust the local origin of this indirect geometry this is used to fix precision issue that arise from having large numbers in the vertex buffers or in the instance transforms
|
virtual |
get the matrix used to adjust the local origin of this indirect geometry this is used to fix precision issue that arise from having large numbers in the vertex buffers or in the instance transforms
|
virtual |
adds all instances that have been queued up by calling addInstanceActual with them as the parameter
|
virtual |
finish initialization of geometry
|
virtual |
update gpu buffers
| statsObjectsRemaining | - (statistics computed value returned) the number of objects remaining to process |
|
virtual |
set the fade parameters
|
virtual |
set the fade parameters
|
virtual |
update any per camera data that is needed and then run the cull compute shader for this camera
|
virtual |
calculate and fill the destination view parameters based on the model view, camera, and renderInfo
|
virtual |
This is used for ocean polygons' rejection It matches the altitude3d computation for the cull visitor It only is set if the indirect geometry has ocean polygons (this can be queried by seeing its value from the cull config)
|
virtual |
can the instance be rendered this frame?
|
virtual |
Does myQueueInstancesToAdd have any entries? Not thread safe - returns myQueueInstancesToAdd.unsafe_size()
|
virtual |
Overridden by DtIndirectEntityGeometry.
Reimplemented in makVrv::DtIndirectEntityGeometry.
|
virtual |
was an instance ever added? not the same as numInstances() (implemented as pass through to the internal instance container)
|
virtual |
the number of (valid) instances (implemented as pass through to the internal instance container)
|
virtual |
Set a cell id This is used internally if indirect geometry is DtIndirectEntityGeometry Else, it is 0,0,0.
|
virtual |
get a cell id This is used internally if indirect geometry is DtIndirectEntityGeometry Else, it is 0,0,0
|
virtual |
called from the DtIndirectGeometryUpdateSystem to run update on managers that need to run during the update traversal. warning: this can be called async The dof manager needs to update so that the dof transforms are updated in time for the post update to update the observer if it is attached to a part.
|
static |
debug log level output is provided when objects construct/deleted
|
static |
debug log level output is provided when objects construct/deleted
|
static |
total currently
|
static |
DtIndirectGeometry has a bunch of components that are references (creators, higher level managers, etc) These are keyed on DtDe and hence call ::instance of those. These implementations are not thread safe. They call findInstance and then registerInstance (if instance was not found) with no higher up locking guarding both functions. When a bunch of DtIndirectGeometries are made from multiple threads, the call to ::instance to any one of these can cause thread safety issues. So, call this function, once from outside (e.g. DtOsgRenderer::postInitialize), so all these are initialized properly and subsequent calls inside ::instance always hit only DtDe.findInstance and return the pointer in question. This was found recently in cdb for a particular database. It's only happenstance that we did not run into this before.
|
static |
used by auto tests to determine if any ran this frame
|
static |
used by auto tests to determine if any ran this frame needs to be called per tick/frame at the start of the frame
|
virtual |
Submits a one time operation to the gpu arena that will run prior to cull. The operation performs updates to feed/sync staging data to gpu buffers.
|
virtual |
Get the subtype of this indirect geometry.
|
protectedvirtual |
actually add the instances that were queued up via possibly multiple threads this happens as part of the culling call
|
protectedvirtual |
to initialize the shader files cache, because DtIndirectGeometry doesn't have direct access to DtDe yet (it could; but that would break the cdb plugin) lock myInternalsMutex before calling
|
protectedvirtual |
setup the uniforms needed to visualize debug information for indirect geometry lock myInternalsMutex before calling
|
protectedvirtual |
install a default material on ourselves, so that there's no state leakage with regards ubos/osg::material because we are using materials encoded into an ssbo for indirect rendering
|
protectedvirtual |
slot for handling when the shaders are reloaded
|
protectedvirtual |
internal method to update num of triangles that this geometry will render in the worst case (all lods across all models across all instances)
|
protectedvirtual |
increment the number of instance for the model id (called internally when an instance is added)
|
protectedvirtual |
setup and draw a command buffer
|
protectedvirtual |
ensures the given view paramters are synced to the shader ubo.
|
protectedvirtual |
added actual functions are called when the instance is added to update the state that has been already set for that instance and pass it down to the managers.
update an instances position and orientation
Reimplemented in makVrv::DtIndirectEntityGeometry.
|
protectedvirtual |
update an instance's switches
Reimplemented in makVrv::DtIndirectEntityGeometry.
|
protectedvirtual |
update an instance's sequences
Reimplemented in makVrv::DtIndirectEntityGeometry.
|
protectedvirtual |
set all the uv offsets that have been saved off from before the instance was added.
Reimplemented in makVrv::DtIndirectEntityGeometry.
|
protectedvirtual |
set color that has been saved off before the instance was added
Reimplemented in makVrv::DtIndirectEntityGeometry.
|
protectedvirtual |
set otherdata0 that has been saved off before the instance was added
|
protectedvirtual |
set light point group id that has been saved off before the instance was added
Reimplemented in makVrv::DtIndirectEntityGeometry.
|
protectedvirtual |
set visibility, light point max distance and other data 1 that has been saved off before the instance was added
Reimplemented in makVrv::DtIndirectEntityGeometry.
|
protectedvirtual |
check to see if this instance was marked for deletion before it was added
Reimplemented in makVrv::DtIndirectEntityGeometry.
|
protectedvirtual |
update an instance's dofs states
Reimplemented in makVrv::DtIndirectEntityGeometry.
|
protectedvirtual |
set model id that has been saved off before the instance was added
Reimplemented in makVrv::DtIndirectEntityGeometry.
|
protectedvirtual |
reload the shaders if necessary (marks a flag and they are reloaded before the next draw.
|
protectedvirtual |
adjust dof constraints, if needed
|
protectedvirtual |
get the indirect draw component for a particular state
|
protectedvirtual |
similar to the drawComponent above, but checks for the existence of GL_POINTS (light points) primitives
|
protectedvirtual |
whether has depth only components
whether is depth only
|
protectedvirtual |
delete the draw components
|
protectedvirtual |
initialize the draw components
|
protectedvirtual |
indicate whether this manager's switches get updated per frame via looking at the actual switches/multi-switches or directly using signals This is only true for entities
|
protectedvirtual |
init the ubo if necessary
|
protectedvirtual |
slot for when the coordinate system changes
|
protectedvirtual |
whether to track instance lifetime (for debugging)
|
protectedvirtual |
whether to track instance lifetime (for debugging)
|
protectedvirtual |
internal
|
protectedvirtual |
whether is terrain patch
|
protectedvirtual |
disable external renderer for IGT_TERRAIN_CONTENT_OSGEARTH_LAYER types, if in non-visual mode disable sensor fx for map node indirected content see: https://jira.mak.com/browse/VRV-4519
|
protectedvirtual |
whether to use external renderer. will see if renderer is set, and whether settings say so, and the result of the check disableExternalRenderForSensorFx
|
protectedvirtual |
model name for an instance id in the indirect geometry
|
protectedvirtual |
Registers the update component with the update system. The system will provide updates to this node: it will call call update()
|
protectedvirtual |
0 means regular, 1 means light
|
friend |
|
friend |
| friend makVrv::DtIndirectGeometry::DtIndirectGeometryCreator |
|
protected |
pointer to the (external) registrar
|
protected |
addInstance may be called from multiple threads. Hence, concurrent queue
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
the accumulated effect textures' state which represents the superset of all effect textures cumulatively used by the models of the instances of this Indirect geometry
|
protected |
|
protected |
|
protected |
number of indices across all unique models across instances
|
protected |
This is de-referenced here for speed.
|
protected |
container for all the instances registered here
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
FIXME should be a static but currently the cull shader is per indirect.
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
Internal variable that tracks whether the output instance buffers via the culling got changed (resized, gpu address changed, etc). This indicates whether the vao needs to be re-generated.
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
local clone of the system wide coordinate system. for thread safety.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
The frame number when the one time op was processed Only used when multiple one time ops are required for buffer updates across frames.
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
Maps an instance id to the other data0 for that instance.
|
protected |
|
staticprotected |