2 unstable releases
0.2.0 | Jan 24, 2024 |
---|---|
0.1.0 | Jan 17, 2024 |
#132 in Rendering
245KB
6K
SLoC
Rezcraft
- Voxel engine written in rust using wgpu
- Supports both native targets and wasm
Screenshots
Features
- Parallelised world and mesh generation
- Efficient meshes using greedy meshing
- Easily add custom textures and blocks, modify blocktypes at runtime
- Colored lighting system, sunlight
- Configurable through in-app settings
- Transparency (native only)
- Savegame system (native only)
How to
Installation
-
Run the web version without installing anything
-
Precompiled binaries can be found under releases, these binaries have all assets baked into themselves, so you need no resource directory
-
Alternatively, if you compile
rezcraft
without theportable
feature enabled, setup your file structure like this:- Have the binary
rezcraft
(orrezcraft.exe
on windows) and theres
directory are in the same directory - Your directory tree should look like this:
- Have the binary
├── res
│ ├── block
│ │ └── ...
│ ├── icon.png
│ ├── shader
│ │ └── ...
│ └── texture
│ └── ...
└── rezcraft (rezcraft.exe on windows)
-
- The location of the save and resource directories (defaults are
./saves
and./res
) can be change by setting theSAVES_PATH
andRESOURCE_PATH
enviromental variable
- The location of the save and resource directories (defaults are
Adding custom textures and blocks
Textures
- Add a
.png
image to./res/texture/
, it will be loaded after programm restart - All texture must be square and all textures must have the same resolution
Blocks
- Add a
.yaml
block describing file to./res/block/
, use one of the exisitng files as a tempalte - Blocks and their textures, light souces, and properties such as transparency and solidness can also be edited at runtime (
Edit block
menu while paused)
Controls
Key | Action |
---|---|
Mouse motion | Rotate camera |
W / ArrowUp | Move forward |
S / ArrowDown | Move back |
A / ArrowLeft | Move left |
D / ArrowRight | Move right |
Space / K | Move up |
LShift / J | Move down |
X / MouseRight | Delete block |
C / MouseLeft | Place block |
V / MouseMiddle | Pick block |
M | Reload chunk at players position |
F5 | Save |
F9 | Load |
F11 | Toggle fullscreen |
F12 | Reload settings from config file |
Tab | Pause / Resume |
Escape | Exit |
Building using cargo
- Have rust installed, or optionally use the included dev shelle:
nix develop
- Pick feautres
Feature | Description | Notes |
---|---|---|
portable | Doesn't read resources (textures, shaders...) from disk, but instead bakes them into the binary | Must be enabled when compiling for wasm |
save_system | Allow for saving and olding of the world | Doesn't work with wasm |
rayon | Extra pararelism for loading the world and saving | Doesn't work with wasm |
- Manually
- To build -
cargo build --no-default-features --release --features "Feature1 Feature2"
- To run -
cargo run --no-default-features --release --features "Feature1 Feature2"
- To build for wasm -
wasm-pack build --release --no-default-features --features portable --target web --features wasm_thread/es_modules
- To build -
- Using a build script f
- To build for native targets - run_native.sh
- To build for wasm - run_wasm.sh
Links
- Source repo - https://github.com/Shapur1234/Rezcraft
- Crate.io - https://crates.io/crates/rezcraft
Possible plans for future updates
- Improved worldgen
- Editable controls
- Physics, improved collision detection
- Optionally bake assets into the binary
- Fancy shader effects
- Multiplayer
Dependencies
~20–57MB
~1M SLoC