Nix users
Activate the project's flake to set up the environment and all dependencies. For direnv users, the .envrc is set up to use the flake by default.
Then simply use any scripts from the justfile:
justto compile and run the debug binary (slow)just run-fastto compile and run the release binary (fast)
Other users
Compiling the project requires Rust 1.88 or newer.
- A
rust-toolchain.tomlis provided to ensure this for any users usingrustupwill automatically run with this version. - Any other installation method will have to manually ensure the version 1.88 or newer.
Assuming rust is properly setup, cargo can be used like any standard Rust project:
- Run
cargo run --releaseto compile and run in release mode (higher fps, optimized compilation) - Run
cargo runto compile and run in debug mode (lower FPS, debug tracing, simplified compilation)
- Mouse can be unlocked with
Escape - Shadows have very low render distance of 32 voxels and also have other noticable issues.
| Key(s) | Action |
|---|---|
Escape |
Toggle "pause" (locks/unlocks cursor, no real pause currently) |
W |
Move forward |
S |
Move backward |
A |
Move left |
D |
Move right |
Left Shift |
Move faster |
Mouse Left |
Break voxel |
Mouse right |
Place voxel |
T |
Switch terrain generator (only applies to new chunks that generate e.g. from moving) |
F1 or 1 |
Toggle diagnostics UI (FPS, vert count, coordinates) |
F2 or 2 |
Toggle opaque wireframe mode |
F3 or 3 |
Toggle chunk borders |
Computer graphics technical details
- "Vertex pulling." Each group of 6 vertices that make up a face share a single 32 bit float in a GPU buffer.
- Global illumination via the "Sun" with directional lighting, and a shadow pass that adds (somewhat scuffed) shadows
- Approximate ambient occlusion based on nearby voxels to a vertex.
- Full transparency support via a separate render pass.
- Custom UI implementation (with
taffyfor computing flexbox layouts andglyphonfor text heavylifting) - Custom fog and sky shaders that define the sky and horizon blending with sun/moon.
- Convenient texture and voxel definition loading enabling swapping voxel textures easily in the
assets/shared/blockfolder. - Water vertices "wave" up and down if you look at them closer
General engine technical details
- Chunk loading uses multi-threaded compute pooling
- ECS architecture for data-oriented design of the entire system
- Rendering and simulation run in parallel using a binary semaphore