VoxelMesher¶
Inherits: Resource
Inherited by: VoxelMesherBlocky, VoxelMesherCubes, VoxelMesherTransvoxel
Base class for all meshing algorithms.
Description:¶
In order to be rendered by Godot, 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.
Methods:¶
| Return | Signature |
|---|---|
| Mesh | build_mesh ( VoxelBuffer voxel_buffer, Material[] materials, Dictionary additional_data={} ) |
| int | get_maximum_padding ( ) const |
| int | get_minimum_padding ( ) const |
Method Descriptions¶
Mesh build_mesh( VoxelBuffer voxel_buffer, Material[] materials, Dictionary additional_data={} )¶
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 get_minimum_padding and get_maximum_padding.
int get_maximum_padding( )¶
Gets by how much voxels must be padded before their lower corner in order for the mesher to work.
int get_minimum_padding( )¶
Gets by how much voxels must be padded after their upper corner in order for the mesher to work.
Generated on Jan 26, 2026