Material for the volume's solid surfaces: a standard Material, or a Shader, whose color the surfaces show unlit.
sunlight
boolean
false
Sky light fills open-air columns from above and spreads into overhangs. With it off, baked lighting still activates when any palette entry emits light.
ambient
number
0.15
Baked-light floor 0..1: how bright a fully dark face renders. Only meaningful when lighting is active.
physics
boolean
false
Attach a static physics body whose collider matches the volume's cells, following every edit.
layers
integer[]
the body belongs to every layer
Collision membership: layer bit indices 0..=31 the body belongs to. Requires physics.
collides_with
integer[]
the body collides with every layer
Collision filter: only collide with bodies in these layer bit indices 0..=31. Requires physics.
Create a chunk-streamed voxel world inside scene. Chunks load nearest-first around center under the per-frame budget and unload least-recently-needed beyond unload_radius. Each chunk is a full voxel volume sharing the world's palette, lighting, and physics configuration.
Example
-- Chunks of 16 cells load around center; fill each as it arrives.local world = datumhue.voxel.world(scene, {
chunk_size = 16,
load_radius = 1,
on_chunk_load = function(chunk)
if chunk.coords.y == 0then
chunk.voxel:fill(0, 0, 0, 15, 0, 15, 1)
endend,
})
world:palette(1, { color = datumhue.color("#83c092") })
Invoked after a chunk unloads, with its grid coordinates and cell snapshot — the chunk is already gone. Persist data and hand it back to chunk:write on the next load.