Skip to main contentCrate voxmesh
Source - CrossInfo
- Configuration for an X-shaped diagonal cross block.
- PaddedChunk
- A 16³ chunk of blocks with a 1-block padding ring on all sides.
- Quad
- A single output quad from the mesher, with per-vertex AO and light.
- Quads
- Output of the mesher: quads grouped by face direction.
- SlabInfo
- A partial-height slab attached to one face.
- AlignedFace
- One of the six axis-aligned cube faces.
- Axis
- One of the three spatial axes.
- CullMode
- How a block interacts with neighbor face culling.
- DiagonalFace
- One of the two diagonal planes in an X-shaped billboard.
- Face
- A face that a quad can belong to: either an axis-aligned
AlignedFace or a DiagonalFace. - Shape
- The geometric shape of a block, controlling quad generation.
- CHUNK_SIZE
- Side length of the inner chunk in blocks.
- PADDED
- Side length of the padded chunk (
CHUNK_SIZE + 2 * PADDING). - PADDED_VOLUME
- Total number of voxels in the padded chunk (
PADDED³). - PADDING
- Width of the padding ring around the chunk (1 block on each side).
- Block
- A voxel block type. Implement this to describe your block’s shape,
culling behavior, and lighting for the mesher.
- Light
- Per-vertex light value that can be averaged across neighboring voxels.
- delinearize
- Converts a linear index back to a padded 3D position.
- linearize
- Converts a padded 3D position to a linear index into the chunk data array.
- mesh_block
- Meshes a single block with all faces exposed (no neighbor culling).
- mesh_block_into
- Like
mesh_block, but reuses an existing Quads buffer. - mesh_chunk
- Meshes a padded chunk, returning the generated quads.
- mesh_chunk_into
- Like
mesh_chunk, but reuses an existing Quads buffer.