Skip to content

matthewjberger/wgpu-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust / Winit / Egui / Wgpu Triangle

This project demonstrates how to setup a rust project that uses wgpu to render a spinning triangle, supporting both webgl and webgpu wasm as well as native.

Quickstart

# native
cargo run -r

# webgpu
trunk serve --features webgpu --open

# webgl
trunk serve --features webgl --open

Firefox is still working on wgpu support but chromium-based browser like Brave, Vivaldi, Chrome, etc will work

Prerequisites (web)

Screenshots

Screenshot 2024-08-20 at 8 17 14 AM Screenshot 2024-08-20 at 8 17 51 AM

Note for Mac Users

On Macbooks, the web application's UI scaling will be incorrect if not running at the laptop screen's native resolution.

To run the app in the web browser properly, set your laptop's resolution to it's highest possible option.

On a Macbook M2 Air:

Option + F2 -> Show All Resolutions -> 2880 x 1864 (highest resolution)