13dc88aafba77cf3e9184aa6f952032507d528be
learn-wgpu
An educational book teaching Rust graphics programming with wgpu 29 + winit 0.30.
Built for backend/systems Rust developers who know Rust thoroughly but have zero graphics programming experience. Every sentence teaches GPU concepts — not Rust syntax.
Required Reading Order
- The Graphics Pipeline — GPU vs CPU, the 5-stage pipeline
- Coordinate Systems — NDC, homogeneous coordinates, viewport
- Shader Basics — WGSL, vertex/fragment shaders, interpolation
- Build a Rainbow Triangle — The complete step-by-step guide
- Troubleshooting — Common errors and fixes (reference as needed)
- Glossary — Every term defined (reference as needed)
Reading order matters: Coordinate systems must be understood before shader basics, because the shader walkthrough references NDC coordinates.
Guides
- 01 — Rainbow Triangle — The minimal complete program: one triangle, smooth color interpolation
- More guides coming soon (textures, lighting, compute)
Running the Project
From the project root:
cargo run
This works on all supported platforms. If you encounter build errors, see the Prerequisites section above for platform-specific build tool requirements.
Prerequisites
- Rust stable (edition 2024)
- A system with a GPU supporting WebGPU-compatible APIs:
- Windows: Windows 10 or later with a DirectX 12-capable GPU
- macOS: macOS 10.13+ with a Metal-capable GPU
- Linux: Vulkan-capable GPU and drivers
Build tools: Your platform may require additional build tools:
- Windows: Visual Studio Build Tools (2019 or later)
- macOS: Xcode Command Line Tools (
xcode-select --install)- Linux: Vulkan ICD and development packages (e.g.,
vulkan-validationlayerson Ubuntu)
Description
Languages
Rust
100%