25 #include <boost/signals2.hpp>
27 #include <osg/Drawable>
28 #include <osg/Uniform>
29 #include <osg/OperationThread>
31 #include <boost/unordered_map.hpp>
32 #include <tbb/atomic.h>
33 #include <tbb/concurrent_queue.h>
37 #define INDIRECTGEOMETRY_CONSTRUCT_DESTRUCT_DEBUG 0
51 class DtIndirectGeometryRegistrar;
52 class DtCullShaderConfig;
53 class DtGpuCullingAndLod;
55 class DtOsgShaderFilesCache;
56 class DtTerrainPatchObjectManager;
57 class DtOsgCullVisitor;
58 class DtIndirectGeometryInitMainThreadJob;
59 class DtIndirectGeometryUpdateBuffersMainThreadJob;
60 class DtGLDeleteObjectManager;
88 virtual void setName(
const std::string& name);
106 virtual const char* className()
const;
111 virtual void drawImplementation(osg::RenderInfo& renderInfo)
const;
114 virtual unsigned int rebuildRegistrar(osg::RenderInfo& renderInfo)
const;
122 virtual void addInstance(
int modelId,
const osg::Matrixd& xForm);
125 virtual void removeAllInstances(
void);
130 virtual void accept(osg::NodeVisitor& nv);
133 virtual void setParent(
const osg::Group* parent);
138 virtual void setDebugDrawString(
const std::string& drawString);
145 virtual void setRegistrarInvalid(
void);
148 virtual void releaseGLObjects(osg::State* state)
const;
151 virtual void accept(osg::PrimitiveFunctor& functor)
const;
154 void setupIndirect(
DtDe &de);
158 virtual const osg::Geode* parentGeode(
void)
const;
159 virtual osg::Geode* parentGeode(
void);
165 virtual void setLocalOriginTransform(
const osg::Matrixd& localOriginTransform);
170 virtual osg::Matrixd& localOriginTransform();
173 virtual bool actuallyAddQueuedUpInstances(
void);
179 virtual boost::condition_variable & waitCondition();
182 virtual void updateGpuInstanceBuffers(osg::RenderInfo& renderInfo);
197 virtual GLuint getOrCreateAndRecordVAO(osg::State* state)
const;
198 virtual void recordVAO(
GLuint vao)
const;
204 virtual void setupShadersIfNecessary(
DtDe& de);
208 virtual void setupDebugUniforms(
DtDe& de);
212 const std::string& shaderFolderPath, osg::StateSet* ss,
DtDe& de)
const;
216 virtual void installDefaultMaterial(osg::StateSet* ss);
219 virtual void slot_reloadShaders();
228 virtual void createCullingAndLodIfNecessary(
DtDe& de);
232 virtual void createManagersIfNecessary(
DtDe& de);
234 virtual void drawFromCommandBuffer(osg::RenderInfo& renderInfo)
const;
237 virtual void reloadShadersIfNecessary(
void)
const;
242 static osgEarth::VirtualProgram * findCachedVirtualProgram(
const std::string& vp_hash);
243 static void cacheVirtualProgram(
const std::string& vp_hash, osgEarth::VirtualProgram* virtualProgram);
244 static void clearVirtualProgramCache();
285 #if INDIRECTGEOMETRY_CONSTRUCT_DESTRUCT_DEBUG
286 static tbb::atomic<int> myRefCount;
349 static const std::string& theClassName();
boost::signals2::connection myConnection
Definition: DtIndirectGeometry.h:270
boost::condition_variable myWaitCondition
Definition: DtIndirectGeometry.h:309
Contains the DtCullShaderConfig class declaration.
DtCullShaderConfig myCullShaderConfig
Definition: DtIndirectGeometry.h:300
std::map< std::string, VirtualProgramRef > StringVpMap
Definition: DtIndirectGeometry.h:313
DtIndirectFadeParameters myFadeParameters
Definition: DtIndirectGeometry.h:321
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:125
Virtual base class.
Definition: DtVirtualBaseClass.h:22
non virtual container class for holding the information needed to create an indirect geometry instanc...
Definition: DtIndirectGeometryInstance.h:25
struct for holding the fade parameters used by the indirect rendering cull compute shader ...
Definition: DtGpuCullingAndLodDefines.h:21
Manager that provides direct access to the terrain patch objects in use in a display engine also hand...
Definition: DtTerrainPatchObjectManager.h:38
DtInstanceContainer myMutableInstanceContainer
container for all the instances registered here
Definition: DtIndirectGeometry.h:292
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
handles the switches for all the indirect geometry.
Definition: DtIndirectSwitchManager.h:52
DtTerrainPatchObjectManager * myTerrainPatchObjectManager
Definition: DtIndirectGeometry.h:281
unsigned int myMutableLastFrameRebuilt
Definition: DtIndirectGeometry.h:294
creator for DtIndirectGeometry
Definition: DtIndirectGeometry.h:325
bool myLastMissingTextureColorOn
Definition: DtIndirectGeometry.h:279
Indirect geometry can have multiple models and their corresponding ids registered in it...
Definition: DtIndirectGeometryRegistrar.h:101
DtGlVaoManager * myVaoManager
Definition: DtIndirectGeometry.h:283
osg::Matrixd myLocalOriginTransformMatrix
Definition: DtIndirectGeometry.h:272
bool myIsTerrainPatch
Definition: DtIndirectGeometry.h:261
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:17
shader configuration storage class.
Definition: DtCullShaderConfig.h:19
Definition: DtOsgShaderFilesCache.h:22
std::map< int, int > MapIntToInt
Definition: DtCommonTypes.h:25
osg::ref_ptr< DtIndirectGeometryUpdateBuffersMainThreadJob > myMainThreadUpdateBuffersJob
Definition: DtIndirectGeometry.h:319
handles the lods for all the indirect geometry.
Definition: DtIndirectLodManager.h:79
osg::ref_ptr< DtIndirectGeometryRegistrar > myRegistrar
pointer to the (external) registrar
Definition: DtIndirectGeometry.h:250
osg::ref_ptr< osgEarth::VirtualProgram > VirtualProgramRef
Definition: DtIndirectGeometry.h:312
osg::ref_ptr< DtIndirectGeometryInitMainThreadJob > myMainThreadInitJob
Definition: DtIndirectGeometry.h:318
bool myReloadSlotConnected
Definition: DtIndirectGeometry.h:269
DtIndirectSwitchManager * myMutableSwitchManager
Definition: DtIndirectGeometry.h:297
DtIndirectGeometryInstance.
Contains makVrv::DtVirtualBaseClass class.
This class inherits from osg::Drawable, which allows us to hook into our indirect engine to render us...
Definition: DtIndirectGeometry.h:69
MapIntToInt myModelIDsToInstances
Definition: DtIndirectGeometry.h:257
contains the Per Model info which DtAggregatedGeometry needs It is owned by the Indirect geometry reg...
Definition: DtAggregatedGeometry.h:47
DtIndirectLodManager * myMutableLodManager
Definition: DtIndirectGeometry.h:299
bool myLastDebugIndirectColorOn
Definition: DtIndirectGeometry.h:278
boost::mutex myInternalsMutex
Definition: DtIndirectGeometry.h:316
DtIndirectRenderingParameters myMutableIrParams
Definition: DtIndirectGeometry.h:289
Class per frame that must be passed to the DtICullingAndLOD It indicates what would have changed (ins...
Definition: DtGpuCullingAndLodDefines.h:94
Declarations for classes used in DtICullingAndLOD.
Contains makVrv::DtIndirectSwitchManager class.
int myNumIndicesAcrossAllModels
number of indices across all unique models across instances
Definition: DtIndirectGeometry.h:276
responsible for initializing the indirect buffers in the main thread
Definition: DtIndirectGeometryInitMainThreadJob.h:30
tbb::concurrent_queue< DtIndirectGeometryInstance > myQueueInstancesToAdd
addInstance may be called from multiple threads. Hence, concurrent queue
Definition: DtIndirectGeometry.h:253
bool myMutableShadersSetup
Definition: DtIndirectGeometry.h:302
DtDe & myDe
Definition: DtIndirectGeometry.h:351
This class is used to manage an opengl vertex array object (VAO) dealing with multiple opengl context...
Definition: DtGlVaoManager.h:49
Contains makVrv::DtIndirectLodManager class.
unsigned int myMutableLastFrameTexturesUpdated
Definition: DtIndirectGeometry.h:295
Contains DLL export macros.
bool myMutableShouldReloadShaders
FIXME should be a static but currently the cull shader is per indirect.
Definition: DtIndirectGeometry.h:307
DtIndirectEffectTexturesTemplate myEffectTexturesState
the accumulated effect textures' state which represents the superset of all effect textures cumulativ...
Definition: DtIndirectGeometry.h:267
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Helper class to manage instances This class allows you to add a DtInstance_64 Internally, however it stores this as a DtInstance (which the GPU can directly read)
Definition: DtInstanceContainer.h:27
std::string myDrawString
Definition: DtIndirectGeometry.h:259
boost::mutex myWaitMutex
Definition: DtIndirectGeometry.h:310
DtGpuCullingAndLod * myCullingAndLOD
Definition: DtIndirectGeometry.h:255
Contains the DtGlVaoManager class declaration.
Contains the DtIndirectGeometryRegistrar class declaration.
Contains makVrv::DtInstanceContainer.
Class that allows you to abstractly register effect texture types the effect texture types are client...
Definition: DtIndirectEffectTexturesTemplate.h:38
static StringVpMap theVirtualProgramMap
Definition: DtIndirectGeometry.h:314
This class is a component of the DtIndirectGeometry It inputs are: -> the instances registered with Dt...
Definition: DtGpuCullingAndLod.h:50