The Voxel Mapper is a set of Amethyst-compatible systems for creating beautiful voxel worlds.
Supports both smooth voxels and cube voxels. Just edit the MeshMode
resource.
Editor Usage
To build and run with the example assets:
run/download_assets.sh
GRAPHICS_BACKEND=metal
cargo run --bin editor --release --features amethyst/$GRAPHICS_BACKEND,amethyst/no-slow-safety-checks -- assets/maps/example_map.ron
When you exit the app, a binary file "saved_voxels.bin" will contain the map you just created.
You can load it back into the editor by setting voxels_file_path: Some("saved_voxels.bin")
in "assets/maps/example_map.ron."
Control bindings can be found in "assets/config/map_editor_bindings.ron".
If you want to import your own material images, take a look at material-converter. It makes it easy to import material images from sites like freepbr.com (don't you wish they meant the beer?).
Library Usage
To use the voxel mapper in your own Amethyst app, you'll need to:
- Add the
VoxelSystemBundle
to yourDispatcher
- Add the
RenderSplattedTriplanarPbr
render plugin to your renderer - Insert a
VoxelMap
into yourWorld
- You can create one in the editor and save it to a ".bin" file
- Reference the ".bin" file in your RON map file and load it with
load_voxel_map
- Insert a
VoxelAssets
into yourWorld
- You load the assets using the
VoxelAssetLoader
and yourVoxelMap
- You load the assets using the
Development
It's early days for this project. These features are currently supported:
- a voxel map that supports:
- real-time editing (terraforming)
- serialization
- real-time LZ4-(de)compression
- LRU-caching of decompressed chunks
- real-time, smooth chunk meshing using Surface Nets
- multiple blended materials (texture splatting)
- physically-based, triplanar material rendering, courtesy of Amethyst
- a mouse-based terraforming controller
- a camera controller that resolves collisions with the voxels
Planned features (by priority):
- multiple array materials
- more realistic texture splatting using depth textures
- shadows
- procedural generation
- streaming voxel maps from persistent storage
- dynamic voxel types (e.g. water, foliage)
- GPU acceleration of voxel algorithms
- beautiful example maps
- level of detail
- texture detiling