25% off

Use code FUNCMAIN at checkout for 25% off all premium courses.

Get started →

TutorialEdge Project

Building Graphics with wgpu in Rust

A hands-on series building graphics and rendering concepts from scratch in Rust using wgpu — the modern, cross-platform GPU API.

rust wgpu graphics
Start Project 🚀
Elliot Forbes with Elliot Forbes

Learning graphics programming feels intimidating at first. Shaders, pipelines, buffers, bind groups — it’s a lot of new vocabulary before you see anything on screen. This series cuts through that by building things you can actually run and see, one concept at a time.

We’re using wgpu — Rust’s modern GPU API that compiles to Vulkan, Metal, DirectX 12, and WebGPU. The concepts you learn here transfer directly to other graphics APIs and even to browser-based WebGPU.

What We’re Building

Each part adds one new graphics concept to a growing Rust program. By the end of the foundations arc, you’ll have a textured, animated 2D quad on screen — and a solid mental model of how the GPU pipeline works.

Along the way we’ll also pick up real Rust: structs, traits, lifetimes, error handling, and external crates — all in context, not in the abstract.

Prerequisites

  • Rust installed (latest stable). Install from rustup.rs.
  • A terminal and a text editor.
  • No prior graphics programming experience needed.

Companion Repository

Every part of this series has a matching git tag in the companion repository so you can check out the exact code for any article:

git clone https://github.com/tutorialedge/graphics-with-wgpu-in-rust
git checkout part-3   # jump to any part

Series Outline

  1. Project Setup and Your First Window — cargo project, winit event loop, wgpu surface
  2. The Render Pipeline — GPU concepts, device/queue, clearing the screen to a colour
  3. Drawing Your First Triangle — vertex buffers, WGSL shaders, render pass
  4. Colors and Uniforms — uniform buffers, bind groups, passing data to shaders
  5. Textures and Image Loading — texture creation, sampling, bind group layouts
  6. 2D Transformations — transformation matrices, moving/rotating/scaling with glam

Project Parts

  1. 1 Part 1 - Project Setup and Your First Window Set up a Rust graphics project with wgpu and winit, understand the event loop, and open your first window — the foundation every graphics program is built on.
  2. 2 Part 2 - The Render Pipeline Initialise the wgpu render pipeline in Rust — create a GPU device, configure a surface, and clear the screen to a colour using a render pass.
  3. 3 Part 3 - Drawing Your First Triangle Draw your first triangle with wgpu in Rust — define vertex data, upload it to the GPU with a vertex buffer, and write your first WGSL shaders.
  4. 4 Part 4 - Colors and Uniforms Learn how to pass data from your Rust program to the GPU using uniform buffers and bind groups in wgpu — and animate a colour tint in real time.
  5. 5 Part 5 - Textures and Image Loading Load an image file and render it as a texture on a quad with wgpu in Rust — covers texture creation, samplers, UV coordinates, and index buffers.
  6. 6 Part 6 - 2D Transformations Move, rotate, and scale objects in wgpu using transformation matrices with glam — pass a 4×4 matrix as a uniform to the vertex shader and animate it each frame.