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...
Public Member Functions |
| | DtGpuCullingAndLod (DtIndirectGeometryRegistrar *registrar, bool viewFrustumCulling, bool lodChecking, bool useInstanceCount) |
| | constructor
|
| virtual | ~DtGpuCullingAndLod () |
| | destructor
|
| virtual void | doCullingAndLOD (const DtInstanceContainer &myInstances, const DtIndirectViewParameters &viewParameters, const DtIndirectRenderingParameters &irParams, const MapIntToInt &modelIdsToNumInstances, unsigned int contextID) |
| | do the culling and the lod
|
| virtual void | bind () |
| | bind the the instances that were re-distributed/culled/lod'ed whilst generating the command buffer
|
| virtual void | unbind () |
| | unbind the the instances that were re-distributed/culled/lod'ed whilst generating the command buffer
|
| virtual void | bindIndirectThings () |
| | bind the indirect command buffer and the count buffer
|
| virtual void | unbindIndirectThings () |
| | unbind the indirect command buffer and the count buffer
|
| virtual bool | useInstanceCount (void) const |
| | whether we are optimizing for shared models (useInstanceCount()=true) or unique models (useInstanceCount()=false), across instances
|
| virtual int | drawCount (void) const |
| | The number of draw commands generated.
|
| virtual void | setShadersFolderPath (const std::string &shaderFolderPath) |
| | set up the shader folder path (to enable us to load shaders, de is not accessible here)
|
| virtual void | setShadersFileCache (DtOsgShaderFilesCache *shaderFilesCache) |
| | set up the shader file cache (to enable us to load shaders, de is not accessible here)
|
| virtual void | releaseGLObjects (osg::State *state) const |
Detailed Description
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.
Constructor & Destructor Documentation
| virtual makVrv::DtGpuCullingAndLod::~DtGpuCullingAndLod |
( |
| ) |
|
|
virtual |
| makVrv::DtGpuCullingAndLod::DtGpuCullingAndLod |
( |
| ) |
|
|
private |
Member Function Documentation
do the culling and the lod
| virtual void makVrv::DtGpuCullingAndLod::bind |
( |
| ) |
|
|
virtual |
bind the the instances that were re-distributed/culled/lod'ed whilst generating the command buffer
| virtual void makVrv::DtGpuCullingAndLod::unbind |
( |
| ) |
|
|
virtual |
unbind the the instances that were re-distributed/culled/lod'ed whilst generating the command buffer
| virtual void makVrv::DtGpuCullingAndLod::bindIndirectThings |
( |
| ) |
|
|
virtual |
bind the indirect command buffer and the count buffer
| virtual void makVrv::DtGpuCullingAndLod::unbindIndirectThings |
( |
| ) |
|
|
virtual |
unbind the indirect command buffer and the count buffer
| virtual bool makVrv::DtGpuCullingAndLod::useInstanceCount |
( |
void |
| ) |
const |
|
virtual |
| virtual int makVrv::DtGpuCullingAndLod::drawCount |
( |
void |
| ) |
const |
|
virtual |
| virtual void makVrv::DtGpuCullingAndLod::setShadersFolderPath |
( |
const std::string & |
shaderFolderPath | ) |
|
|
virtual |
set up the shader folder path (to enable us to load shaders, de is not accessible here)
set up the shader file cache (to enable us to load shaders, de is not accessible here)
| virtual void makVrv::DtGpuCullingAndLod::releaseGLObjects |
( |
osg::State * |
state | ) |
const |
|
virtual |
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
| virtual void makVrv::DtGpuCullingAndLod::updateGpuGeometrySpecificationsBuffer |
( |
const int |
numGeometries, |
|
|
const DtInstanceContainer & |
instances |
|
) |
| |
|
protectedvirtual |
| virtual void makVrv::DtGpuCullingAndLod::updateGpuMaterialsBuffer |
( |
const int |
numGeometries, |
|
|
const DtInstanceContainer & |
instances |
|
) |
| |
|
protectedvirtual |
| virtual void makVrv::DtGpuCullingAndLod::updateGpuGeometryOffsetAndSizeBuffer |
( |
int & |
numGeometries, |
|
|
const DtInstanceContainer & |
instances |
|
) |
| |
|
protectedvirtual |
| virtual void makVrv::DtGpuCullingAndLod::updateGpuIndirectBuffer |
( |
const DtInstanceContainer & |
instances, |
|
|
int |
numStates |
|
) |
| |
|
protectedvirtual |
| virtual void makVrv::DtGpuCullingAndLod::clearInstanceCountIndirectBuffer |
( |
int |
numStates | ) |
|
|
protectedvirtual |
| virtual void makVrv::DtGpuCullingAndLod::bindGpuOutputInstanceBuffer |
( |
void |
| ) |
const |
|
protectedvirtual |
we need this advancing once per instance
| virtual void makVrv::DtGpuCullingAndLod::unbindGpuOutputInstanceBuffer |
( |
void |
| ) |
const |
|
protectedvirtual |
| virtual void makVrv::DtGpuCullingAndLod::createCullShaderAndProgramIfNecessary |
( |
void |
| ) |
|
|
protectedvirtual |
The cull shader that does the culling/lod/indirect command buffer generation.
The buffer containing the bindless textures' addresses of the model textures.
| virtual void makVrv::DtGpuCullingAndLod::printDebugInstances |
( |
| ) |
|
|
protectedvirtual |
| virtual int makVrv::DtGpuCullingAndLod::printCountBufferCount |
( |
| ) |
|
|
protectedvirtual |
| virtual void makVrv::DtGpuCullingAndLod::printDrawCommandsDetails |
( |
GLuint |
drawCount | ) |
|
|
protectedvirtual |
| virtual void makVrv::DtGpuCullingAndLod::printInstancesDetails |
( |
GLuint |
drawCount | ) |
|
|
protectedvirtual |
| virtual void makVrv::DtGpuCullingAndLod::printModelIdsToNumOfGeosDetails |
( |
GLuint |
drawCount | ) |
|
|
protectedvirtual |
| virtual void makVrv::DtGpuCullingAndLod::updateInstancesOffsetAndInstances |
( |
const DtInstanceContainer & |
instances, |
|
|
const MapIntToInt & |
modelIdsToNumInstances |
|
) |
| |
|
protectedvirtual |
Member Data Documentation
| DtGlBuffer* makVrv::DtGpuCullingAndLod::myGpuInstancesBuffer |
|
protected |
The input instances for the GPU (generated/updated from the passed in instance container)
| DtGlBuffer* makVrv::DtGpuCullingAndLod::myGpuGeometrySpecificationsBuffer |
|
protected |
The spec buffer containing GeometrySpecifications for all the models/lods of the passed in instances.
| DtGlBuffer* makVrv::DtGpuCullingAndLod::myGpuGeometryOffsetAndSizeBuffer |
|
protected |
An internal indexing buffer that allows the cull shader to go from and intance to its GeometrySpecification in the Geometry Specification Buffer.
| DtGlBuffer* makVrv::DtGpuCullingAndLod::myGpuMaterialsBuffer |
|
protected |
The spec buffer containing Materials for all the models/lods of the passed in instances.
| DtGlBuffer* makVrv::DtGpuCullingAndLod::myGpuIndirectBuffer |
|
protected |
The indirect command buffer that will be generated.
| DtGlBuffer* makVrv::DtGpuCullingAndLod::myGpuCountBuffer |
|
protected |
the count buffer that will be generated
| DtGlBuffer* makVrv::DtGpuCullingAndLod::myGpuOutputInstanceBuffer |
|
protected |
The re-distributed/culled/lod'ed instances (a subset of the input instances)
| GLuint makVrv::DtGpuCullingAndLod::myCullProgram |
|
mutableprotected |
| GLuint makVrv::DtGpuCullingAndLod::myCullShader |
|
mutableprotected |
| DtGlBuffer* makVrv::DtGpuCullingAndLod::myGpuTexturesBuffer |
|
protected |
| MapIntToInt makVrv::DtGpuCullingAndLod::myModelIdToIndex |
|
protected |
| Vector3_64 makVrv::DtGpuCullingAndLod::myPreviousCameraPosition |
|
protected |
| int makVrv::DtGpuCullingAndLod::myMaxNumInstancesIndex |
|
protected |
| int makVrv::DtGpuCullingAndLod::myModelViewMatrixIndex |
|
protected |
| int makVrv::DtGpuCullingAndLod::myProjectionMatrixIndex |
|
protected |
| int makVrv::DtGpuCullingAndLod::myZoomMagnificationIndex |
|
protected |
| bool makVrv::DtGpuCullingAndLod::myViewFrustumCulling |
|
protected |
| bool makVrv::DtGpuCullingAndLod::myLODChecking |
|
protected |
| bool makVrv::DtGpuCullingAndLod::myUseInstanceCount |
|
protected |
| const bool makVrv::DtGpuCullingAndLod::myDebugInstancesAppended |
|
staticprotected |
| DtGlBuffer* makVrv::DtGpuCullingAndLod::myGpuInstancesOffsetAndNumInstances |
|
protected |
| int makVrv::DtGpuCullingAndLod::myMaxAtomicCounters |
|
protected |
| std::string makVrv::DtGpuCullingAndLod::myShaderFolderPath |
|
protected |
The documentation for this class was generated from the following file: