OGRE-Next  2.3
Object-Oriented Graphics Rendering Engine
Ogre::VctImageVoxelizer Class Reference

The image voxelizer aims to be faster than VctImageVoxelizer for the whole scene by following a different approach: More...

#include <OgreVctImageVoxelizer.h>

+ Inheritance diagram for Ogre::VctImageVoxelizer:

Public Types

enum  DebugVisualizationMode { DebugVisualizationAlbedo , DebugVisualizationNormal , DebugVisualizationEmissive , DebugVisualizationNone }
 

Public Member Functions

 VctImageVoxelizer (IdType id, RenderSystem *renderSystem, HlmsManager *hlmsManager, VoxelizedMeshCache *meshCache, bool correctAreaLightShadows)
 
virtual ~VctImageVoxelizer ()
 
void addItem (Item *item)
 Adds an item to voxelize. More...
 
void autoCalculateRegion ()
 Does nothing if VctImageVoxelizer::setRegionToVoxelize( false, ... ) was called. More...
 
void build (SceneManager *sceneManager)
 
void buildRelative (SceneManager *sceneManager, const int32 diffX, const int32 diffY, const int32 diffZ, const uint32 numOctantsX, const uint32 numOctantsY, const uint32 numOctantsZ)
 If the camera has moved by 1 voxel to the right (i.e. More...
 
void dividideOctants (uint32 numOctantsX, uint32 numOctantsY, uint32 numOctantsZ)
 
void forceFullBuild ()
 
TextureGpugetAlbedoVox ()
 
VctVoxelizerSourceBase::DebugVisualizationMode getDebugVisualizationMode () const
 
TextureGpugetEmissiveVox ()
 
HlmsManagergetHlmsManager ()
 
IdType getId () const
 Get the unique id of this object. More...
 
TextureGpugetNormalVox ()
 
RenderSystemgetRenderSystem ()
 
TextureGpuManagergetTextureGpuManager ()
 
Vector3 getVoxelCellSize () const
 
Vector3 getVoxelOrigin () const
 
Vector3 getVoxelResolution () const
 
Vector3 getVoxelSize () const
 
bool operator() (const IdObject &left, const IdObject &right)
 
bool operator() (const IdObject *left, const IdObject *right)
 
void removeAllItems ()
 Removes all items added via VctImageVoxelizer::addItem. More...
 
void removeItem (Item *item)
 Removes an item added via VctImageVoxelizer::addItem. More...
 
void restoreSwappedVoxelTextures ()
 Swaps mAlbedoVox & mAlbedoVoxAlt (and co.) if needed back to their originals. More...
 
void setDebugVisualization (VctVoxelizerSourceBase::DebugVisualizationMode mode, SceneManager *sceneManager)
 
void setRegionToVoxelize (bool autoRegion, const Aabb &regionToVoxelize, const Aabb &maxRegion=Aabb::BOX_INFINITE)
 Call this function before VctImageVoxelizer::autoCalculateRegion. More...
 
void setSceneResolution (uint32 width, uint32 height, uint32 depth)
 Changes resolution. More...
 

Detailed Description

The image voxelizer aims to be faster than VctImageVoxelizer for the whole scene by following a different approach:

1. For each single mesh, use VctImageVoxelizer to keep a voxelized texture version and
   save it to disk
2. At build time, VctImageVoxelizer builds the voxel of the whole scene
   by iterating each mesh using those cached texture versions like a collage.

Member Enumeration Documentation

◆ DebugVisualizationMode

Enumerator
DebugVisualizationAlbedo 
DebugVisualizationNormal 
DebugVisualizationEmissive 
DebugVisualizationNone 

Constructor & Destructor Documentation

◆ VctImageVoxelizer()

Ogre::VctImageVoxelizer::VctImageVoxelizer ( IdType  id,
RenderSystem renderSystem,
HlmsManager hlmsManager,
VoxelizedMeshCache meshCache,
bool  correctAreaLightShadows 
)

◆ ~VctImageVoxelizer()

virtual Ogre::VctImageVoxelizer::~VctImageVoxelizer ( )
virtual

Member Function Documentation

◆ addItem()

void Ogre::VctImageVoxelizer::addItem ( Item item)

Adds an item to voxelize.

Parameters
item

◆ autoCalculateRegion()

void Ogre::VctImageVoxelizer::autoCalculateRegion ( )

Does nothing if VctImageVoxelizer::setRegionToVoxelize( false, ... ) was called.

◆ build()

void Ogre::VctImageVoxelizer::build ( SceneManager sceneManager)

◆ buildRelative()

void Ogre::VctImageVoxelizer::buildRelative ( SceneManager sceneManager,
const int32  diffX,
const int32  diffY,
const int32  diffZ,
const uint32  numOctantsX,
const uint32  numOctantsY,
const uint32  numOctantsZ 
)

If the camera has moved by 1 voxel to the right (i.e.

diffX = 1) we will "translate" the voxels by 1 and then partially rebuild those sections

Remarks
Do not call this function if diffX/diffY/diffZ are all == 0.
Parameters
sceneManager
diffXHow many voxels to translate to the left/right
diffYHow many voxels to translate up/down
diffZHow many voxels to translate to the forward/backwards
numOctantsXIf we must perform a full rebuild, then the parameter passed to dividideOctants
numOctantsYSee numOctantsX
numOctantsZSee numOctantsX

◆ dividideOctants()

void Ogre::VctImageVoxelizer::dividideOctants ( uint32  numOctantsX,
uint32  numOctantsY,
uint32  numOctantsZ 
)

◆ forceFullBuild()

void Ogre::VctImageVoxelizer::forceFullBuild ( )
inline

◆ getAlbedoVox()

TextureGpu* Ogre::VctVoxelizerSourceBase::getAlbedoVox ( )
inlineinherited

◆ getDebugVisualizationMode()

VctVoxelizerSourceBase::DebugVisualizationMode Ogre::VctVoxelizerSourceBase::getDebugVisualizationMode ( ) const
inherited

◆ getEmissiveVox()

TextureGpu* Ogre::VctVoxelizerSourceBase::getEmissiveVox ( )
inlineinherited

◆ getHlmsManager()

HlmsManager* Ogre::VctVoxelizerSourceBase::getHlmsManager ( )
inherited

◆ getId()

IdType Ogre::IdObject::getId ( ) const
inlineinherited

Get the unique id of this object.

◆ getNormalVox()

TextureGpu* Ogre::VctVoxelizerSourceBase::getNormalVox ( )
inlineinherited

◆ getRenderSystem()

RenderSystem* Ogre::VctVoxelizerSourceBase::getRenderSystem ( )
inherited

◆ getTextureGpuManager()

TextureGpuManager* Ogre::VctVoxelizerSourceBase::getTextureGpuManager ( )
inherited

◆ getVoxelCellSize()

Vector3 Ogre::VctVoxelizerSourceBase::getVoxelCellSize ( ) const
inherited

◆ getVoxelOrigin()

Vector3 Ogre::VctVoxelizerSourceBase::getVoxelOrigin ( ) const
inherited

◆ getVoxelResolution()

Vector3 Ogre::VctVoxelizerSourceBase::getVoxelResolution ( ) const
inherited

◆ getVoxelSize()

Vector3 Ogre::VctVoxelizerSourceBase::getVoxelSize ( ) const
inherited

◆ operator()() [1/2]

bool Ogre::IdObject::operator() ( const IdObject left,
const IdObject right 
)
inlineinherited

◆ operator()() [2/2]

bool Ogre::IdObject::operator() ( const IdObject left,
const IdObject right 
)
inlineinherited

◆ removeAllItems()

void Ogre::VctImageVoxelizer::removeAllItems ( )

Removes all items added via VctImageVoxelizer::addItem.

◆ removeItem()

void Ogre::VctImageVoxelizer::removeItem ( Item item)

Removes an item added via VctImageVoxelizer::addItem.

Parameters
itemItem to remove

◆ restoreSwappedVoxelTextures()

void Ogre::VctImageVoxelizer::restoreSwappedVoxelTextures ( )

Swaps mAlbedoVox & mAlbedoVoxAlt (and co.) if needed back to their originals.

This is needed during shutdown since VctLighting otherwise will try to remove itself as a listener from mAlbedoVoxAlt

◆ setDebugVisualization()

void Ogre::VctVoxelizerSourceBase::setDebugVisualization ( VctVoxelizerSourceBase::DebugVisualizationMode  mode,
SceneManager sceneManager 
)
inherited

◆ setRegionToVoxelize()

void Ogre::VctImageVoxelizer::setRegionToVoxelize ( bool  autoRegion,
const Aabb regionToVoxelize,
const Aabb maxRegion = Aabb::BOX_INFINITE 
)

Call this function before VctImageVoxelizer::autoCalculateRegion.

Parameters
autoRegionTrue to autocalculate region to cover all the added items False to use 'regionToVoxelize' instead
regionToVoxelizeWhen autoRegion = false, use this to manually provide the region When autoRegion = true, it is ignored as it will be overwritten by autoCalculateRegion
maxRegionMaximum size of the regions are allowed to cover (mostly useful when autoRegion = true)

◆ setSceneResolution()

void Ogre::VctImageVoxelizer::setSceneResolution ( uint32  width,
uint32  height,
uint32  depth 
)

Changes resolution.

Note that after calling this, you will need to call VctImageVoxelizer::build again, and VctLighting::build again.

Parameters
width
height
depth

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