![]() |
VR-Forces 4.8 Class Documentation
|
This class is a component of the DtIndirectGeometry It inputs are: -> the instances registered with DtIndirectGeometry -> the viewing parameters (view matrix, projection matrix, etc) -> the indirect registrar (so that it can generate gpu data for -> the models of the instances from the interim data accessible -> via the registrar It outputs are: -> Tndirect command buffer -> The count of the indirect commands -> The input instances shuffled around/culled/lod'ed reflecting -> their order within the indirect command buffer generated -> It will also (optionally) do culling and lod. More...
Classes | |
| struct | InstancesOffsetAndNumOfInstances |
| struct | StateIdOffsetAndMaxCommands |
Public Types | |
| typedef std::vector < StateIdOffsetAndMaxCommands > | VectorStateIdOffsetAndMaxCommands |
Public Member Functions | |
| virtual | ~DtGpuCullingAndLod () |
| destructor More... | |
| virtual void | setRegistrar (DtIndirectGeometryRegistrar *registrar) |
| set the registrar More... | |
| virtual void | setCullShaderConfig (const DtCullShaderConfig &cullShaderConfig) |
| set the compute shader config More... | |
| virtual const DtCullShaderConfig & | cullShaderConfig (void) const |
| get the compute shader config More... | |
| virtual void | updateGpuBuffers (DtIndirectRenderingParameters &irParams, const MapIntToInt &modelIdsToNumInstances, osg::RenderInfo &renderInfo) |
| updateGpuBuffers More... | |
| virtual void | doCullingAndLOD (const DtIndirectViewParameters &viewParameters, DtIndirectRenderingParameters &irParams, osg::RenderInfo &renderInfo, DtGlBuffer *gpuLodVisibleBuffer) |
| do the culling and the lod More... | |
| virtual void | bindGpuOutputInstanceBuffer (void) const |
| bind the output instance buffer More... | |
| virtual void | unbindGpuOutputInstanceBuffer (void) const |
| unbind the output instance buffer More... | |
| virtual bool | bindIndirectThings () |
| bind the indirect command buffer and the count buffer returns false if handle is 0. More... | |
| virtual void | unbindIndirectThings () |
| unbind the indirect command buffer and the count buffer More... | |
| virtual bool | useInstanceCount (void) const |
| whether we are optimizing for shared models (useInstanceCount()=true) or unique models (useInstanceCount()=false), across instances More... | |
| virtual int | numDrawCommands (void) const |
| The number of draw commands generated. More... | |
| virtual void | setShadersFolderPath (const std::string &shaderFolderPath) |
| set up the shader folder path (to enable us to load shaders, de is not accessible here) More... | |
| virtual const std::string & | shadersFolderPath (void) const |
| get the shader folder path More... | |
| virtual void | setShadersFileCache (DtOsgShaderFilesCache *shaderFilesCache) |
| set up the shader file cache (to enable us to load shaders, de is not accessible here) More... | |
| virtual const DtOsgShaderFilesCache * | shadersFileCache (void) const |
| gets the shader file cache which contains all the shaders used by the culling comput shader More... | |
| virtual void | releaseGLObjects (osg::State *state) const |
| release the GL objects for the GpuCullingAndLod compute shader More... | |
| virtual void | reloadShaders () const |
| destroy the cull program and shader if they exists so they can be recreated next frame. More... | |
| virtual unsigned int | maxNumInstances (void) const |
| get the max number of instances that can possibly be rendered if none are culled out. More... | |
| virtual const VectorStateIdOffsetAndMaxCommands & | stateIdOffsetAndMaxCommands (void) const |
| get the map of the state id to their offset/number More... | |
| virtual void | setInstanceContainer (DtInstanceContainer *instanceContainer) |
| virtual bool | readyToUpdateBuffers () |
| helper function to decide if a job should be launched More... | |
| virtual bool | needTextureUpdate () const |
| are there textures that still need updating. More... | |
Protected Member Functions | |
| DtGpuCullingAndLod (DtDe &de) | |
| constructor More... | |
| virtual bool | updateGpuTexturesBuffer (osg::RenderInfo &renderInfo) |
| The buffer containing the bindless textures' addresses of the model textures returns true if there still work happening. More... | |
| virtual void | updateInstancesOffsetAndInstances (const MapIntToInt &modelIdsToNumInstances) |
| update the myGpuInstancesOffsetAndNumInstances buffer so it is ready to be used More... | |
| virtual void | updateStateIdMaxNumCommands (const MapIntToInt &modelIdsToNumInstances) |
| update the myGpuStateIdToMaxNumCommandsBuffer buffer with the correct max state instances for each state More... | |
| virtual bool | checkSpecBuffersOk (void) const |
| check a few of the buffers to make sure they are not null More... | |
| virtual void | updateGpuInputInstancesBuffer () |
| update the various buffers that are fed to the cull shader -> if new models came in -> if textures became available (they can be asynchronously available, e.g. More... | |
| virtual void | updateGpuInputPerGeomInstancesBuffer () |
| virtual void | updateGpuGeometrySpecificationsBuffer (const int numGeometries) |
| virtual void | updateGpuMaterialsBuffer (const int numGeometries) |
| virtual void | updateGpuGeometryOffsetAndSizeBuffer (int &numGeometries) |
| virtual void | updateGpuIndirectBuffer () |
| virtual void | clearInstanceCountofGpuIndirectBuffer () |
| virtual void | clearStateIdCommandCountBuffer () |
Private Member Functions | |
| DtGpuCullingAndLod () | |
| default constructor More... | |
| DtGpuCullingAndLod (const DtGpuCullingAndLod &other) | |
| Copy Constructor not implemented – Copy Not Allowed. More... | |
| DtGpuCullingAndLod & | operator= (const DtGpuCullingAndLod &other) |
| Assignment Operator Not implemented – Assignment Not Allowed. More... | |
Friends | |
| class | DtGpuCullingAndLodCreator |
This class is a component of the DtIndirectGeometry It inputs are: -> the instances registered with DtIndirectGeometry -> the viewing parameters (view matrix, projection matrix, etc) -> the indirect registrar (so that it can generate gpu data for -> the models of the instances from the interim data accessible -> via the registrar It outputs are: -> Tndirect command buffer -> The count of the indirect commands -> The input instances shuffled around/culled/lod'ed reflecting -> their order within the indirect command buffer generated -> It will also (optionally) do culling and lod.
| typedef std::vector<StateIdOffsetAndMaxCommands> makVrv::DtGpuCullingAndLod::VectorStateIdOffsetAndMaxCommands |
|
protected |
constructor
|
virtual |
destructor
|
private |
default constructor
|
private |
Copy Constructor not implemented – Copy Not Allowed.
|
private |
Assignment Operator Not implemented – Assignment Not Allowed.
|
virtual |
set the registrar
|
virtual |
set the compute shader config
|
virtual |
get the compute shader config
|
virtual |
updateGpuBuffers
|
virtual |
do the culling and the lod
|
virtual |
bind the output instance buffer
|
virtual |
unbind the output instance buffer
|
virtual |
bind the indirect command buffer and the count buffer returns false if handle is 0.
Can happen if the buffer hasn't been re-created yet (e.g. when the context is deleted and recreated), depending on the job/frame syc this can happen a few frames later
|
virtual |
unbind the indirect command buffer and the count buffer
|
virtual |
whether we are optimizing for shared models (useInstanceCount()=true) or unique models (useInstanceCount()=false), across instances
|
virtual |
The number of draw commands generated.
Is a value between [0, DtIndirectGeoUtils::getMaxDrawCountNoCullingNoLod()], inclusive
|
virtual |
set up the shader folder path (to enable us to load shaders, de is not accessible here)
|
virtual |
get the shader folder path
|
virtual |
set up the shader file cache (to enable us to load shaders, de is not accessible here)
|
virtual |
gets the shader file cache which contains all the shaders used by the culling comput shader
|
virtual |
release the GL objects for the GpuCullingAndLod compute shader
|
virtual |
destroy the cull program and shader if they exists so they can be recreated next frame.
get the max number of instances that can possibly be rendered if none are culled out.
|
virtual |
get the map of the state id to their offset/number
|
virtual |
|
virtual |
helper function to decide if a job should be launched
|
virtual |
are there textures that still need updating.
|
protectedvirtual |
update the various buffers that are fed to the cull shader -> if new models came in -> if textures became available (they can be asynchronously available, e.g.
via osg ico) -> if the number of instances changed
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
The buffer containing the bindless textures' addresses of the model textures returns true if there still work happening.
|
protectedvirtual |
update the myGpuInstancesOffsetAndNumInstances buffer so it is ready to be used
|
protectedvirtual |
update the myGpuStateIdToMaxNumCommandsBuffer buffer with the correct max state instances for each state
|
protectedvirtual |
check a few of the buffers to make sure they are not null
|
friend |
|
protected |
|
protected |
|
protected |
The input instances for the GPU (generated/updated from the passed in instance container)
|
protected |
contains switch states/ lod info
|
protected |
The spec buffer containing GeometrySpecifications for all the models/lods of the passed in instances.
|
protected |
c++ buffer that holds the same info
|
protected |
An internal indexing buffer that allows the cull shader to go from and intance to its GeometrySpecification in the Geometry Specification Buffer.
|
protected |
The spec buffer containing Materials for all the models/lods of the passed in instances.
|
protected |
The indirect command buffer that will be generated.
|
protected |
The re-distributed/culled/lod'ed instances (a subset of the input instances)
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
Keep track of the first model using bindless textures.
|
mutableprotected |
What index to start using bindless textures for a model.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |