A small wgpu renderer written in Rust. https://nullprop.sh/wgpu-renderer
Find a file
2025-01-11 18:54:02 +02:00
.github/workflows workflow permissions 2025-01-11 18:54:02 +02:00
.idea Update packages 2025-01-11 18:54:02 +02:00
.vscode rename to wgpu-renderer 2023-01-27 21:48:46 +02:00
res cleanup 2025-01-11 18:54:02 +02:00
src Get light pos directly from matrices, debugging shadowmaps 2025-01-11 18:54:02 +02:00
.gitignore include sponza 2023-01-27 21:51:04 +02:00
Cargo.lock Update packages 2025-01-11 18:54:02 +02:00
Cargo.toml Update packages 2025-01-11 18:54:02 +02:00
index.html remove white border from html 2025-01-11 18:54:02 +02:00
LICENSE-APACHE add licenses 2025-01-11 18:53:59 +02:00
LICENSE-MIT add licenses 2025-01-11 18:53:59 +02:00
README.md update todo 2025-01-11 18:54:02 +02:00
run-wasm.sh Update packages 2025-01-11 18:54:02 +02:00

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

  • PBS
  • glTF models
  • 1 realtime pointlight
  • Simple wgsl preprocessor for includes
  • Runs on WASM and native desktop
    • Tested on:
      • Ubuntu 22.04 (Mesa 23.1.0-devel)
      • Windows 10 Pro 21H2
      • Firefox 109.0
      • Chrome 109.0.5414.120

TODO:

  • Shadow mapping
  • Transparency
  • 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:

  • wasm-pack
    • cargo install wasm-pack
  • miniserve, or some other http server, such as python3 -m http.server.
    • For miniserve, see: run-wasm.sh

References

Assets