pub struct Mesher {
pub quads: [Vec<u64>; 6],
/* private fields */
}
Fields§
§quads: [Vec<u64>; 6]
Implementations§
Source§impl Mesher
impl Mesher
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Call this between each meshing call to reset the buffers without reallocating them
Sourcepub fn fast_mesh(
&mut self,
voxels: &[u16],
opaque_mask: &[u64],
trans_mask: &[u64],
)
pub fn fast_mesh( &mut self, voxels: &[u16], opaque_mask: &[u64], trans_mask: &[u64], )
Meshes a voxel buffer representing a chunk, using an opaque and transparent mask with 1 u64 per column with 1 bit per voxel in the column, signaling if the voxel is opaque or transparent. This is ~4x faster than the regular mesh method but requires maintaining 2 masks for each chunk. See https://github.com/Inspirateur/binary-greedy-meshing?tab=readme-ov-file#what-to-do-with-mesh_dataquads for using the output
Sourcepub fn mesh(&mut self, voxels: &[u16], transparents: &BTreeSet<u16>)
pub fn mesh(&mut self, voxels: &[u16], transparents: &BTreeSet<u16>)
Meshes a voxel buffer representing a chunk, using a BTreeSet signaling which voxel values are transparent. This is ~4x slower than the fast_mesh method but does not require maintaining 2 masks for each chunk. See https://github.com/Inspirateur/binary-greedy-meshing?tab=readme-ov-file#what-to-do-with-mesh_dataquads for using the output