Graphics & game physics demos

One concept each, all interactive. Every demo belongs to a note in Brain/graphics/ — the note explains it, the demo makes it obvious. Drag things.

Foundations

00

Vectors & matrices

Drag two arrows. Dot as a shadow, cross as an area, and a matrix whose determinant you can collapse to nothing.

00-vectors-and-matrices.md

Pipeline

01

Pipeline stages

One triangle stepped through every stage, with the vertex count next to the fragment count.

01-render-pipeline.md
02

Coordinate spaces

The same scene redrawn in model, world, view, clip and screen space. Watch the frustum become a cube.

02-coordinate-spaces.md
03

Rasterization & depth

Drag triangle vertices over a pixel grid; toggle the depth test and watch z-fighting appear.

03-rasterization-and-depth.md

Shaders

04

Shader playground

Live fragment shaders with their source beside the picture. Uniforms on sliders.

04-shader-basics.md
05

Lighting models

Drag the light. Isolate ambient, diffuse and specular, then add them back together.

05-lighting-and-shading.md
06

Texture sampling

Nearest vs bilinear, mips on vs off, and the shimmer that appears without them.

06-textures-and-sampling.md

Effects

07

Blending & sort order

Break transparent geometry by sorting it wrong, then fix it. Blend arithmetic shown per pixel.

07-transparency-and-blending.md
08

Post-processing chain

Blur, bloom, tone map, vignette — stack the passes and see the chain.

08-post-processing.md
09

Shadow mapping

The light's depth buffer as a strip. Crank bias until acne turns into peter-panning.

09-shadow-mapping.md

Physics

10

Collision shapes

Drag two shapes together. SAT's candidate axes and shadows drawn live.

10-collision-detection.md
11

Collision response

Restitution, friction and solver iterations — each one has a visible failure mode.

11-collision-response.md
12

Integration & timestep

Euler drifting against semi-implicit and RK4, with an energy graph that doesn't lie.

12-integration-and-timestep.md
13

Spatial partitioning

Brute force's pair count exploding while the grid's stays flat.

13-spatial-partitioning.md

Ray methods

14

Raytracing

Every bounce drawn in a top-down box, beside the strip of pixels those rays produced.

14-raytracing.md
15

Raymarching

The distance field as contour bands, with step circles shrinking onto the surface.

15-raymarching.md

Cameras & motion

16

Pitch, yaw & the poles

One forward vector in side and plan view at once. The plan circle's radius is cos(pitch) — shrink it to nothing and watch the basis collapse.

16-rotation-and-orientation.md
17

Gates, curves & chasing

Reverse a slide mid-flight, change the frame rate under two followers, and drag an angle across the ±180° seam.

17-interpolation-and-easing.md