Skip to content

Render a cube with an orbit camera efficiently using wgpu.

License

Notifications You must be signed in to change notification settings

FrankenApps/wgpu_cube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WGPU Cube

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.

Desktop

You should be able to run the project on Linux, MacOS and Windows using cargo run --release.

WebGL2

In order to build for wasm32-unknown-unknown:

  1. Run wasm-pack build --target web ( you need a recent version of wasm-pack)
  2. Serve the root directory that contains the Cargo.toml with a static web server (for example with live-server)
  3. Open index.html in your browser with WebGL2.0 support

The latest build is live on https://frankenapps.github.io/wgpu_cube/.

Controls

Mouse

  • Rotate: Hold left mouse button and drag.
  • Zoom: Scroll mouse wheel.

About

Render a cube with an orbit camera efficiently using wgpu.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published