Demonstrates how to render an interactive static scene (a cube with an orbit camera) with wgpu while using only a small amount of system resources (e.g. render only when the camera orientation or the scene changes).
It is heavily based on the excellent learn-wgpu tutorial. In contrast to the official examples for wgpu, which use a fairly involved framework this aims to be completly standalone and will hopefully become as modular as possible later in time.
You should be able to run the project on Linux, MacOS and Windows using cargo run --release
.
In order to build for wasm32-unknown-unknown
:
- Run
wasm-pack build --target web
( you need a recent version ofwasm-pack
) - Serve the root directory that contains the
Cargo.toml
with a static web server (for example withlive-server
) - Open
index.html
in your browser with WebGL2.0 support
The latest build is live on https://frankenapps.github.io/wgpu_cube/.
- Rotate: Hold left mouse button and drag.
- Zoom: Scroll mouse wheel.