A small wgpu renderer written in Rust.
https://nullprop.sh/wgpu-renderer
.github/workflows | ||
.vscode | ||
res | ||
src | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
index.html | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md | ||
run-wasm.sh |
wpgu-renderer
A small wgpu renderer written in Rust.
Try it out
rasanen.dev/wgpu-renderer
Note: the .wasm is about 50 MB because it embeds Sponza.
Controls:
- WASD - Move horizontally
- Ctrl/Space - Move vertically
- Mouse - Look around
- Scrollwheel - Increase/Decrease movement speed
- ESC - Quit (Only on standalone version)
Features
- Physically based shading
- (F: Fresnel-Schlick approximation)
- (G: Smith's Schlick-GGX)
- (D: Trowbridge-Reitz GGX)
- glTF models
- 1 realtime pointlight
- Simple wgsl preprocessor for includes
- Works on WASM
TODO:
- Shadow mapping
- Restructuring
- Simplify/abstract renderpasses; will be nice to have for PP and GI
src/core/state.rs
is a mess; separate input handling, pipeline, passes
- SSAO
- Bloom
- AA
- Texture filtering
- Immediate mode UI (dear imgui, egui)
- Some type of GI (DDGI, VXGI)
Running locally
Standalone:
cargo run --release
WASM requires miniserve, or some other http server, such as python3 -m http.server
.
For miniserve, see:
./run-wasm.sh
References
Assets
- Sponza
- Obtained from KhronosGroup glTF-Sample-Models repository, converted to .glb