OGRE-Next
4.0.0unstable
Object-Oriented Graphics Rendering Engine
|
Uses a VctVoxelizer to convert a single mesh made up of triangles into a voxel 3D texture representation. More...
#include <OgreVoxelizedMeshCache.h>
Classes | |
struct | VoxelizedMesh |
Public Member Functions | |
VoxelizedMeshCache (IdType id, TextureGpuManager *textureManager) | |
~VoxelizedMeshCache () | |
const VoxelizedMesh & | addMeshToCache (const MeshPtr &mesh, SceneManager *sceneManager, RenderSystem *renderSystem, HlmsManager *hlmsManager, const Item *refItem) |
addMeshToCache Checks if the mesh is already cached. More... | |
TextureGpu * | getBlankEmissive () |
void | setCacheResolution (uint32 width, uint32 height, uint32 depth, uint32 maxWidth, uint32 maxHeight, uint32 maxDepth, const Ogre::Vector3 &dimension) |
setCacheResolution When building the mesh cache, meshes must be voxelized at some arbitrary resolution This function lets you specify how many voxels per volume in units. More... | |
Public Attributes | |
FastArray< int32 > | mGlslTexUnits |
The number of texture units GL can handle may exceed the hard limit in ShaderParams::ManualParam::dataBytes so we need to use EX and store the data here. More... | |
Uses a VctVoxelizer to convert a single mesh made up of triangles into a voxel 3D texture representation.
This cache can be shared by multiple users (e.g. VctImageVoxelizer)
Ogre::VoxelizedMeshCache::VoxelizedMeshCache | ( | IdType | id, |
TextureGpuManager * | textureManager | ||
) |
Ogre::VoxelizedMeshCache::~VoxelizedMeshCache | ( | ) |
const VoxelizedMesh& Ogre::VoxelizedMeshCache::addMeshToCache | ( | const MeshPtr & | mesh, |
SceneManager * | sceneManager, | ||
RenderSystem * | renderSystem, | ||
HlmsManager * | hlmsManager, | ||
const Item * | refItem | ||
) |
addMeshToCache Checks if the mesh is already cached.
If it's not, it gets voxelized.
mesh | Mesh to voxelize |
sceneManager | We need it to temporarily create an Item |
refItem | Reference Item in case we need to copy its materials. Can be nullptr |
|
inline |
void Ogre::VoxelizedMeshCache::setCacheResolution | ( | uint32 | width, |
uint32 | height, | ||
uint32 | depth, | ||
uint32 | maxWidth, | ||
uint32 | maxHeight, | ||
uint32 | maxDepth, | ||
const Ogre::Vector3 & | dimension | ||
) |
setCacheResolution When building the mesh cache, meshes must be voxelized at some arbitrary resolution This function lets you specify how many voxels per volume in units.
e.g. if you call
And the mesh AABB is 2x2x2 in units, then we will voxelize at 64x64x64 voxels (unless this resolution exceeds maxWidth/maxHeight/maxDepth)
width | The width in pixels per dimension.x in units i.e. the width / dimension.x |
height | The height in pixels per dimension.y in units i.e. the height / dimension.y |
depth | The height in pixels per dimension.z in units i.e. the depth / dimension.z |
maxWidth | Width can never exceed this value |
maxHeight | Height can never exceed this value |
maxDepth | Depth can never exceed this value |
dimension | Units to cover (see previous parameters) |
The number of texture units GL can handle may exceed the hard limit in ShaderParams::ManualParam::dataBytes so we need to use EX and store the data here.