You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vibed/edu/.beans/edu-4u7w--edu-write-chapter...

2.1 KiB

title status type priority created_at updated_at
edu: write chapter on shader programming completed feature low 2026-03-10T23:30:00Z 2026-03-16T02:32:28Z

Background

From edu/TODO.md: Hands-on: Shader programming.

A practical introduction to GPU shaders, written with Rust as the host language. The course covers the graphics pipeline conceptually and has hands-on exercises writing WGSL shaders driven by wgpu.

Content outline (suggested)

Part 1 — The GPU and the Graphics Pipeline

  1. CPU vs GPU: parallel execution model
  2. The programmable pipeline: vertex shaders, fragment shaders, compute shaders
  3. What is WGSL? (WebGPU Shading Language) — syntax overview

Part 2 — Setting Up with wgpu

  1. What is wgpu? Cross-platform graphics API in Rust
  2. Exercise 1: Create a window and clear it to a colour (the GPU 'hello world')
  3. The render loop: swap chains, frames, command encoders

Part 3 — Vertex and Fragment Shaders

  1. Vertices, buffers, and the vertex shader
  2. Interpolation and the fragment shader
  3. Exercise 2: Draw a coloured triangle
  4. Exercise 3: Animate the triangle using a time uniform

Part 4 — Textures and Samplers

  1. Texture coordinates (UVs), texture creation, sampler config
  2. Exercise 4: Render a textured quad

Part 5 — Compute Shaders

  1. Compute pipelines: dispatching work groups
  2. Storage buffers and read/write access from WGSL
  3. Exercise 5: GPU-accelerate a particle simulation

Part 6 — Going Further

  1. Post-processing effects (bloom, blur) — conceptual overview
  2. Signed Distance Fields for font rendering
  3. Resources: Learn WGPU tutorial, Shadertoy, The Book of Shaders

File to create

  • edu/src/shaders.md
  • Add to edu/src/SUMMARY.md under a # Graphics section

Summary of Changes

All 18 sections written with full educational content covering the GPU execution model, wgpu setup, vertex/fragment shaders, textures, compute shaders, and advanced topics. ~4400 lines of content including full Rust+WGSL code examples, ASCII diagrams, and 5 hands-on exercises.