Skip to main content

Crate voxel_light

Crate voxel_light 

Source
Expand description

Generic 3D BFS light propagation with two-phase removal for voxel engines.

Implement VoxelAccess for your storage, call propagate / remove, and apply the returned LightUpdates. The library never mutates your data.

For repeated operations, use LightEngine which reuses internal buffers.

Structs§

LightEngine
LightUpdate
A pending light level change at a world-space position.
VoxelInfo
Minimal information the algorithm needs about a single voxel position.

Traits§

VoxelAccess
Trait for querying voxel data. Implementors map world-space coordinates to their internal storage (chunks, octrees, flat arrays, etc.).

Functions§

propagate
Propagate light from a source position using BFS flood fill.
remove
Remove light from a source position using two-phase BFS.