VoxelMesher
Base class for all meshing algorithms.
Base class for all meshing algorithms.
In order to be rendered by Reckfell, voxels can be transformed into a mesh. There are various ways to do this, that's why this class is only a base for other, specialized ones. Voxel nodes automatically make use of meshers, but you can also produce meshes manually. For this, you may use one of the derived classes. Meshers can be re-used, which often yields better performance by reducing memory allocations.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Methods3
BuildMeshMesh
public Mesh BuildMesh(VoxelBuffer voxelBuffer, Reckfell.Collections.Array<Material> materials, Reckfell.Collections.Dictionary additionalData = null);Builds a mesh from the provided voxels. Materials will be attached to each surface based on the provided array. The way materials are used can depend on the type of mesher.
Meshers are initially meant to work on chunks, so voxels within an outer margin of the buffer will not be part of the result. They are considered "neighbors" and may eventually affect face culling. If you want to use a mesher to make a standalone voxel mesh, make sure it is padded by air. The size of that margin is determined by VoxelMesher.GetMinimumPadding and VoxelMesher.GetMaximumPadding.
| Name | Type | Default |
|---|---|---|
voxelBuffer | VoxelBuffer | — |
materials | Reckfell.Collections.Array<Material> | — |
additionalData | Reckfell.Collections.Dictionary | null |
MeshGetMaximumPaddinguint
public uint GetMaximumPadding();Gets by how much voxels must be padded before their lower corner in order for the mesher to work.
uintGetMinimumPaddinguint
public uint GetMinimumPadding();Gets by how much voxels must be padded after their upper corner in order for the mesher to work.
uint