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.
1.8 KiB
1.8 KiB
| title | status | type | priority | created_at | updated_at |
|---|---|---|---|---|---|
| edu: write chapter on shader programming | todo | task | low | 2026-03-10T23:30:00Z | 2026-03-10T23:30:00Z |
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
- CPU vs GPU: parallel execution model
- The programmable pipeline: vertex shaders, fragment shaders, compute shaders
- What is WGSL? (WebGPU Shading Language) — syntax overview
Part 2 — Setting Up with wgpu
- What is
wgpu? Cross-platform graphics API in Rust - Exercise 1: Create a window and clear it to a colour (the GPU 'hello world')
- The render loop: swap chains, frames, command encoders
Part 3 — Vertex and Fragment Shaders
- Vertices, buffers, and the vertex shader
- Interpolation and the fragment shader
- Exercise 2: Draw a coloured triangle
- Exercise 3: Animate the triangle using a time uniform
Part 4 — Textures and Samplers
- Texture coordinates (UVs), texture creation, sampler config
- Exercise 4: Render a textured quad
Part 5 — Compute Shaders
- Compute pipelines: dispatching work groups
- Storage buffers and read/write access from WGSL
- Exercise 5: GPU-accelerate a particle simulation
Part 6 — Going Further
- Post-processing effects (bloom, blur) — conceptual overview
- Signed Distance Fields for font rendering
- Resources: Learn WGPU tutorial, Shadertoy, The Book of Shaders
File to create
edu/src/shaders.md- Add to
edu/src/SUMMARY.mdunder a# Graphicssection