VoxelMesherBlocky

Inherits: VoxelMesher

Produces a mesh by batching models corresponding to each voxel value, similar to games like Minecraft or StarMade.

Description:

Occluded faces are removed from the result, and some degree of ambient occlusion can be baked on the edges. Values are expected to be in the VoxelBuffer.CHANNEL_TYPE channel. Models are defined with a VoxelBlockyLibrary, in which model indices correspond to the voxel values. Models don't have to be cubes.

Properties:

Type Name Default
VoxelBlockyLibraryBase library
float occlusion_darkness 0.8
bool occlusion_enabled true
bool shadow_occluder_negative_x false
bool shadow_occluder_negative_y false
bool shadow_occluder_negative_z false
bool shadow_occluder_positive_x false
bool shadow_occluder_positive_y false
bool shadow_occluder_positive_z false
TintMode tint_mode TINT_NONE (0)

Methods:

Return Signature
bool get_shadow_occluder_side ( Side side ) const
void set_shadow_occluder_side ( Side side, bool enabled )

Enumerations:

enum Side:

  • SIDE_NEGATIVE_X = 0
  • SIDE_POSITIVE_X = 1
  • SIDE_NEGATIVE_Y = 2
  • SIDE_POSITIVE_Y = 3
  • SIDE_NEGATIVE_Z = 4
  • SIDE_POSITIVE_Z = 5

enum TintMode:

  • TINT_NONE = 0 --- Only use colors from library models.
  • TINT_RAW_COLOR = 1 --- Modulate voxel colors based on the VoxelBuffer.CHANNEL_COLOR channel. Values are interpreted as being raw RGBA color. If the channel is 16-bit, colors are packed with 4 bits per component. If 32-bits, colors are packed with 8 bits per component. Other depths are not supported. See VoxelTool.color_to_u32 for encoding. You may also change the format of the color channel to use this, see VoxelNode.format. Alpha will only have an effect if the material supports transparency, but will not affect how faces are culled by the mesher.

Property Descriptions

VoxelBlockyLibraryBase library

Library of models that will be used by this mesher. If you are using a mesher without a terrain, make sure you call VoxelBlockyLibraryBase.bake before building meshes, otherwise results will be empty or out-of-date.

float occlusion_darkness = 0.8

(This property has no documentation)

bool occlusion_enabled = true

Enables baked ambient occlusion. To render it, you need a material that applies vertex colors.

bool shadow_occluder_negative_x = false

When enabled, generates a quad covering the negative X side of the chunk if it is fully covered by opaque voxels, in order to force directional lights to project a shadow.

bool shadow_occluder_negative_y = false

When enabled, generates a quad covering the negative Y side of the chunk if it is fully covered by opaque voxels, in order to force directional lights to project a shadow.

bool shadow_occluder_negative_z = false

When enabled, generates a quad covering the negative Z side of the chunk if it is fully covered by opaque voxels, in order to force directional lights to project a shadow.

bool shadow_occluder_positive_x = false

When enabled, generates a quad covering the positive X side of the chunk if it is fully covered by opaque voxels, in order to force directional lights to project a shadow.

bool shadow_occluder_positive_y = false

When enabled, generates a quad covering the positive Y side of the chunk if it is fully covered by opaque voxels, in order to force directional lights to project a shadow.

bool shadow_occluder_positive_z = false

When enabled, generates a quad covering the positive Z side of the chunk if it is fully covered by opaque voxels, in order to force directional lights to project a shadow.

TintMode tint_mode = TINT_NONE (0)

Configures a way to apply color from voxel data.

Method Descriptions

bool get_shadow_occluder_side( Side side )

(This method has no documentation)

void set_shadow_occluder_side( Side side, bool enabled )

(This method has no documentation)

Generated on Jan 26, 2026