|
| VctVoxelizer (IdType id, RenderSystem *renderSystem, HlmsManager *hlmsManager, bool correctAreaLightShadows) |
|
| ~VctVoxelizer () |
|
void | _setNeedsAllMipmaps (bool bNeedsAllMipmaps) |
|
void | addItem (Item *item, bool bCompressed, uint32 indexCountSplit=0u) |
|
void | autoCalculateRegion () |
| Does nothing if VctVoxelizer::setRegionToVoxelize( false, ... ) was called. More...
|
|
void | build (SceneManager *sceneManager) |
|
void | dividideOctants (uint32 numOctantsX, uint32 numOctantsY, uint32 numOctantsZ) |
|
void | removeAllItems () |
| Removes all items added via VctVoxelizer::addItem. More...
|
|
void | removeItem (Item *item) |
| Removes an item added via VctVoxelizer::addItem. More...
|
|
void | setRegionToVoxelize (bool autoRegion, const Aabb ®ionToVoxelize, const Aabb &maxRegion=Aabb::BOX_INFINITE) |
| Call this function before VctVoxelizer::autoCalculateRegion. More...
|
|
void | setResolution (uint32 width, uint32 height, uint32 depth) |
| Changes resolution. More...
|
|
| VctVoxelizerSourceBase (IdType id, RenderSystem *renderSystem, HlmsManager *hlmsManager) |
|
virtual | ~VctVoxelizerSourceBase () |
|
TextureGpu * | getAlbedoVox () |
|
VctVoxelizerSourceBase::DebugVisualizationMode | getDebugVisualizationMode () const |
|
TextureGpu * | getEmissiveVox () |
|
HlmsManager * | getHlmsManager () |
|
TextureGpu * | getNormalVox () |
|
RenderSystem * | getRenderSystem () |
|
TextureGpuManager * | getTextureGpuManager () |
|
Vector3 | getVoxelCellSize () const |
|
Vector3 | getVoxelOrigin () const |
|
Vector3 | getVoxelResolution () const |
|
Vector3 | getVoxelSize () const |
|
void | setDebugVisualization (VctVoxelizerSourceBase::DebugVisualizationMode mode, SceneManager *sceneManager) |
|
| IdObject (IdType id) |
| We don't call generateNewId() here, to prevent objects in the stack (i.e. More...
|
|
IdType | getId () const |
| Get the unique id of this object. More...
|
|
bool | operator() (const IdObject &left, const IdObject &right) |
|
bool | operator() (const IdObject *left, const IdObject *right) |
|
The voxelizer consists in several stages.
The main ones that requre explanation are:
- Download the vertex buffers to CPU, then upload it again to GPU in an homogeneous format our compute shader understands. We do the same with the index buffer, except we perform GPU -> GPU copies. We can't use the buffers directly because in many APIs we can't bind the index buffer as an UAV easily. This step is handled by VctVoxelizer::buildMeshBuffers. Not implemented yet: when rebuilding the voxelized scene, this step can be skipped if no meshes were added since the last change (and the buffers weren't freed to save memory)
- Iterate through every Item and convert the datablocks to the simplified version our compute shader uses. VctMaterial handles this; done in VctVoxelizer::placeItemsInBuckets.
- During step 2, we also group the items into buckets. Each bucket can be batched together to dispatch a single compute shader execution; because they share all the same settings (and we haven't run out of material buffer space)
- The items grouped in buckets may be split into 8 instance buffers; in order to cull each octant of the voxel; thus avoiding having all voxels try to check for all instances (performance optimization).