This class inherits from osg::Drawable, which allows us to hook into our indirect engine to render using indirect rendering.
More...
Public Member Functions |
| | DtIndirectGeometry (DtIndirectGeometryRegistrar *registrar, bool viewFrustumCulling, bool lodChecking, bool useInstanceCount) |
| | CTOR.
|
| virtual void | drawImplementation (osg::RenderInfo &renderInfo) const |
| | inherited from osg::drawable will do the culling/lod'ing of the instances (via compute shaders) , and subsequent rendering of the instances
|
| virtual void | addInstance (const DtInstance_64 &instance) |
| | Add an 'instance' of a model.
|
| virtual void | removeAllInstances (void) |
| | Remove all the instances.
|
| virtual void | accept (osg::NodeVisitor &nv) |
| | overridden: because we do certain processing (state set modification, etc) that needs to happen outside of the draw pass.
|
| virtual void | setParent (const osg::Group *parent) |
| | Typically a feature tile node/cdb group node.
|
| virtual void | setDebugDrawString (const std::string &drawString) |
| | Arbitrary string to 'tag' this geometry will print out this string if the drawImplemention is called and debugging is enabled.
|
| virtual void | setRegistrarInvalid (void) |
| | 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.
|
| virtual void | releaseGLObjects (osg::State *state) const |
Protected Member Functions |
| | DtIndirectGeometry () |
| | purposely protected. disallow creation, without a registrar
|
| virtual | ~DtIndirectGeometry () |
| | purposely protected
|
| virtual void | addInstanceActual (const DtInstance_64 &instance) |
| | actually add the instances that were queued up via possibly multiple threads this happens as part of the drawImplementation call (before the culling and subsequent drawing)
|
| virtual bool | actuallyAddQueuedUpInstances (void) |
| virtual void | setVisibility (bool visibility) |
| | visibility
|
| virtual GLuint | getOrCreateAndRecordVAO (const osg::RenderInfo &renderInfo) const |
| | internal methods to create and 'record' a vertex array object (VAO) using VAO enables us to combine multiple buffer binds into a single 'command' via 'recording' the VAO
|
| virtual void | clearVAO (const osg::RenderInfo &renderInfo) |
| virtual void | recordVAO (GLuint vao) const |
| virtual void | slot_rebuild (const DtIndirectGeometryRegistrar::RebuildResult &result) |
| | the slot for when the registrar rebuilt its internal structures because we need to accordingly update the instances and/or model specs for these instances
|
| virtual void | setUpShadersIfNecessary (osgUtil::CullVisitor *cullVisitor) |
| | 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)
|
| virtual void | installIndirectRenderingProgram (DtOsgShaderFilesCache *shaderFilesCache, const std::string &shaderFolderPath, osg::StateSet *ss) const |
| | install the shaders needed to render using indirect rendering
|
| virtual void | installDefaultMaterial (osg::StateSet *ss) |
| | 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
|
Detailed Description
This class inherits from osg::Drawable, which allows us to hook into our indirect engine to render using indirect rendering.
Typically, the DtIndirectGeometry is parented to the feature tile nodes and manages the indirect rendering of all the feature points in that tile
Member Typedef Documentation
Member Enumeration Documentation
- Enumerator:
| CullFaceOnState |
|
| CullFaceOffState |
|
| NumStates |
|
Constructor & Destructor Documentation
CTOR.
- Parameters
-
| 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) |
| viewFrustumCulling | determines whether the internal cull shader will do the view frustum culling |
| lodChecking | determines whether whether the internal cull shader will do the lod checking |
| useInstanceCount | adjusts whether the cull shader will optimize for (mostly) unique models across instances (as is the case with cdb gs instances for example), in which case set the useInstanceCount = false or (mostly) shared models, in which case set the useInstanceCount = true |
Remarks: Its still (probably) faster to run the cull shader, so that it may quickly generate the indirect command buffer by redistributing the (possibly) out of order instances in a fast, parallelized fashion , than to use the cpu to do this
| makVrv::DtIndirectGeometry::DtIndirectGeometry |
( |
| ) |
|
|
protected |
purposely protected. disallow creation, without a registrar
| virtual makVrv::DtIndirectGeometry::~DtIndirectGeometry |
( |
| ) |
|
|
protectedvirtual |
Member Function Documentation
| virtual void makVrv::DtIndirectGeometry::drawImplementation |
( |
osg::RenderInfo & |
renderInfo | ) |
const |
|
virtual |
inherited from osg::drawable will do the culling/lod'ing of the instances (via compute shaders) , and subsequent rendering of the instances
| virtual void makVrv::DtIndirectGeometry::addInstance |
( |
const DtInstance_64 & |
instance | ) |
|
|
virtual |
Add an 'instance' of a model.
| virtual void makVrv::DtIndirectGeometry::removeAllInstances |
( |
void |
| ) |
|
|
virtual |
Remove all the instances.
| virtual void makVrv::DtIndirectGeometry::accept |
( |
osg::NodeVisitor & |
nv | ) |
|
|
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 void makVrv::DtIndirectGeometry::setParent |
( |
const osg::Group * |
parent | ) |
|
|
virtual |
Typically a feature tile node/cdb group node.
| virtual void makVrv::DtIndirectGeometry::setDebugDrawString |
( |
const std::string & |
drawString | ) |
|
|
virtual |
Arbitrary string to 'tag' this geometry will print out this string if the drawImplemention is called and debugging is enabled.
| virtual void makVrv::DtIndirectGeometry::setRegistrarInvalid |
( |
void |
| ) |
|
|
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.
| virtual void makVrv::DtIndirectGeometry::releaseGLObjects |
( |
osg::State * |
state | ) |
const |
|
virtual |
| virtual void makVrv::DtIndirectGeometry::addInstanceActual |
( |
const DtInstance_64 & |
instance | ) |
|
|
protectedvirtual |
actually add the instances that were queued up via possibly multiple threads this happens as part of the drawImplementation call (before the culling and subsequent drawing)
| virtual bool makVrv::DtIndirectGeometry::actuallyAddQueuedUpInstances |
( |
void |
| ) |
|
|
protectedvirtual |
| virtual void makVrv::DtIndirectGeometry::setVisibility |
( |
bool |
visibility | ) |
|
|
protectedvirtual |
| virtual GLuint makVrv::DtIndirectGeometry::getOrCreateAndRecordVAO |
( |
const osg::RenderInfo & |
renderInfo | ) |
const |
|
protectedvirtual |
internal methods to create and 'record' a vertex array object (VAO) using VAO enables us to combine multiple buffer binds into a single 'command' via 'recording' the VAO
| virtual void makVrv::DtIndirectGeometry::clearVAO |
( |
const osg::RenderInfo & |
renderInfo | ) |
|
|
protectedvirtual |
| virtual void makVrv::DtIndirectGeometry::recordVAO |
( |
GLuint |
vao | ) |
const |
|
protectedvirtual |
the slot for when the registrar rebuilt its internal structures because we need to accordingly update the instances and/or model specs for these instances
| virtual void makVrv::DtIndirectGeometry::setUpShadersIfNecessary |
( |
osgUtil::CullVisitor * |
cullVisitor | ) |
|
|
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)
| virtual void makVrv::DtIndirectGeometry::installIndirectRenderingProgram |
( |
DtOsgShaderFilesCache * |
shaderFilesCache, |
|
|
const std::string & |
shaderFolderPath, |
|
|
osg::StateSet * |
ss |
|
) |
| const |
|
protectedvirtual |
install the shaders needed to render using indirect rendering
| virtual void makVrv::DtIndirectGeometry::installDefaultMaterial |
( |
osg::StateSet * |
ss | ) |
|
|
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
Member Data Documentation
pointer to the (external) registrar
container for all the instances registered here
| tbb::concurrent_queue<DtInstance_64> makVrv::DtIndirectGeometry::myQueueInstancesToAdd |
|
protected |
addInstance may be called from multiple threads. Hence, concurrent queue
| MapIntToInt makVrv::DtIndirectGeometry::myModelIDsToInstances |
|
protected |
| osg::ref_ptr<osg::Uniform> makVrv::DtIndirectGeometry::myViewMatrix |
|
protected |
| osg::ref_ptr<osg::Uniform> makVrv::DtIndirectGeometry::myProjectionMatrix |
|
protected |
| std::string makVrv::DtIndirectGeometry::myDrawString |
|
protected |
| bool makVrv::DtIndirectGeometry::myMutableShadersSetup |
|
mutableprotected |
The documentation for this class was generated from the following file:
- /exports/nfedora7-1/nightly/docs/vrforcesDevelopment.vrf4-6-branch/include/vrvOsg/DtIndirectGeometry.h