VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtIndirectLodManager Class Reference

handles the lods for all the indirect geometry. More...

Inheritance diagram for makVrv::DtIndirectLodManager:
Inheritance graph
[legend]

Classes

struct  IndirectLodInfoInvalidator
 initializer/invalidator for lod info More...
 
struct  IndirectLodInfoRemovalPredicate
 removal predicate for lod infos (checks to see if the model ids match. More...
 

Public Types

typedef osg::observer_ptr
< osg::Node > 
NodeObserverPtr
 
typedef std::pair
< NodeObserverPtr,
IndirectLodInfo > 
NodeLodInfoPair
 
typedef std::deque
< IndirectLodInfo > 
DequeIndirectLodInfos
 
typedef std::deque
< NodeLodInfoPair
DequeIndirectLodInfoPairs
 
typedef std::vector
< DequeIndirectLodInfos
DequeIndirectLodInfoArray
 
typedef DtReusableMemoryVector
< IndirectLodInfo,
IndirectLodInfoInvalidator,
IndirectLodInfoRemovalPredicate
VectorIndirectLodInfos
 
- Public Types inherited from makVrv::DtIndirectManager
enum  ManagerTypes {
  BaseClass, LodManager, SwitchManager, DofManager,
  UvOffsetManager, PerInstanceDataManager
}
 

Public Member Functions

virtual ~DtIndirectLodManager ()
 DTOR. More...
 
virtual void releaseGLObjects (osg::State *state) const
 called when the context is deleted in order to clean up GPU data More...
 
virtual void addLodStacks (int perGeomInstanceIndex, int numGeoms, const DequeIndirectLodInfos &parentLodStack, const DequeIndirectLodInfoArray &lodStacks, const osg::Matrix &inverselocalOriginMatrix, int instanceId)
 add a vector of lod stacks to the lod management system More...
 
virtual void removeLodStacks (int instanceId)
 remove the lod stacks linked to this instanceId More...
 
virtual void processLods (const DtIndirectViewParameters &viewParameters, const DtGlBuffer *gpuDofTransformBuffer, const DtGlBuffer *gpuDofModelScaleBuffer, const DtGlBuffer *gpuInputPerGeomInstancesBuffer, const osg::Camera *currentCamera)
 setup and run the lod compute shader which checks all lods against the camera position to see if their children should be visible More...
 
virtual const DtGlBuffergpuLodVisibleBuffer (const osg::Camera *currentCamera) const
 get the buffer which has the output of the lod compute shader based on the current camera since we need to process multiple cameras between each draw. More...
 
virtual void reloadShaders () const
 reload the compute shader shaders More...
 
virtual void printInfo ()
 print out the info of what's contained in the buffer More...
 
- Public Member Functions inherited from makVrv::DtIndirectManager
 DtIndirectManager (DtDe &de, DtInstanceContainer &container)
 CTOR. More...
 
virtual ~DtIndirectManager ()
 DTOR. More...
 

Public Attributes

friend DtIndirectLodManagerCreator
 only creator can create More...
 

Protected Types

typedef std::map
< osg::observer_ptr< const
osg::Camera >, DtGlBuffer * > 
CameraToBufferMap
 The buffer containing a bool for each instance to know if it should be drawn or not. More...
 
typedef std::vector
< osg::observer_ptr< const
osg::Camera > > 
CameraVector
 

Protected Member Functions

 DtIndirectLodManager (DtDe &de, DtInstanceContainer &container)
 CTOR. only creator can create. More...
 
virtual void addLodStack (int perGeomInstanceIndex, int &indexIntoVectorIndirectLodInfos, const DequeIndirectLodInfos &parentLodStack, const DequeIndirectLodInfos &lodStack, const osg::Matrix &inverselocalOriginMatrix)
 add a single stack to the lod info input buffer The parent stack lod centers are multiplied by the inverse local offset so they correctly gives the view position when multiplied by the model view matrix. More...
 
virtual void updateLodBuffersIfNecessary ()
 send down any new lod infomation that has been recieved More...
 
virtual void deleteShaders () const
 cleanup the gpu shaders More...
 
virtual void deleteBuffers (void)
 delete the gpu buffers More...
 
virtual void tearDownBuffers (void) const
 cleanup the GPU buffers on the gpu side but leave the CPU objects More...
 
virtual void flushGpuLodVisibleBuffers ()
 check to see if any cameras are no longer valid and destroy their buffers if they are invalid. More...
 

Protected Attributes

VectorIndirectLodInfos myIndirectLodInfos
 
DtGlBuffermyGpuLodInfoBuffer
 The buffer containing all the lod infos for all instances managed by this manager. More...
 
CameraToBufferMap myGpuLodVisibleBufferMap
 
CameraVector myActiveCameras
 
bool myMutableLodInfoDirty
 
DtIndirectLodProgrammyMutableLodProgram
 
unsigned int myMaxPerGeomInstanceId
 
std::map< int, std::pair< int,
int > > 
myInstanceIdToPairIndices
 
- Protected Attributes inherited from makVrv::DtIndirectManager
DtInstanceContainermyInstanceContainer
 
DtDemyDe
 

Private Member Functions

 DtIndirectLodManager ()=delete
 default constructor not implemented More...
 
 DtIndirectLodManager (const DtIndirectLodManager &other)=delete
 Copy Constructor not implemented – Copy Not Allowed. More...
 
DtIndirectLodManageroperator= (const DtIndirectLodManager &other)=delete
 Assignment Operator Not implemented – Assignment Not Allowed. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from makVrv::DtIndirectManager
static int managerType ()
 what type of manager is this class More...
 

Detailed Description

handles the lods for all the indirect geometry.

sets up and runs a compute shader prepass for processing the lods contains a GPU buffer with the result which is used by the cull compute shader Own by DtIndirectGeometry 1:1

Member Typedef Documentation

typedef osg::observer_ptr<osg::Node> makVrv::DtIndirectLodManager::NodeObserverPtr
typedef std::deque<IndirectLodInfo> makVrv::DtIndirectLodManager::DequeIndirectLodInfos
typedef std::map<osg::observer_ptr<const osg::Camera>, DtGlBuffer*> makVrv::DtIndirectLodManager::CameraToBufferMap
protected

The buffer containing a bool for each instance to know if it should be drawn or not.

typedef std::vector<osg::observer_ptr<const osg::Camera> > makVrv::DtIndirectLodManager::CameraVector
protected

Constructor & Destructor Documentation

virtual makVrv::DtIndirectLodManager::~DtIndirectLodManager ( )
virtual

DTOR.

makVrv::DtIndirectLodManager::DtIndirectLodManager ( DtDe de,
DtInstanceContainer container 
)
protected

CTOR. only creator can create.

makVrv::DtIndirectLodManager::DtIndirectLodManager ( )
privatedelete

default constructor not implemented

makVrv::DtIndirectLodManager::DtIndirectLodManager ( const DtIndirectLodManager other)
privatedelete

Copy Constructor not implemented – Copy Not Allowed.

Member Function Documentation

DtIndirectLodManager& makVrv::DtIndirectLodManager::operator= ( const DtIndirectLodManager other)
privatedelete

Assignment Operator Not implemented – Assignment Not Allowed.

virtual void makVrv::DtIndirectLodManager::releaseGLObjects ( osg::State *  state) const
virtual

called when the context is deleted in order to clean up GPU data

virtual void makVrv::DtIndirectLodManager::addLodStacks ( int  perGeomInstanceIndex,
int  numGeoms,
const DequeIndirectLodInfos parentLodStack,
const DequeIndirectLodInfoArray lodStacks,
const osg::Matrix &  inverselocalOriginMatrix,
int  instanceId 
)
virtual

add a vector of lod stacks to the lod management system

virtual void makVrv::DtIndirectLodManager::removeLodStacks ( int  instanceId)
virtual

remove the lod stacks linked to this instanceId

virtual void makVrv::DtIndirectLodManager::processLods ( const DtIndirectViewParameters viewParameters,
const DtGlBuffer gpuDofTransformBuffer,
const DtGlBuffer gpuDofModelScaleBuffer,
const DtGlBuffer gpuInputPerGeomInstancesBuffer,
const osg::Camera *  currentCamera 
)
virtual

setup and run the lod compute shader which checks all lods against the camera position to see if their children should be visible

virtual const DtGlBuffer* makVrv::DtIndirectLodManager::gpuLodVisibleBuffer ( const osg::Camera *  currentCamera) const
virtual

get the buffer which has the output of the lod compute shader based on the current camera since we need to process multiple cameras between each draw.

virtual void makVrv::DtIndirectLodManager::reloadShaders ( ) const
virtual

reload the compute shader shaders

virtual void makVrv::DtIndirectLodManager::printInfo ( )
virtual

print out the info of what's contained in the buffer

virtual void makVrv::DtIndirectLodManager::addLodStack ( int  perGeomInstanceIndex,
int indexIntoVectorIndirectLodInfos,
const DequeIndirectLodInfos parentLodStack,
const DequeIndirectLodInfos lodStack,
const osg::Matrix &  inverselocalOriginMatrix 
)
protectedvirtual

add a single stack to the lod info input buffer The parent stack lod centers are multiplied by the inverse local offset so they correctly gives the view position when multiplied by the model view matrix.

virtual void makVrv::DtIndirectLodManager::updateLodBuffersIfNecessary ( )
protectedvirtual

send down any new lod infomation that has been recieved

virtual void makVrv::DtIndirectLodManager::deleteShaders ( ) const
protectedvirtual

cleanup the gpu shaders

virtual void makVrv::DtIndirectLodManager::deleteBuffers ( void  )
protectedvirtual

delete the gpu buffers

virtual void makVrv::DtIndirectLodManager::tearDownBuffers ( void  ) const
protectedvirtual

cleanup the GPU buffers on the gpu side but leave the CPU objects

virtual void makVrv::DtIndirectLodManager::flushGpuLodVisibleBuffers ( )
protectedvirtual

check to see if any cameras are no longer valid and destroy their buffers if they are invalid.

Member Data Documentation

friend makVrv::DtIndirectLodManager::DtIndirectLodManagerCreator

only creator can create

VectorIndirectLodInfos makVrv::DtIndirectLodManager::myIndirectLodInfos
protected
DtGlBuffer* makVrv::DtIndirectLodManager::myGpuLodInfoBuffer
protected

The buffer containing all the lod infos for all instances managed by this manager.

CameraToBufferMap makVrv::DtIndirectLodManager::myGpuLodVisibleBufferMap
protected
CameraVector makVrv::DtIndirectLodManager::myActiveCameras
protected
bool makVrv::DtIndirectLodManager::myMutableLodInfoDirty
mutableprotected
DtIndirectLodProgram* makVrv::DtIndirectLodManager::myMutableLodProgram
mutableprotected
unsigned int makVrv::DtIndirectLodManager::myMaxPerGeomInstanceId
protected
std::map<int, std::pair<int, int> > makVrv::DtIndirectLodManager::myInstanceIdToPairIndices
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)