#voxel #sparse #node #gpu #tree #contrees #64tree

Sparse-Voxel-64Tree

A lib for handling Sparse Voxel Contrees

1 unstable release

Uses new Rust 2024

new 0.1.0 Mar 14, 2025

#705 in Data structures

MIT license

34KB
513 lines

Sparse Voxel 64Tree

This is a library for handling Sparse Voxel 64Trees (or contrees). Its fairly easy to use,


Init a 64Tree

let 64tree = Sparse64Tree::new();

From there you can insert nodes:

let color = [25, 32, 4];
let depth = 4;
let x = 6;
let y = 3;
let z = 2;
tree.insert(x, y, z, depth, color);

Or you could import a voxel model:

add_vox_to_tree(file_path, depth, offsetx, offsety, offsetz, &mut tree);

If you want to upload to the gpu:

pub struct GpuNode64 {
    pub child_mask_low: u32,
    pub child_mask_high: u32,
    pub child_ptr_and_leaf: u32,
    pub _padding: u32,
    pub color: [f32; 3],
    pub _padding2: u32, // For 16-byte alignment.
}

and:

let gputree = Tree64GpuManager::new(&device, &contree);

Features

  • Modifying a 64tree with good speeds.
  • support for .vox model loading
  • GPU tracing support

Roadmap

  • Faster speeds.

Screenshots

App Screenshot

Documentation

None Yet

License

MIT

Demo

Its currently used in my Lepton Engine

Dependencies

~7–36MB
~538K SLoC