MCPcopy Index your code
hub / github.com/dust-engine/dust

github.com/dust-engine/dust @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
370 symbols 614 edges 31 files 53 documented · 14%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Dust

A Rust-based 3D voxel rendering engine using physically-based ray tracing. Built on Bevy (ECS), Vulkan ray tracing via pumicite.

Features

  • Hardware ray-traced rendering of sparse voxel scenes
  • Hierarchical voxel spatial index (VDB-style) with const-generic configurable tree shape
  • MagicaVoxel .vox file loading
  • HDR output with tone-mapping and sky atmosphere
  • DLSS upscaling on supported NVIDIA GPUs
  • egui debug overlay

Requirements

  • A GPU and driver supporting VK_KHR_ray_tracing_pipeline and VK_KHR_acceleration_structure
  • Rust nightly
  • Bazelisk — Bazel is the primary build system, since it drives Slang shader compilation and asset bundling

Building

# Build everything
bazelisk build -c opt //...

# Run the demo
bazelisk run -c opt //:dust

Cargo also works for code-only builds (cargo build, cargo test), but Bazel is required to run at least once to compile shaders and bundle runtime assets. Tests for the dust_vdb crate run under Cargo.

Workspace Layout

Crate Purpose
crates/vdb (dust_vdb) Hierarchical voxel spatial index. Generic tree with configurable depth via the hierarchy! macro. Bit-packed node storage and pooling. Compiled at opt-level = 3 even in dev.
crates/vox (dust_vox) Voxel geometry, materials, palettes, and .vox loading. Defines the tree as hierarchy!(3, 3, 2, VoxLeafNode) and provides hit-group shaders for ray intersection.
crates/pbr (dust_pbr) PBR ray-tracing renderer: pipeline, Shader Binding Table, camera, sky atmosphere, and super-resolution (denoise + upscale) through the external pumicite_super_resolution crate (DLSS-RR backend). Shaders in crates/pbr/shaders/ (Slang).
crates/app (dust_app) Application-level Bevy plugin glue.
src/main.rs Demo entry point — loads a castle scene, an orbiting teapot, and an animated rainbow.

Rendering Pipeline

  1. PBR ray-tracing pass — HDR color output and G-buffers (albedo, normal, depth, motion vectors)
  2. Shadow pass — visibility
  3. Tone-mapping compute pass — HDR to LDR
  4. egui overlay

Shaders

Shaders are written in Slang (.slang) and compiled to SPIR-V through custom Bazel rules (slang_shader, slang_playout in third_party/pumicite_cli.bzl). Pipeline layouts are generated as Rust source. Compiled binaries are bundled as Bazel runfiles.

Third Party

third_party/ contains custom BUILD.bazel files for external C/C++ dependencies: VulkanMemoryAllocator, shader-slang Rust bindings, and the pumicite shader-compilation macros. Bevy is patched to the dust-engine/bevy release-0.17.3 fork; ash is patched to a fork that exposes additional Vulkan metadata.

Extension points exported contracts — how you extend this code

Node (Interface)
(no doc) [3 implementers]
crates/vdb/src/node/mod.rs
GpuTimerCommands (Interface)
Command-encoder extension for timing a scope of GPU work. [1 implementers]
crates/gfxdebug/src/profiler.rs
PoolStorage (Interface)
(no doc) [2 implementers]
crates/vdb/src/pool.rs
Attributes (Interface)
(no doc) [2 implementers]
crates/vdb/src/attributes.rs
IsDefault (Interface)
(no doc) [1 implementers]
crates/vdb/src/attributes.rs
IsLeaf (Interface)
(no doc) [1 implementers]
crates/vdb/src/node/leaf.rs

Core symbols most depended-on inside this repo

clone
called by 63
crates/vdb/src/node/internal.rs
get
called by 40
crates/vdb/src/pool.rs
size_of_grid
called by 24
crates/vdb/src/node/mod.rs
load
called by 17
crates/vox/src/loader.rs
iter
called by 15
crates/vdb/src/tree.rs
push
called by 12
crates/gfxdebug/src/performance.rs
get_mut
called by 9
crates/vdb/src/pool.rs
set
called by 7
crates/vdb/src/accessor.rs

Shape

Method 203
Class 92
Function 62
Enum 7
Interface 6

Languages

Rust100%

Modules by API surface

crates/pbr/src/lib.rs33 symbols
crates/pbr/src/sharc.rs26 symbols
crates/vdb/src/parry.rs24 symbols
crates/vdb/src/node/leaf.rs23 symbols
crates/gfxdebug/src/profiler.rs22 symbols
crates/vox/src/lib.rs18 symbols
crates/vdb/src/pool.rs18 symbols
crates/vdb/src/node/internal.rs18 symbols
crates/vox/src/loader.rs17 symbols
crates/vdb/src/node/root.rs17 symbols
crates/pbr/src/sky.rs16 symbols
crates/vdb/src/accessor.rs15 symbols

For agents

$ claude mcp add dust \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact