#### <sup>[Ollin](../index.md) → [Guide](index.md) → Appendix D</sup>

---

# D. The complete toolbox

This appendix lists everything Ollin can do, one row for each capability, in the order the guide teaches it. The rows are grouped by part and chapter. Each row says what the capability is in plain words, links the section that teaches it, and links its page in the [reference](../docs/index.md).

Use it as an index when you remember a technique from the guide and want to find it again. You can also read it as a list of what you haven't tried yet. A capability taught in more than one chapter sits with the chapter that teaches it most fully. Its row also links the other sections, each marked with its chapter. If something you want isn't here, it isn't in the framework yet, and the [roadmap](../roadmap.md) lists what's ahead.

**Contents:** [The ideas underneath](#the-ideas-underneath) · [Part I: Seeing something move](#part-i-seeing-something-move) · [Part II: Systems that come alive](#part-ii-systems-that-come-alive) · [Part III: Shapes, lines, and marks](#part-iii-shapes-lines-and-marks) · [Part IV: Pixels and light](#part-iv-pixels-and-light) · [Part V: The third dimension](#part-v-the-third-dimension) · [Part VI: The world coming in](#part-vi-the-world-coming-in) · [Part VII: Out into the world](#part-vii-out-into-the-world)

## The ideas underneath

The capabilities all assume a few ideas. These seven pages in the reference explain them, one screen each, and sit between a chapter and a function signature.

| Idea | What it says | Taught in | Reference |
|---|---|---|---|
| The frame | A drawing call records rather than paints, call order is draw order, and nothing is kept for you | Ch 1: [Once, then every frame](01-helloollin.md#once-then-every-frame), [Shapes and ink](01-helloollin.md#shapes-and-ink) | [The frame](../docs/concepts/frame.md) |
| Where a point is | The canvas frame and its units, transforms as a change of frame, and the other frames a sketch meets | Ch 1: [Where things go](01-helloollin.md#where-things-go), [The canvas is not the window](01-helloollin.md#the-canvas-is-not-the-window); Ch 6: [Moving the paper: `translate`, `rotate`, and `scale`](06-gridsandrepetition.md#moving-the-paper-translate-rotate-and-scale) | [Where a point is](../docs/concepts/coordinates.md) |
| Layers | An off-screen picture you draw into and then read back: what one costs, and when you need one | Ch 19: [A drawing you can hold: render targets](19-layersandeffects.md#a-drawing-you-can-hold-render-targets) | [Layers](../docs/concepts/layers.md) |
| What survives a frame | What carries into the next frame, and what a batch, a reload, and a checkpoint hold | Ch 19: [The canvas that keeps everything: noClear](19-layersandeffects.md#the-canvas-that-keeps-everything-noclear), [Record it once: batches](19-layersandeffects.md#record-it-once-batches); Ch 45: [Picking up where it left off: checkpoints and `@Saved`](45-installations.md#picking-up-where-it-left-off-checkpoints-and-saved) | [What survives a frame](../docs/concepts/persistence.md) |
| Why a run repeats | The seed and the fixed export clock, and the four things that break a repeat | Ch 4: [Seeds: randomness you can keep](04-randomness.md#seeds-randomness-you-can-keep), [Finding a seed to keep](04-randomness.md#finding-a-seed-to-keep); Ch 3: [When a frame takes too long](03-motionandtime.md#when-a-frame-takes-too-long); Ch 41: [The recipe in the file](41-finishingasketch.md#the-recipe-in-the-file) | [Why a run repeats](../docs/concepts/determinism.md) |
| Light and color | Why the middle of a frame is linear light, and what tone mapping and dithering do at the end of it | Ch 9: [A picture made of pictures](09-pictures.md#a-picture-made-of-pictures); Ch 19: [Brighter than the screen: toneMap](19-layersandeffects.md#brighter-than-the-screen-tonemap) | [Light and color](../docs/concepts/light.md) |
| Values and bare calls | The typed values under the short calls, and when to keep the value rather than make the call | Ch 10: [An arrow you can draw: `Vector2`](10-vectors.md#an-arrow-you-can-draw-vector2); Ch 15: [Shapes you can hold](15-shapesasmaterial.md#shapes-you-can-hold) | [Values and bare calls](../docs/concepts/values.md) |

## Part I: Seeing something move

### Chapter 1: Hello, Ollin

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Checking the machine | `ollin doctor` checks the toolchain, the GPU, the command, and the permissions, and prints the line that fixes each problem; shell completions; `--list-params` for the parameters a sketch declares | [What you need](01-helloollin.md#what-you-need), [A shorter way to run things](01-helloollin.md#a-shorter-way-to-run-things); Ch 41: [Passing the parameters back in](41-finishingasketch.md#passing-the-parameters-back-in) | [Doctor](../docs/tools/doctor.md) |
| The examples gallery | `swift run OllinExamples` shows the examples in a tree and runs the one you pick, with its parameters beside it | [The gallery](01-helloollin.md#the-gallery) | [`Examples/`](../examples/index.md) |
| Live reload | `swift run OllinLive Sketch.swift` watches the file, and each save swaps the change into the open window | [Your first sketch](01-helloollin.md#your-first-sketch) | [Sketch](../docs/core/sketch.md) |
| Swift itself | As much of the language as a sketch needs | [Your first sketch](01-helloollin.md#your-first-sketch); [Appendix A](a-justenoughswift.md) | [Swift quick reference](../docs/swift.md) |
| The sketch lifecycle | `setup()` runs once, and `draw()` runs every frame at the display's rate | [Once, then every frame](01-helloollin.md#once-then-every-frame) | [Sketch](../docs/core/sketch.md) |
| Canvas and window | `canvasSize` and its presets, and `windowMode` (auto, fixed, resizable) | [The canvas is not the window](01-helloollin.md#the-canvas-is-not-the-window); Ch 44: [Filling the screen or fitting in it: `windowMode`](44-handingitover.md#filling-the-screen-or-fitting-in-it-windowmode) | [Canvas](../docs/core/canvas.md) |
| Looking closer | `viewControl()` lets you drag to pan and scroll to zoom the live view, and leaves the canvas as it is | [Looking closer](01-helloollin.md#looking-closer) | [Drawing](../docs/drawing/drawing.md#viewcontrol) |
| Normalized coordinates | `uv(u, v)` gives the canvas point at fractions from 0…1 across and down, and `scale`, the shorter edge over 1000, sizes marks to the canvas | [Placing things without pixels](01-helloollin.md#placing-things-without-pixels) | [Canvas](../docs/core/canvas.md#uv) |
| The shape catalog | Circles, rectangles, lines, ellipses, triangles, stars, hearts, arcs, rings, and n-gons, `drawPolygon` and `drawPolyline` through points you give, and about twenty more | [Shapes and ink](01-helloollin.md#shapes-and-ink); Ch 6: [Grids that aren't square: `hexGrid` and `triangleGrid`](06-gridsandrepetition.md#grids-that-arent-square-hexgrid-and-trianglegrid); Ch 7: [The diagonal tile: ten print](07-tiles.md#the-diagonal-tile-ten-print) | [Drawing](../docs/drawing/drawing.md) |
| Ink state | `fill`, `stroke`, and `strokeWeight`, then caps and joins; the reference adds `hollow` band mode and stroke alignment | [Shapes and ink](01-helloollin.md#shapes-and-ink); Ch 5: [Putting it together: a meadow in the wind](05-noise.md#putting-it-together-a-meadow-in-the-wind); Ch 7: [No coins at all: kolam and sona](07-tiles.md#no-coins-at-all-kolam-and-sona) | [Drawing](../docs/drawing/drawing.md) |
| Rounded rectangles | `drawRect` with `cornerRadius:`, or `cornerRadii:` for a different radius at each corner | [Shapes and ink](01-helloollin.md#shapes-and-ink) | [Drawing](../docs/drawing/drawing.md#rect) |
| Mouse | `mouseX`, `mouseY`, and `mouseIsPressed`, the press and release hooks, and `mouse` and `previousMouse` as points | [The mouse joins in](01-helloollin.md#the-mouse-joins-in) | [Input](../docs/helpers/input.md) |
| `@Param` parameters | A property marked `@Param` becomes a control in the inspector, chosen by its type: a slider, a stepper, a color well, a pad, and more | [Putting it together: a breathing ring](01-helloollin.md#putting-it-together-a-breathing-ring); Ch 38: [One parameter, three hands: binding and smoothing](38-controlsandsignals.md#one-parameter-three-hands-binding-and-smoothing) | [Parameters](../docs/helpers/parameters.md) |
| Saving tuned values | The inspector's Save parameters button writes the values you tuned back into your `.swift` file | [Saving the values you tuned](01-helloollin.md#saving-the-values-you-tuned) | [Parameters](../docs/helpers/parameters.md#saving) |
| Dragging a shape | Hold Command in the live window and drag a shape, and the numbers that placed it change in your file | [Moving something by hand](01-helloollin.md#moving-something-by-hand); Ch 43: [Moving a shape on stage: the Command-drag](43-performing.md#moving-a-shape-on-stage-the-command-drag) | [DragToEdit](../docs/tools/dragtoedit.md) |
| One frame on request | `redraw()` draws one more frame of a sketch that `noLoop()` stopped, so a still sketch answers a click and costs nothing between | [One more frame when asked: `redraw()`](01-helloollin.md#one-more-frame-when-asked-redraw) | [Sketch](../docs/core/sketch.md#redraw) |
| The pointer | `pointerShape(_:)` picks one of the system's pointer shapes over the canvas, and `hidePointer()` and `showPointer()` take it away and bring it back | [The pointer's shape, or none](01-helloollin.md#the-pointers-shape-or-none) | [Input](../docs/helpers/input.md#pointer) |
| The open panel | `chooseFiles(withExtensions:)` shows the system's open panel without stopping the frames; the pick arrives in `chosenFiles()` and `filesChosen()` | [A file the person picks: the open panel](01-helloollin.md#a-file-the-person-picks-the-open-panel) | [Input](../docs/helpers/input.md#chooseFiles) |
| The frame on the clipboard | `copyFrame()` puts the frame the window shows on the clipboard as a PNG | [The frame on the clipboard: `copyFrame()`](01-helloollin.md#the-frame-on-the-clipboard-copyframe) | [Recording](../docs/output/recording.md#copyFrame) |
| Single-file sketches | `ollin new <file>.swift` and `ollin <file>.swift`: one file is a sketch, and it runs from any folder | [A shorter way to run things](01-helloollin.md#a-shorter-way-to-run-things) | [SingleFile](../docs/tools/singlefile.md) |
| Project generator | `ollin new <Name>` and `ollin generate` write a folder from a template, and you can watch the template run first | [When one file isn't enough](01-helloollin.md#when-one-file-isnt-enough) | [ProjectGenerator](../docs/tools/projectgenerator.md) |
| A package's sketch, live | `ollin` in a package's folder runs its sketch in the live window, every `.swift` file of the target compiled together and a save to any of them reloading it; `--target` picks one of several | [When one file isn't enough](01-helloollin.md#when-one-file-isnt-enough) | [SingleFile](../docs/tools/singlefile.md#growing-into-a-package) |
| The reference offline | `ollin docs`, `ollin api`, and `ollin examples` read these pages, the calls, and the examples in the terminal, with a search across them; `ollin site` writes them out as a website | [Looking something up without leaving the terminal](01-helloollin.md#looking-something-up-without-leaving-the-terminal) | [Reference](../docs/tools/reference.md) |
| Ollin on one page | The lifecycle, the calls by area, units and conventions, the command line, and the mistakes that fail with no error | [Go deeper](01-helloollin.md#go-deeper) | [Quick reference](../docs/quickreference.md) |

### Chapter 2: Color that works

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Color values | Named colors, hex, RGB, HSB, and alpha | [Naming a color](02-color.md#naming-a-color), [Thinking in hue](02-color.md#thinking-in-hue) | [Color](../docs/drawing/color.md) |
| Perceptual color | The OKLab family, and `Color.mix`, which blends the way your eye expects | [Mixing you can trust](02-color.md#mixing-you-can-trust) | [Color](../docs/drawing/color.md) |
| Lightness and related colors | OKLCH and OKHSL keep hues at one lightness, and `lighter(by:)`, `darker(by:)`, and `complement` make colors related to one you have | [Hues that weigh the same: lightness](02-color.md#hues-that-weigh-the-same-lightness) | [Color](../docs/drawing/color.md) |
| Palettes and ramps | ColorBrewer sets, harmonies built from one color, smooth ramps, and cosine palettes | [Kits you carry: Palette and Ramp](02-color.md#kits-you-carry-palette-and-ramp) | [Color](../docs/drawing/color.md) |
| Colormaps | Viridis, magma, and turbo: ramps for turning data into color | [Kits you carry: Palette and Ramp](02-color.md#kits-you-carry-palette-and-ramp) | [Color](../docs/drawing/color.md) |
| Gradient paint | Linear, radial, conic, and along-path gradients for any shape's fill or stroke | [Gradients as paint](02-color.md#gradients-as-paint) | [Color](../docs/drawing/color.md) |
| Palettes from a file | `loadPalettes` reads every palette in a file of hex codes, CSV or TSV, JSON, or Adobe `.ase` swatches, and `loadPalette` reads the first | [Palettes from a file](02-color.md#palettes-from-a-file) | [Color](../docs/drawing/color.md) |
| Accessibility | See your colors as the three kinds of color blindness see them, check that a palette's colors stay apart, and read the reduce-motion setting | [Will everybody see it?](02-color.md#will-everybody-see-it); Ch 3: [When somebody would rather it stopped: reduced motion](03-motionandtime.md#when-somebody-would-rather-it-stopped-reduced-motion) | [Accessibility](../docs/helpers/accessibility.md) |
| Spectral color | `Spectrum`: color as light by wavelength, `.paint` mixing where blue and yellow make green, blackbody light, and thin-film, diffraction, and paint-mix effects | [Blue and yellow make green: mixing in `.paint`](02-color.md#blue-and-yellow-make-green-mixing-in-paint), [Light by wavelength: `Spectrum`](02-color.md#light-by-wavelength-spectrum) | [Spectral color](../docs/drawing/spectrum.md) |
| Shades that drift | `Palette.shades` and `Ramp.shades` build a ramp of one color whose hue warms toward the light and cools into the shadow | [Shades that drift: `Palette.shades`](02-color.md#shades-that-drift-paletteshades) | [Color](../docs/drawing/color.md#shades) |
| Color distance | `distance(to:)` measures how far apart two colors look, in OKLab or by CIEDE2000; `CIELab` brings a swatch's numbers in; `nearest(to:)` finds the palette entry most like a color | [How far apart two colors look: `distance(to:)`](02-color.md#how-far-apart-two-colors-look-distanceto) | [Color](../docs/drawing/color.md#measuring) |

### Chapter 3: Motion and time

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| The clock | `time`, `deltaTime`, `frameCount`, and `frameRate`; `noLoop()` for a still | [The clock](03-motionandtime.md#the-clock); Ch 1: [It moves on its own](01-helloollin.md#it-moves-on-its-own); Ch 44: [Wallpaper and a menu-bar strip](44-handingitover.md#wallpaper-and-a-menu-bar-strip) | [Sketch](../docs/core/sketch.md) |
| Everyday math | `map`, `lerp`, `clamp`, `fract`, `step`, `smoothstep`, and `.tau` | [`map` and `lerp`: moving between ranges](03-motionandtime.md#map-and-lerp-moving-between-ranges), [The circle behind `sin`](03-motionandtime.md#the-circle-behind-sin), [Shaping time](03-motionandtime.md#shaping-time); Ch 11: [Putting it together: the wrecking ball](11-forcesandphysics.md#putting-it-together-the-wrecking-ball) | [Math](../docs/helpers/math.md) |
| Loop phases | `loopProgress` and `pingPong` turn the sketch clock into a cycle from 0 to 1 | [`map` and `lerp`: moving between ranges](03-motionandtime.md#map-and-lerp-moving-between-ranges) | [Math](../docs/helpers/math.md) |
| Easing | The catalog of curves, and `@Eased` and `@Sprung` values that glide or spring to what you assign | [A catalog of curves](03-motionandtime.md#a-catalog-of-curves), [Values that chase a target: `@Eased` and `@Sprung`](03-motionandtime.md#values-that-chase-a-target-eased-and-sprung) | [Animation](../docs/helpers/animation.md) |
| Perfect loops | Declare `loopDuration`, and `--export-loop` renders one lap that ends where it began | [Putting it together: a loop that never ends](03-motionandtime.md#putting-it-together-a-loop-that-never-ends); Ch 41: [Motion: video and GIF](41-finishingasketch.md#motion-video-and-gif) | [Export](../docs/output/export.md) |
| Sway | `sway` moves a value from one end of a range to the other and back once per lap, along one of five paths; `wave` names the parts of a sine | [The sway you write over and over: `sway`](03-motionandtime.md#the-sway-you-write-over-and-over-sway) | [Animation](../docs/helpers/animation.md#sway) |
| `Timeline` | Keyframes with easing on each segment, for sequences you choreograph | [Choreography: `Timeline`](03-motionandtime.md#choreography-timeline) | [Animation](../docs/helpers/animation.md) |
| Timers | `every`, `after`, and `everyFrames` say whether a moment has arrived, for events like adding a dot every two seconds | [Doing something now and then: `every`, `after`, and `everyFrames`](03-motionandtime.md#doing-something-now-and-then-every-after-and-everyframes) | [Animation](../docs/helpers/animation.md#timers) |
| Knowing an export | `isExporting` is true from `setup()` to the last frame written in any export, so work spread over live frames is done at once | [When every frame is written: `isExporting`](03-motionandtime.md#when-every-frame-is-written-isexporting) | [Sketch](../docs/core/sketch.md#isExporting) |

### Chapter 4: Randomness

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Random | Seeded `random`, Gaussian values, choices plain and weighted, and shuffles | [Rolling dice](04-randomness.md#rolling-dice), [Seeds: randomness you can keep](04-randomness.md#seeds-randomness-you-can-keep), [Letting chance decide](04-randomness.md#letting-chance-decide), [Two shapes of chance: uniform and Gaussian](04-randomness.md#two-shapes-of-chance-uniform-and-gaussian) | [Random](../docs/generators/random.md) |
| Variations | `variation`: the seed a run grew from, stepped and rolled from the inspector's Variation card | [Finding a seed to keep](04-randomness.md#finding-a-seed-to-keep) | [Variations](../docs/core/variations.md) |
| Keyboard | `key`, `keyCode` with its typed `KeyCode` values, `isKeyDown(_:)`, and the press and release hooks | [Finding a seed to keep](04-randomness.md#finding-a-seed-to-keep); Ch 31: [Someone to be in there: the character controller](31-charactersandcloth.md#someone-to-be-in-there-the-character-controller) | [Input](../docs/helpers/input.md) |
| Contact sheets | `--export-grid` tiles one frame per seed into a labeled sheet, and `--seed` renders the one you keep | [Finding a seed to keep](04-randomness.md#finding-a-seed-to-keep); Ch 41: [Picking a keeper: a contact sheet and a fixed seed](41-finishingasketch.md#picking-a-keeper-a-contact-sheet-and-a-fixed-seed) | [Variations](../docs/core/variations.md) |
| Random walks | `randomWalk`, a tangle that pools in one patch; `levyFlight`, tight clusters joined by long jumps; and `selfAvoidingWalk`, a path on a grid that never enters a cell twice and fills its region | [Three walks, three rules: `randomWalk`, `levyFlight`, and `selfAvoidingWalk`](04-randomness.md#three-walks-three-rules-randomwalk-levyflight-and-selfavoidingwalk), [The random walk, by hand](04-randomness.md#the-random-walk-by-hand) | [Walks](../docs/generators/walks.md) |
| Markov chains | `MarkovChain` from a drawing sketch: a pick whose odds follow the last pick, with the table declared by hand | [A roll that remembers the last one: `MarkovChain`](04-randomness.md#a-roll-that-remembers-the-last-one-markovchain); Ch 40: [What comes next: a `MarkovChain`](40-musicbyrule.md#what-comes-next-a-markovchain) | [Random](../docs/generators/random.md#markovchain) |
| Blue noise | Poisson-disk scatter: points at random, but kept a set distance apart | [Darts that keep their distance: `poissonDisk`](04-randomness.md#darts-that-keep-their-distance-poissondisk) | [BlueNoise](../docs/generators/bluenoise.md) |
| Low-discrepancy sampling | Halton and Sobol points: even at any count, and adding points never moves the ones already placed | [Points that never move: `haltonPoints` and `sobolPoints`](04-randomness.md#points-that-never-move-haltonpoints-and-sobolpoints) | [LowDiscrepancy](../docs/generators/lowdiscrepancy.md) |
| Breeding by eye | `Population` and `Genome`: a handful of genomes, bred from the ones you pick | [Sixteen things and no opinion about them: `Population`](04-randomness.md#sixteen-things-and-no-opinion-about-them-population) | [Evolution](../docs/simulation/evolution.md#population) |

### Chapter 5: Noise

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Noise | `noise`, `signedNoise`, the `loop:` forms that come back to their start (a value, a line, a field, or a volume), and layered `fbm`; `curlNoise` and `curlField`; `noiseFields` for work off the main thread | [Random that remembers: `noise`](05-noise.md#random-that-remembers-noise), [Drift that swings: `signedNoise`](05-noise.md#drift-that-swings-signednoise), [Coming home: the `loop:` argument](05-noise.md#coming-home-the-loop-argument), [Layering shape and detail: `fbm`](05-noise.md#layering-shape-and-detail-fbm); Ch 14: [Points the field carries: advection](14-fieldsandflow.md#points-the-field-carries-advection) | [Noise](../docs/generators/noise.md) |
| The noise family | `simplexNoise`, cellular `worley` (the nearest point, the second nearest, or the border between), `ridgedFbm`, `turbulence`, and `warpedFbm`, all pinned by `noiseSeed`; `gaborNoise`, which takes a `seed:` of its own; and `tilingFbm` for a texture that wraps | [A family of fields](05-noise.md#a-family-of-fields); Ch 27: [A picture from three sides: triplanar](27-meshes.md#a-picture-from-three-sides-triplanar) | [Noise](../docs/generators/noise.md) |

### Chapter 6: Grids and repetition

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| `Grid` | Rows, columns, padding, and gutters in one loop instead of two | [One loop, not two: `grid`](06-gridsandrepetition.md#one-loop-not-two-grid) | [Geometry](../docs/drawing/geometry.md) |
| Transforms and the state stack | `translate`/`rotate`/`scale`, scoped with `withState { }` | [Moving the paper: `translate`, `rotate`, and `scale`](06-gridsandrepetition.md#moving-the-paper-translate-rotate-and-scale), [Symmetry by hand: rotating around the center](06-gridsandrepetition.md#symmetry-by-hand-rotating-around-the-center) | [Drawing](../docs/drawing/drawing.md) |
| Kaleidoscope symmetry | `symmetry(n, mirrored:)` repeats your 2D drawing in n wedges around the origin, with a mirrored copy in each when you ask | [The fold, done for you: `symmetry`](06-gridsandrepetition.md#the-fold-done-for-you-symmetry) | [Drawing](../docs/drawing/drawing.md#symmetry) |
| Rectangles and circles | `Rectangle` and `Circle` as regions: a clip, a text box, insetting, and hit testing | [Drawing inside a shape: `withClip`](06-gridsandrepetition.md#drawing-inside-a-shape-withclip); Ch 8: [Both edges flush: the box form and justification](08-words.md#both-edges-flush-the-box-form-and-justification) | [Geometry](../docs/drawing/geometry.md) |
| Clipping | `withClip(shape) { }`: drawing inside the block lands only within the region; nesting intersects | [Drawing inside a shape: `withClip`](06-gridsandrepetition.md#drawing-inside-a-shape-withclip) | [Drawing](../docs/drawing/drawing.md#clip) |
| A view box | `withViewBox` clips to a region and moves the coordinates too, so the block inside draws as though the region were the canvas | [A cell that is a whole canvas: `withViewBox`](06-gridsandrepetition.md#a-cell-that-is-a-whole-canvas-withviewbox) | [Drawing](../docs/drawing/drawing.md#viewbox) |
| Hex and triangle grids | The other regular grids, with hex distance, neighbors, and picking the cell under a point | [Grids that aren't square: `hexGrid` and `triangleGrid`](06-gridsandrepetition.md#grids-that-arent-square-hexgrid-and-trianglegrid) | [Tiling](../docs/drawing/tiling.md) |
| Recursive subdivision | `subdivide`: uneven panels from splitting the canvas again and again, in halves or in quarters | [Uneven panels by recursion: `subdivide`](06-gridsandrepetition.md#uneven-panels-by-recursion-subdivide) | [Tiling](../docs/drawing/tiling.md) |
| Ulam spiral | The counting numbers written in a square spiral, so a test on each one becomes a picture, and the primes fall on diagonals | [Walking a grid: numbers in a spiral](06-gridsandrepetition.md#walking-a-grid-numbers-in-a-spiral) | [UlamSpiral](../docs/generators/ulamspiral.md) |

### Chapter 7: Tiles that cover the plane

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Truchet tiles | `drawTruchet` puts one tile in each cell at a random turn, and loops and mazes appear; `truchet` hands back the strands as values | [Tiles that agree at their edges: Truchet](07-tiles.md#tiles-that-agree-at-their-edges-truchet), [Strands as values: `truchet`](07-tiles.md#strands-as-values-truchet) | [Truchet](../docs/drawing/truchet.md) |
| Ten print | One of two diagonals in each cell by a coin flip, joined into the long paths they form | [The diagonal tile: ten print](07-tiles.md#the-diagonal-tile-ten-print) | [TenPrint](../docs/drawing/tenprint.md) |
| Hitomezashi stitching | One bit per grid line sets where its dashes start; stitches and a two-tone cloth appear | [One coin per line: hitomezashi](07-tiles.md#one-coin-per-line-hitomezashi) | [Hitomezashi](../docs/drawing/hitomezashi.md) |
| Mazes | Perfect mazes, with one route between any two cells, carved three ways and drawn as line work | [One route between any two: perfect mazes](07-tiles.md#one-route-between-any-two-perfect-mazes) | [Tiling](../docs/drawing/tiling.md) |
| Kolam and sona | One line bounced around a field of dots until it closes, in gcd(rows, columns) loops, with walls to steer the count | [No coins at all: kolam and sona](07-tiles.md#no-coins-at-all-kolam-and-sona) | [Kolam](../docs/drawing/kolam.md) |
| Celtic knotwork | The same line given width and an over-under rule, its bands broken where each cord passes under | [The same line, woven: Celtic knotwork](07-tiles.md#the-same-line-woven-celtic-knotwork) | [Knotwork](../docs/drawing/knotwork.md) |
| Polyominoes | Pieces of joined squares, the twelve pentominoes, and a search that fits a set of them into a region exactly or says it cannot | [Pieces that have to fit: polyominoes](07-tiles.md#pieces-that-have-to-fit-polyominoes) | [Polyominoes](../docs/generators/polyominoes.md) |
| Wave Function Collapse | Tiles with labeled edges solved by constraint propagation, or a texture learned from a small sample picture | [Every neighbor must agree: Wave Function Collapse](07-tiles.md#every-neighbor-must-agree-wave-function-collapse), [Or hand it a picture instead: overlapping WFC](07-tiles.md#or-hand-it-a-picture-instead-overlapping-wfc) | [WaveFunctionCollapse](../docs/generators/wavefunctioncollapse.md) |
| Aperiodic tilings | Penrose kites/darts and rhombs with matching-rule arcs, Wang edge-matching quilts, girih star patterns over any polygons, and the spectre (the einstein) | [Tiles that never repeat: aperiodic tilings](07-tiles.md#tiles-that-never-repeat-aperiodic-tilings) | [Aperiodic tilings](../docs/drawing/aperiodictilings.md) |
| De Bruijn sequences | A cyclic run holding every window of a given length exactly once, with the reader that turns a window back into a position | [Every window once: de Bruijn sequences](07-tiles.md#every-window-once-de-bruijn-sequences) | [De Bruijn sequences](../docs/generators/debruijn.md) |
| Hyperbolic tiling | Regular polygons meeting more to a corner than flat paper allows, drawn in the Poincaré disk, with a checkerboard by parity, rings by depth, and a viewpoint you can pan | [More room than the page has: hyperbolic tiling](07-tiles.md#more-room-than-the-page-has-hyperbolic-tiling) | [Hyperbolic tiling](../docs/drawing/hyperbolictiling.md) |
| Parquet deformations | A tiling whose tile changes shape as you read across it, the geometry carried on the lattice's shared edges so nothing comes apart | [A tile that changes as you read: parquet deformations](07-tiles.md#a-tile-that-changes-as-you-read-parquet-deformations) | [Parquet deformations](../docs/drawing/parquetdeformation.md) |

### Chapter 8: Words

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Drawing text | `drawText` with size, alignment, wrapping in a box, justification, and text along a path | [Saying something: `drawText`](08-words.md#saying-something-drawtext), [Both edges flush: the box form and justification](08-words.md#both-edges-flush-the-box-form-and-justification), [Letters that move: `drawText` with a closure](08-words.md#letters-that-move-drawtext-with-a-closure) | [Text](../docs/drawing/text.md) |
| Three font kinds | Outline (any installed font), bitmap, and plotter stroke fonts | [Three kinds of letters: outline, bitmap, and stroke fonts](08-words.md#three-kinds-of-letters-outline-bitmap-and-stroke-fonts) | [Text](../docs/drawing/text.md) |
| Text as geometry | `textToShapes`: letters become `Shape`s you can warp, resample, and rebuild | [Text as geometry: `textToShapes`](08-words.md#text-as-geometry-texttoshapes) | [Text](../docs/drawing/text.md) |
| Letters one at a time | `drawText` with a closure runs your code once per letter, so each one can move, turn, or change color | [Letters that move: `drawText` with a closure](08-words.md#letters-that-move-drawtext-with-a-closure) | [Text](../docs/drawing/text.md#perglyph) |
| Every script, and columns | Arabic, Devanagari, Thai, and Japanese shaped by the system; columns down the page that fill right to left, as Japanese does, or left to right, as Mongolian does; and hanging punctuation at the edge of a box | [Shaping and direction: text in any script](08-words.md#shaping-and-direction-text-in-any-script), [Down the page: vertical text](08-words.md#down-the-page-vertical-text), [Both edges flush: the box form and justification](08-words.md#both-edges-flush-the-box-form-and-justification) | [Text](../docs/drawing/text.md#every-script) |
| Missing letters | `fontsUsed(for:)` names the faces a line of text borrowed, and `textMissingCharacters` lists the characters the current font cannot draw | [What the font could not do: `fontsUsed` and `textMissingCharacters`](08-words.md#what-the-font-could-not-do-fontsused-and-textmissingcharacters) | [Text](../docs/drawing/text.md#missing) |

### Chapter 9: Pictures and data

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Images | Load PNG, JPEG, HEIC, and more; draw, tint, scale, and crop them, fit one into a box of another shape, and draw one cell of a sprite sheet | [A picture on the canvas: `loadImage` and `drawImage`](09-pictures.md#a-picture-on-the-canvas-loadimage-and-drawimage), [A working copy: `resized` and `cropped`](09-pictures.md#a-working-copy-resized-and-cropped), [The box is never the right shape: `fit`](09-pictures.md#the-box-is-never-the-right-shape-fit) | [Images](../docs/drawing/images.md) |
| Sample photographs | Twenty bundled pictures and a short film, with their credits, to try a technique on | [A working copy: `resized` and `cropped`](09-pictures.md#a-working-copy-resized-and-cropped); Ch 34: [When there is no camera: stills and footage](34-seeing.md#when-there-is-no-camera-stills-and-footage) | [Sample photographs](../docs/drawing/samplephotos.md) |
| Pixels | Read and write a pixel with `image[x, y]`, and build an image from nothing | [An image you can ask: `image[x, y]`](09-pictures.md#an-image-you-can-ask-imagex-y) | [Images](../docs/drawing/images.md) |
| Atlas text | `textMode(.atlas)` draws a lot of text quickly | [Putting it together: a picture painted with type](09-pictures.md#putting-it-together-a-picture-painted-with-type) | [Text](../docs/drawing/text.md) |
| Files dropped on the window | `filesDropped()` runs when files land on the window, and `droppedFiles()` hands over their paths | [A picture you drop on the window](09-pictures.md#a-picture-you-drop-on-the-window) | [Input](../docs/helpers/input.md#droppedFiles) |
| Seam carving | A picture made narrower or wider by taking away or duplicating the paths that carry the least, so what carries texture keeps its shape | [Making it narrower without squashing it: seam carving](09-pictures.md#making-it-narrower-without-squashing-it-seam-carving) | [SeamCarving](../docs/drawing/seamcarving.md) |
| Palettes from a picture | `Palette(extractedFrom:)` pulls a palette out of a photograph | [Palettes from a photograph](09-pictures.md#palettes-from-a-photograph) | [Color](../docs/drawing/color.md) |
| Histograms | `histogram(of:)` counts a picture's pixels by lightness or by one channel, and `percentile(_:)` reads its working black and white | [Palettes from a photograph](09-pictures.md#palettes-from-a-photograph) | [Color](../docs/drawing/color.md#measuring) |
| Dithering | `dithered` rebuilds a picture in fewer colors, scattering the ones it has so the eye reads the tones between | [Fewer colors than the picture needs: dithering](09-pictures.md#fewer-colors-than-the-picture-needs-dithering) | [Color](../docs/drawing/color.md#dithering) |
| A small picture drawn big | `imageSampling(.nearest)` keeps every pixel a hard square when a picture is drawn larger than it is, with no enlarged copy | [Drawn big, cell by cell](09-pictures.md#drawn-big-cell-by-cell-imagesampling) | [Images](../docs/drawing/images.md#imagesampling) |
| Glyph mosaic | A picture rebuilt as a grid of characters, each chosen by its measured ink in the active font | [One mark per cell: `drawGlyphMosaic` and `drawHalftone`](09-pictures.md#one-mark-per-cell-drawglyphmosaic-and-drawhalftone) | [GlyphMosaic](../docs/drawing/glyphmosaic.md) |
| Halftone | A picture as a print's dot screen: each dot sized to its tone on a turned grid, drawn as circles a plotter can follow | [One mark per cell: `drawGlyphMosaic` and `drawHalftone`](09-pictures.md#one-mark-per-cell-drawglyphmosaic-and-drawhalftone) | [Halftone](../docs/drawing/halftone.md) |
| Photo mosaic | A picture rebuilt out of many smaller pictures, each cell taking the nearest by average color | [A picture made of pictures](09-pictures.md#a-picture-made-of-pictures) | [Photo mosaic](../docs/drawing/photomosaic.md) |
| Stippling | Dots packed to match a picture's tone (weighted Voronoi) | [A picture as one line: stippling, `singleLine`, and `spanningTree`](09-pictures.md#a-picture-as-one-line-stippling-singleline-and-spanningtree) | [Stippling](../docs/generators/stippling.md) |
| Single-line drawing | One unbroken tour through a stipple: the picture as a single closed line (TSP art) | [A picture as one line: stippling, `singleLine`, and `spanningTree`](09-pictures.md#a-picture-as-one-line-stippling-singleline-and-spanningtree) | [SingleLine](../docs/generators/singleline.md) |
| Spanning-tree drawing | The same stipple joined by the minimum spanning tree: the picture as branching veins | [A picture as one line: stippling, `singleLine`, and `spanningTree`](09-pictures.md#a-picture-as-one-line-stippling-singleline-and-spanningtree) | [SpanningTree](../docs/generators/spanningtree.md) |
| Hilbert order | The same stipple sorted along a space-filling curve: one line by a single sort, neighbors kept together | [A picture as one line: stippling, `singleLine`, and `spanningTree`](09-pictures.md#a-picture-as-one-line-stippling-singleline-and-spanningtree) | [Hilbert order](../docs/generators/hilbertorder.md) |
| String art | One continuous thread over rim pins, each chord wound toward the darkness that remains | [A picture wound from thread: `StringArt`](09-pictures.md#a-picture-wound-from-thread-stringart) | [StringArt](../docs/generators/stringart.md) |
| Pixel sorting | Runs of a picture's own pixels, bounded by brightness, reordered into streaks | [Sorting the pixels](09-pictures.md#sorting-the-pixels) | [PixelSorting](../docs/drawing/pixelsorting.md) |
| Autostereogram | A depth map hidden in a repeating pattern, so a surface nobody drew stands out of the page | [A picture that hides a shape](09-pictures.md#a-picture-that-hides-a-shape) | [Autostereogram](../docs/drawing/autostereogram.md) |
| Tables and JSON | `loadTable` reads a CSV or TSV with typed reads by column name and `numbers(_:)` for a whole column; `loadJSON` reads a document by name and index | [Reading a table: `loadTable`](09-pictures.md#reading-a-table-loadtable), [From numbers to marks](09-pictures.md#from-numbers-to-marks), [Documents with a shape: `loadJSON`](09-pictures.md#documents-with-a-shape-loadjson) | [Data](../docs/helpers/data.md) |

## Part II: Systems that come alive

### Chapter 10: Vectors, gently

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Vectors | `Vector2` and `Vector3`, with operators for adding and scaling, `length`, `normalized`, `lerp`, `rotated`, and `with(x:)` for a copy with one part changed | [An arrow you can draw: `Vector2`](10-vectors.md#an-arrow-you-can-draw-vector2), [Arrow arithmetic: adding, subtracting, scaling, and dividing](10-vectors.md#arrow-arithmetic-adding-subtracting-scaling-and-dividing), [A point part of the way: `lerp(to:)`](10-vectors.md#a-point-part-of-the-way-lerpto), [Length and direction: `length`, `normalized`, and `limited(to:)`](10-vectors.md#length-and-direction-length-normalized-and-limitedto), [Position, velocity, acceleration](10-vectors.md#position-velocity-acceleration); Ch 26: [Where things are in the world: Vector3 and world units](26-3dgently.md#where-things-are-in-the-world-vector3-and-world-units) | [Geometry](../docs/drawing/geometry.md) |
| Arrows | `drawArrow(from:to:)` draws a vector as an arrow, with a head you can size | [An arrow you can draw: `Vector2`](10-vectors.md#an-arrow-you-can-draw-vector2) | [Drawing](../docs/drawing/drawing.md#arrow) |

### Chapter 11: Forces and physics

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Soft physics | Verlet particles and springs, with disk collisions: ropes, cloth, and blobs | [A world that pushes back: `World` and particles](11-forcesandphysics.md#a-world-that-pushes-back-world-and-particles), [Springs: `connect`, rest length, and `pin`](11-forcesandphysics.md#springs-connect-rest-length-and-pin) | [Physics](../docs/simulation/physics.md) |
| Rigid physics | Bodies, colliders, and joints in the same `World`: stacks, chains, and hinged arms | [Rigid bodies: `Body` and colliders](11-forcesandphysics.md#rigid-bodies-body-and-colliders), [Hinges and a handle: `.revolute` and `grab`](11-forcesandphysics.md#hinges-and-a-handle-revolute-and-grab) | [Physics](../docs/simulation/physics.md) |
| Grabbing | `grab`: pull a rigid body with the mouse, through a joint | [Hinges and a handle: `.revolute` and `grab`](11-forcesandphysics.md#hinges-and-a-handle-revolute-and-grab) | [Physics](../docs/simulation/physics.md) |
| Fracture | Breaking a shape or a solid into pieces that fit back together, evenly or crowded around a point of impact, each piece ready to be a rigid body | [Breaking things](11-forcesandphysics.md#breaking-things); Ch 30: [What hit what: contacts](30-worldswithweight.md#what-hit-what-contacts) | [Fracture](../docs/generators/fracture.md) |
| Inverse kinematics | `IKChain`: a segmented limb that reaches for a target, or a rope dragged by its tip | [A limb that reaches: `IKChain`](11-forcesandphysics.md#a-limb-that-reaches-ikchain) | [Motion](../docs/simulation/motion.md) |
| Gravity at scale | `NBody`: thousands of bodies pulling on each other, with seeded disk and cluster scenes | [Gravity at scale: `NBody`](11-forcesandphysics.md#gravity-at-scale-nbody) | [Motion](../docs/simulation/motion.md) |
| Force-directed layout | `ForceLayout`: a graph that untangles itself into an even web you can grow, pin, and drag, drawn with `drawGraph` | [A graph that lays itself out: `ForceLayout`](11-forcesandphysics.md#a-graph-that-lays-itself-out-forcelayout) | [ForceLayout](../docs/generators/forcelayout.md) |
| Soft bodies from outlines | `addSoftBody(from:)`: any closed `Shape` as a squishy body that keeps its area, springs back toward its shape, and keeps other outlines out | [A squishy thing from any outline: `addSoftBody(from:)`](11-forcesandphysics.md#a-squishy-thing-from-any-outline-addsoftbodyfrom) | [Physics](../docs/simulation/physics.md#soft-bodies) |

### Chapter 12: Flocks and swarms

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Steering vehicles | Seek, flee, arrive, pursue, wander, follow, and contain, as forces you add together | [A creature that steers: `Vehicle`](12-flocksandswarms.md#a-creature-that-steers-vehicle), [Seek and arrive: aiming at a target and stopping there](12-flocksandswarms.md#seek-and-arrive-aiming-at-a-target-and-stopping-there), [Roaming: `wander`, and trails from `noClear`](12-flocksandswarms.md#roaming-wander-and-trails-from-noclear); Ch 10: [Steering: the chase](10-vectors.md#steering-the-chase) | [Steering](../docs/generators/steering.md) |
| Flocking | Boids from separation, alignment, and cohesion, which can also follow a field | [The flock, assembled: `Boids`](12-flocksandswarms.md#the-flock-assembled-boids), [Three rules make a flock: separation, alignment, and cohesion](12-flocksandswarms.md#three-rules-make-a-flock-separation-alignment-and-cohesion) | [Boids](../docs/generators/boids.md) |
| Spatial index | What is nearest, what is within reach, and what is inside a box, found without reading every point | [The trick that keeps it cheap: `SpatialIndex`](12-flocksandswarms.md#the-trick-that-keeps-it-cheap-spatialindex) | [Spatial index](../docs/drawing/spatialindex.md) |
| Pursuit | Runners that each head at the one they chase: the ring of dogs, whose paths are logarithmic spirals, and a pursuer after a quarry that runs straight | [Everyone chasing somebody: pursuit curves](12-flocksandswarms.md#everyone-chasing-somebody-pursuit-curves) | [Pursuit](../docs/generators/pursuit.md) |
| Crowds | `Crowd`: walkers that avoid each other by each taking half of every swerve, walls no walker passes, even in a jam, and lanes that form on their own | [A crowd that makes room: `Crowd`](12-flocksandswarms.md#a-crowd-that-makes-room-crowd) | [Crowds](../docs/simulation/crowds.md) |
| Coupled oscillators | `Kuramoto`: oscillators that fall into step past a critical coupling, with `coherence` to watch it happen; each one listens to the whole crowd, or to its neighbors on a ring, a square or hex lattice, or a graph of your own | [Falling into step: `Kuramoto`](12-flocksandswarms.md#falling-into-step-kuramoto); Ch 24: [In step with the neighbors: oscillators on a lattice](24-automata.md#in-step-with-the-neighbors-oscillators-on-a-lattice) | [Coupled oscillators](../docs/simulation/oscillators.md) |

### Chapter 13: Growing things

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| L-systems | Grammar rewriting drawn by a turtle, for ferns and other plants, and parametric rules that carry numbers | [Rules that rewrite: L-systems](13-growingthings.md#rules-that-rewrite-l-systems), [When the rules need arithmetic: parametric L-systems](13-growingthings.md#when-the-rules-need-arithmetic-parametric-l-systems) | [LSystem](../docs/generators/lsystem.md) |
| Space colonization | Branching growth toward scattered attraction points, as in the veins of a leaf | [Growth that claims space: space colonization](13-growingthings.md#growth-that-claims-space-space-colonization) | [SpaceColonization](../docs/generators/spacecolonization.md) |
| Diffusion-limited aggregation | Walkers that freeze on contact into dendrites and frost | [Growth by chance: diffusion-limited aggregation](13-growingthings.md#growth-by-chance-diffusion-limited-aggregation) | [DiffusionLimitedAggregation](../docs/generators/diffusionlimitedaggregation.md) |
| Shape grammars | Rules over labeled shapes in place: ice-ray lattices, building fronts, nested figures | [Rules over shapes, not symbols: shape grammars](13-growingthings.md#rules-over-shapes-not-symbols-shape-grammars) | [ShapeGrammar](../docs/generators/shapegrammar.md) |
| Dielectric breakdown | Lightning grown where the solved field is strongest, with `eta` choosing between a bush and a bolt | [Growth by voltage: dielectric breakdown](13-growingthings.md#growth-by-voltage-dielectric-breakdown) | [DielectricBreakdown](../docs/generators/dielectricbreakdown.md) |
| Differential growth | A line that folds like coral as it grows, because it pushes away from itself | [Growth by crowding: differential growth](13-growingthings.md#growth-by-crowding-differential-growth) | [DifferentialGrowth](../docs/generators/differentialgrowth.md) |
| Crack growth | Perpendicular cracks subdividing the plane into city blocks, with a wash of translucent grains beside each crack | [Growth by collision: crack growth](13-growingthings.md#growth-by-collision-crack-growth) | [CrackGrowth](../docs/generators/crackgrowth.md) |
| Meander | A river migrating by curvature, cutting off oxbow lakes, and keeping its past channels as `scars` | [Growth by wandering: meander](13-growingthings.md#growth-by-wandering-meander) | [Meander](../docs/generators/meander.md) |

### Chapter 14: Fields and flow

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Flow fields | Direction fields, streamlines (free and evenly spaced), advection | [A direction at every point: `FlowField`](14-fieldsandflow.md#a-direction-at-every-point-flowfield), [Following the flow: streamlines](14-fieldsandflow.md#following-the-flow-streamlines), [Lines that keep their distance: evenly spaced streamlines](14-fieldsandflow.md#lines-that-keep-their-distance-evenly-spaced-streamlines), [Points the field carries: advection](14-fieldsandflow.md#points-the-field-carries-advection) | [FlowField](../docs/generators/flowfield.md) |
| Isolines | Level curves of any field or an image's tone (marching squares): metaball outlines, contour maps | [Where the field equals something: contours](14-fieldsandflow.md#where-the-field-equals-something-contours) | [Isolines](../docs/generators/isolines.md) |
| Chladni figures | The standing-wave patterns of a driven plate in closed form, as a field, a generator, or nodal contours | [Standing waves: Chladni figures](14-fieldsandflow.md#standing-waves-chladni-figures); Ch 18: [Closed forms at every pixel: the pattern fields](18-yourfirstshader.md#closed-forms-at-every-pixel-the-pattern-fields) | [Chladni](../docs/generators/chladni.md) |
| Line integral convolution | `.lineIntegralConvolution(length:field:)` and `.streaked(along:length:field:)` brush a layer's grain, or a picture, along a direction field, so the whole field shows at once as fine streaks | [The whole field at once: line integral convolution](14-fieldsandflow.md#the-whole-field-at-once-line-integral-convolution) | [Effects](../docs/drawing/effects.md) |
| Fitting | `RadialBasis`, a smooth field of numbers, vectors, or colors that passes through values you know at a few scattered places, and `Fit.minimize`, a downhill walk that finds a few numbers against a cost you write | [A field you pin down yourself: radial basis functions](14-fieldsandflow.md#a-field-you-pin-down-yourself-radial-basis-functions); Ch 15: [The circle they were scattered around: `Fit.minimize`](15-shapesasmaterial.md#the-circle-they-were-scattered-around-fitminimize) | [Fitting](../docs/drawing/fitting.md) |
| Slopes | A fitted field's exact `gradient(at:)` and `derivative(at:along:)`, and `gradient(at:field:)` and `derivative(at:function:)` for any function you write | [A field you pin down yourself: radial basis functions](14-fieldsandflow.md#a-field-you-pin-down-yourself-radial-basis-functions); Appendix B: [A number field's slope: the gradient](b-justenoughmath.md#a-number-fields-slope-the-gradient) | [Fitting](../docs/drawing/fitting.md#slopes), [Math](../docs/helpers/math.md#slopes) |

## Part III: Shapes, lines, and marks

### Chapter 15: Shapes as material

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Paths, shapes, and contours | Curved outlines you build, hold, and edit, and respace with `resampled` | [Contours, shapes, and holes](15-shapesasmaterial.md#contours-shapes-and-holes); Ch 8: [Text as geometry: `textToShapes`](08-words.md#text-as-geometry-texttoshapes) | [Geometry](../docs/drawing/geometry.md) |
| Shape booleans and offsets | Union, intersect, subtract, xor; grow and shrink regions | [Shape arithmetic: the booleans](15-shapesasmaterial.md#shape-arithmetic-the-booleans), [Growing, shrinking, and thickening: `offset` and `stroked`](15-shapesasmaterial.md#growing-shrinking-and-thickening-offset-and-stroked) | [Geometry](../docs/drawing/geometry.md) |
| Stroke as shape | Turn a stroked line into a filled region for booleans and plotting | [Growing, shrinking, and thickening: `offset` and `stroked`](15-shapesasmaterial.md#growing-shrinking-and-thickening-offset-and-stroked) | [Geometry](../docs/drawing/geometry.md) |
| Voronoi and Delaunay | Territories and neighbor networks from points, with Lloyd relaxation | [Territories and neighbors: Voronoi and Delaunay](15-shapesasmaterial.md#territories-and-neighbors-voronoi-and-delaunay) | [Voronoi](../docs/drawing/voronoi.md) |
| Power diagrams | Voronoi cells for points that carry a weight, so the line between two circles falls where a point is equally far outside both, and a circle that touches no other sits inside its own cell | [Territories and neighbors: Voronoi and Delaunay](15-shapesasmaterial.md#territories-and-neighbors-voronoi-and-delaunay) | [Voronoi and Delaunay](../docs/drawing/voronoi.md) |
| Hulls | The convex hull, the rubber band around a point set, and the tighter wraps: the concave hull and the alpha shape, with its islands and holes | [What shape are these points? Hulls and alpha shapes](15-shapesasmaterial.md#what-shape-are-these-points-hulls-and-alpha-shapes) | [Geometry](../docs/drawing/geometry.md), [Hulls](../docs/generators/hulls.md) |
| Medial axis | A shape reduced to its skeleton, each point carrying the radius of the largest circle that fits there | [The skeleton inside: the medial axis](15-shapesasmaterial.md#the-skeleton-inside-the-medial-axis) | [MedialAxis](../docs/generators/medialaxis.md) |
| Hatching | `Hatching(spacing:angle:crossHatches:)` fills a shape with lines a pen can draw | [Lines for a pen: hatching](15-shapesasmaterial.md#lines-for-a-pen-hatching) | [Export](../docs/output/export.md#hatching-solid-fills-for-a-pen-plotter) |
| Outline questions | Tangent, normal, nearest point, the piece between two fractions, crossings, simplify, and rounded or cut corners | [Asking an outline where it goes: contour questions](15-shapesasmaterial.md#asking-an-outline-where-it-goes-contour-questions) | [Geometry](../docs/drawing/geometry.md#contour-questions) |
| Bending outlines | An outline bent along a curve, pulled toward a point with its ends held, smoothed with its corners kept, cut into pieces at its corners, and traced into a few cubic curves | [Bending an outline: warped, pulled, split, and fitted](15-shapesasmaterial.md#bending-an-outline-warped-pulled-split-and-fitted) | [Geometry](../docs/drawing/geometry.md#contour-bending) |
| A curved patch | A four-sided region whose sides are curves (or four corners, the bilinear map), and an outline bent into it from a rectangle, such as lettering on a waving banner | [Bending an outline into a patch: `CoonsPatch`](15-shapesasmaterial.md#bending-an-outline-into-a-patch-coonspatch) | [Geometry](../docs/drawing/geometry.md#coons-patch) |
| Enclosed regions | Every patch a drawing's lines wall off, each as its own `Shape`, holes included, with `Circle.contour(segments:)` and `Rectangle.contour` as the ways in | [The regions a drawing encloses: `regions(enclosedBy:)`](15-shapesasmaterial.md#the-regions-a-drawing-encloses-regionsenclosedby) | [Geometry](../docs/drawing/geometry.md#regions) |
| Points inside a shape | `randomPoints(in:count:)` and `poissonDisk(in:radius:)` scatter points inside an outline, and `randomPoints(along:count:)` along it | [Chance inside an outline: points in a shape](15-shapesasmaterial.md#chance-inside-an-outline-points-in-a-shape) | [Geometry](../docs/drawing/geometry.md#shape-points), [BlueNoise](../docs/generators/bluenoise.md#shape) |
| Shapes that cross | `LineSegment`, `Arc`, and `Ellipse` as values beside `Circle` and `Rectangle`, each with its measures and its nearest point, and `crossings(with:)` between any two of them through `PlaneCurve` | [Shapes that know where they cross: segments, arcs, and ellipses](15-shapesasmaterial.md#shapes-that-know-where-they-cross-segments-arcs-and-ellipses) | [Geometry](../docs/drawing/geometry.md#plane-curves) |
| Circle packing | Circles that grow until they touch, seeded so a run repeats | [Packing: circles that grow until they touch](15-shapesasmaterial.md#packing-circles-that-grow-until-they-touch) | [Packing](../docs/generators/packing.md) |
| Apollonian gasket | A circle filled with circles that touch, smaller and smaller down to a size you set | [Packing: circles that grow until they touch](15-shapesasmaterial.md#packing-circles-that-grow-until-they-touch) | [Tiling](../docs/drawing/tiling.md) |
| Ford circles | A circle for each fraction, touching its neighbors and overlapping none, over the Farey sequence, with a `Fraction` type | [A circle for every fraction: Ford circles](15-shapesasmaterial.md#a-circle-for-every-fraction-ford-circles) | [Ford circles](../docs/generators/fordcircles.md) |
| Shape packing | Packing measured against the shapes' outlines, so small shapes settle into a star's notches, all at once or filled in over time | [Packing shapes, not circles](15-shapesasmaterial.md#packing-shapes-not-circles) | [ShapePacking](../docs/generators/shapepacking.md) |
| Rectangle packing | Rectangles of given sizes fitted into one bin at their own sizes, the placed and the ones that did not fit, with rotation as an option, for a contact sheet, a collage, or an atlas | [Packing rectangles: `packRectangles`](15-shapesasmaterial.md#packing-rectangles-packrectangles) | [RectanglePacking](../docs/generators/rectanglepacking.md) |
| Straight skeleton | The ridges a shrinking outline leaves, with mitered insets cut from one build | [The straight skeleton](15-shapesasmaterial.md#the-straight-skeleton) | [StraightSkeleton](../docs/generators/straightskeleton.md) |
| SVG import | Vector artwork read into shapes: draw it as authored, or use its outlines as geometry | [Shapes from a file: SVG import](15-shapesasmaterial.md#shapes-from-a-file-svg-import) | [SVG](../docs/drawing/svg.md) |
| Crease patterns | The flat sheet a folded or cut thing comes from: the Miura fold, folding rigidly in three dimensions, rotating-squares kirigami, and the two local rules a flat fold must obey | [Mountains and valleys: `CreasePattern` and the two laws](15-shapesasmaterial.md#mountains-and-valleys-creasepattern-and-the-two-laws), [A sheet that opens all at once: the Miura fold](15-shapesasmaterial.md#a-sheet-that-opens-all-at-once-the-miura-fold), [Origami allowed to cut: rotating squares](15-shapesasmaterial.md#origami-allowed-to-cut-rotating-squares) | [CreasePattern](../docs/drawing/creasepattern.md) |

### Chapter 16: Curves and figures

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Hobby's spline | `drawCurve(_:closed:spline:)` with `.hobby` draws a curve through your points that reads as drawn by hand, and `HobbySpline(through:)` hands it back as a path | [A curve that reads as drawn: Hobby's spline](16-curvesandfigures.md#a-curve-that-reads-as-drawn-hobbys-spline) | [Geometry](../docs/drawing/geometry.md#hobby) |
| Classic curves | Phyllotaxis, Lissajous figures, roses, superellipses, supershapes, spirograph gears, guilloche rosettes, the harmonograph, spirolaterals, Chaikin corner-cut smoothing, and a moving average that keeps every point, none of them random | [Curves you can write down: the classic curves](16-curvesandfigures.md#curves-you-can-write-down-the-classic-curves), [A walk that comes home: spirolaterals](16-curvesandfigures.md#a-walk-that-comes-home-spirolaterals) | [Classic curves](../docs/drawing/curves.md) |
| Clothoid | The curve whose bend grows at a steady rate (the Euler or Cornu spiral): easements into a turn, smooth paths through waypoints, corners a vehicle could take, and the curve that fits two points and two headings | [A corner a car could take: clothoids](16-curvesandfigures.md#a-corner-a-car-could-take-clothoids) | [Clothoid](../docs/drawing/clothoid.md) |
| Envelopes and caustics | The curve a moving line leans on, the bright curve reflected or bent light crowds along, and where a wavefront gets to next | [The curve a family of lines leans on: envelopes and caustics](16-curvesandfigures.md#the-curve-a-family-of-lines-leans-on-envelopes-and-caustics) | [Envelopes and caustics](../docs/drawing/envelopes.md) |
| Fourier epicycles | A closed outline rebuilt as a chain of spinning circles, with the number of terms setting the detail | [Circles on circles: Fourier epicycles](16-curvesandfigures.md#circles-on-circles-fourier-epicycles) | [Epicycles](../docs/drawing/epicycles.md) |
| Shape morphing | One shape turned into another; holes grow in and out, and each in-between is a shape you can use | [One shape becoming another: shape morphing](16-curvesandfigures.md#one-shape-becoming-another-shape-morphing) | [Morphing](../docs/drawing/morphing.md) |
| Anamorphosis | A plate that reads only in a mirrored cylinder standing on the page, from one viewing spot: points, contours, and shapes mapped to the page, and the arc of the cylinder an eye can see | [A drawing only a mirror can read: anamorphosis](16-curvesandfigures.md#a-drawing-only-a-mirror-can-read-anamorphosis) | [Anamorphosis](../docs/drawing/anamorphosis.md) |
| Turtle | A pen you drive from code: forward, back, left, right, pen up and down, and a remembered pose for branches, every run an ordinary contour | [A pen you drive: the turtle](16-curvesandfigures.md#a-pen-you-drive-the-turtle) | [Turtle](../docs/generators/turtle.md) |

### Chapter 17: Marks and media

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Variable-width strokes | `strokeProfile(_:)`: width shaped along the path, so a line tapers, swells, or carries a profile you wrote | [A width that changes along the path: strokeProfile](17-marksandmedia.md#a-width-that-changes-along-the-path-strokeprofile) | [Drawing](../docs/drawing/drawing.md#strokeProfile) |
| Stroke dynamics | `StrokeMark` and `drawMark`: width and opacity set by how fast and how hard a mark is made; `pressure` reads a Force Touch trackpad or a tablet, and `stylus` a pen's tilt and twist | [Painting as it happens: stroke dynamics](17-marksandmedia.md#painting-as-it-happens-stroke-dynamics) | [Marks](../docs/drawing/marks.md), [Input](../docs/helpers/input.md#stylus) |
| Brushes | `strokeBrush(_:)`: a stamp repeated along the path instead of one continuous ribbon, with its own tip, spacing, jitter, and angle | [Stamps along the path: brushes](17-marksandmedia.md#stamps-along-the-path-brushes) | [Marks](../docs/drawing/marks.md#brushes) |
| Dashed strokes | `strokeDash(_:)`: a line with gaps, the pattern walked along the path so corners and curves keep their rhythm | [A line with gaps: strokeDash](17-marksandmedia.md#a-line-with-gaps-strokedash) | [Drawing](../docs/drawing/drawing.md#strokeDash) |
| Paper marbling | Ink floated on a bath and raked: drops, tines, combs, and vortices, each a transform of vector outlines | [Ink on water: marbling](17-marksandmedia.md#ink-on-water-marbling) | [Marbling](../docs/generators/marbling.md) |
| Watercolor | Pigment from one polygon, deformed and stacked at low opacity: dense cores and uneven edges | [Pigment from a polygon: drawWatercolor](17-marksandmedia.md#pigment-from-a-polygon-drawwatercolor) | [Watercolor](../docs/generators/watercolor.md) |

## Part IV: Pixels and light

### Chapter 18: Your first shader

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| User shaders | Write `shade(uv, info)` and run it as a generator, a filter, or a two-input combine; `#include` pulls in a helper file several shaders share | [The first shader: shade, uv, and generate](18-yourfirstshader.md#the-first-shader-shade-uv-and-generate), [Drawing with distance: smoothstep as an edge](18-yourfirstshader.md#drawing-with-distance-smoothstep-as-an-edge), [Time, mouse, and parameters: info and params](18-yourfirstshader.md#time-mouse-and-parameters-info-and-params), [One helper, two shaders: the include line](18-yourfirstshader.md#one-helper-two-shaders-the-include-line) | [Shaders](../docs/shaders/shaders.md) |
| The shader library | Hashing, noise, SDFs, palettes, and OKLab, spliced into each shader and kernel | [The shader library: fbm, hash12, palette, and the distance functions](18-yourfirstshader.md#the-shader-library-fbm-hash12-palette-and-the-distance-functions) | [ShaderLibrary](../docs/shaders/shaderlibrary.md) |
| A shader as paint | `fill(shader)` and `stroke(shader)` run `shade` at every pixel a shape covers, `uv` across the shape's own box, with the edge distance, the fraction along a stroke, and the canvas position in `info`; a mesh takes it as its surface | [Paint, not a layer: fill and stroke with a shader](18-yourfirstshader.md#paint-not-a-layer-fill-and-stroke-with-a-shader) | [Color](../docs/drawing/color.md#shader-paint) |
| Design generators | Ten built-in shaders that draw a finished graphic at their defaults, among them mesh gradients, god rays, spirals, orbiting dots, grain gradients, and pulsing borders | [Backdrops that come composed: the design generators](18-yourfirstshader.md#backdrops-that-come-composed-the-design-generators) | [Effects](../docs/drawing/effects.md) |
| Pattern fields | Closed-form fields that move only by the `phase` you pass: quasicrystal, moire, gyroid, phyllotaxis, hex pulse, and Chladni | [Closed forms at every pixel: the pattern fields](18-yourfirstshader.md#closed-forms-at-every-pixel-the-pattern-fields) | [Effects](../docs/drawing/effects.md) |
| Post-process anti-aliasing | `.antialias` smooths the stepped edges a shader leaves, as a filter on the layer | [The edges a shader leaves: post-process anti-aliasing](18-yourfirstshader.md#the-edges-a-shader-leaves-post-process-anti-aliasing) | [Effects](../docs/drawing/effects.md) |
| Visual chains | Per-pixel composition written as a chain: oscillators, warps, blends, and modulation, in one pass | [Patching without typing Metal: Visual chains](18-yourfirstshader.md#patching-without-typing-metal-visual-chains) | [Visuals](../docs/shaders/visuals.md) |
| Bringing a shader over | `ollin new --from-shader`: a GLSL fragment shader translated into Metal, with a project written around it | [Somebody else's shader: GLSL import](18-yourfirstshader.md#somebody-elses-shader-glsl-import) | [ShaderImport](../docs/tools/shaderimport.md) |
| Checking a shader | `ollin check`: compile a `.metal` file on the GPU and see the errors at your own line, what the shader is, and the parameters it reads | [Trying a shader on its own: ollin check](18-yourfirstshader.md#trying-a-shader-on-its-own-ollin-check) | [ShaderCheck](../docs/tools/shadercheck.md) |

### Chapter 19: Layers and effects

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Render targets | Off-screen layers: draw into one with `withTarget`, then draw it back onto the canvas | [A drawing you can hold: render targets](19-layersandeffects.md#a-drawing-you-can-hold-render-targets) | [Effects](../docs/drawing/effects.md) |
| The filter catalog | The built-in GPU filters: blurs, glows, color, stylize, retro, distortion, and design; `postProcess` applies one to the whole finished frame, and `drawSheet` lays labeled tiles out to compare them | [Filters](19-layersandeffects.md#filters); Ch 20: [More from the shelf: ink lines, flat regions, chromatic aberration, a lens, a wall, and a mixer](20-picturesrestyled.md#more-from-the-shelf-ink-lines-flat-regions-chromatic-aberration-a-lens-a-wall-and-a-mixer) | [Effects](../docs/drawing/effects.md) |
| Generator fills | `generate(_:)` fills a layer with a built-in pattern such as `.noise`; the plain fills `.checkers`, `.gridLines`, `.bars`, and `.cellular` are in the reference | [Filters](19-layersandeffects.md#filters); Ch 14: [The whole field at once: line integral convolution](14-fieldsandflow.md#the-whole-field-at-once-line-integral-convolution) | [Effects](../docs/drawing/effects.md) |
| Blend modes | Add, subtract, multiply, screen, lightest, darkest, as drawing state | [How new paint meets old: blend modes](19-layersandeffects.md#how-new-paint-meets-old-blend-modes) | [Drawing](../docs/drawing/drawing.md) |
| Accumulation | `noClear()`: the canvas keeps what earlier frames drew, in single precision with `.float32` for a long faint exposure; `Accumulator`: a layer that keeps the running mean, so faint samples settle into a picture | [The canvas that keeps everything: noClear](19-layersandeffects.md#the-canvas-that-keeps-everything-noclear), [Converging instead of brightening: the running mean](19-layersandeffects.md#converging-instead-of-brightening-the-running-mean); Ch 12: [Roaming: `wander`, and trails from `noClear`](12-flocksandswarms.md#roaming-wander-and-trails-from-noclear) | [Accumulation](../docs/drawing/accumulation.md) |
| HDR and tone mapping | Light past full brightness, brought back by `toneMap` (clamp, Reinhard, ACES, or the hue-preserving neutral curve) | [Brighter than the screen: toneMap](19-layersandeffects.md#brighter-than-the-screen-tonemap) | [HDR](../docs/drawing/hdr.md) |
| Feedback | A layer that sees its own last frame: trails, tunnels, and video feedback | [The canvas that remembers itself: feedback](19-layersandeffects.md#the-canvas-that-remembers-itself-feedback) | [Effects](../docs/drawing/effects.md) |
| The compose block | `compose { layer { } … }`: a stack of layers, filters, and blends written as one block | [The whole stack in one block: compose](19-layersandeffects.md#the-whole-stack-in-one-block-compose) | [Effects](../docs/drawing/effects.md) |
| Profiling | The inspector's cost row: CPU against GPU on one frame's scale, the draw, pass and batch counts, and a frame handed to Xcode | [Which half is slow: the cost row](19-layersandeffects.md#which-half-is-slow-the-cost-row); Ch 3: [When a frame takes too long](03-motionandtime.md#when-a-frame-takes-too-long) | [Profiling](../docs/tools/profiling.md) |
| Retained batches | `makeBatch { }` records static drawing once into a `Batch`, and `drawBatch` draws it again each frame at little cost, placed by the transform in force | [Record it once: batches](19-layersandeffects.md#record-it-once-batches) | [Retained batches](../docs/drawing/batches.md) |

### Chapter 20: Pictures restyled

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Brushwork | `.brushwork` repaints a picture in strokes that follow its edges (an anisotropic Kuwahara filter) | [Paint that follows the picture: brushwork](20-picturesrestyled.md#paint-that-follows-the-picture-brushwork) | [Effects](../docs/drawing/effects.md) |
| Hatching a picture | `.hatching` draws a picture's tones as strokes that follow its shapes | [Strokes that follow the picture: hatching](20-picturesrestyled.md#strokes-that-follow-the-picture-hatching) | [Effects](../docs/drawing/effects.md) |
| A look from a file | `ColorLUT` reads a `.cube` color lookup table, the grade a color tool exports, and `Filter.lut` applies it; a look built in code writes out as a `.cube` | [A look from a colorist's suite: ColorLUT](20-picturesrestyled.md#a-look-from-a-colorists-suite-colorlut) | [Looks](../docs/drawing/looks.md) |
| A film look | `Filter.halation` puts film's warm fringe around highlights, and `Filter.filmGrain` lays grain that follows the tone and keeps the mean | [A film look: halation and grain](20-picturesrestyled.md#a-film-look-halation-and-grain) | [Effects](../docs/drawing/effects.md) |
| Design filters | Fluted glass, water, and paper that transform a picture; liquid metal, heatmap, and gem smoke that read a shape's silhouette | [The design filters: paper, glass, water, and a material from a silhouette](20-picturesrestyled.md#the-design-filters-paper-glass-water-and-a-material-from-a-silhouette) | [Effects](../docs/drawing/effects.md) |
| Ink lines | `.xdog` draws a line wherever the picture has an edge (an extended difference of Gaussians) | [A line where there is an edge: xdog](20-picturesrestyled.md#a-line-where-there-is-an-edge-xdog) | [Effects](../docs/drawing/effects.md) |
| Flat regions | `.shock` flattens a picture into regions with crisp edges (a shock filter) | [Regions with crisp edges: shock](20-picturesrestyled.md#regions-with-crisp-edges-shock) | [Effects](../docs/drawing/effects.md) |
| Chromatic aberration | `.chromaticAberration` pulls the color channels apart, so a white edge grows a colored rim, with a mode for each kind of picture | [One filter, five pictures: chromatic aberration](20-picturesrestyled.md#one-filter-five-pictures-chromatic-aberration) | [Effects](../docs/drawing/effects.md) |
| Lens distortion | A layer bent into a barrel or a pincushion by a lens's radial model, with the corners left empty or the frame kept full: the `.lensDistortion` filter | [Through a lens, onto a wall, and through a mixer: lensDistortion, cornerPin, and channelMixer](20-picturesrestyled.md#through-a-lens-onto-a-wall-and-through-a-mixer-lensdistortion-cornerpin-and-channelmixer) | [Effects](../docs/drawing/effects.md) |
| Corner pin | A layer laid onto four points with its straight lines kept, the `.cornerPin` filter, the same map installation mode fits a projector with | [Through a lens, onto a wall, and through a mixer: lensDistortion, cornerPin, and channelMixer](20-picturesrestyled.md#through-a-lens-onto-a-wall-and-through-a-mixer-lensdistortion-cornerpin-and-channelmixer) | [Effects](../docs/drawing/effects.md) |
| Channel mixer | `.channelMixer` mixes each output channel from all four input channels plus an offset, through a `ColorMatrix`: a gray made to your own recipe, or two channels swapped | [Through a lens, onto a wall, and through a mixer: lensDistortion, cornerPin, and channelMixer](20-picturesrestyled.md#through-a-lens-onto-a-wall-and-through-a-mixer-lensdistortion-cornerpin-and-channelmixer) | [Effects](../docs/drawing/effects.md) |
| Relight, two tones, and warps | `.relight` reads a picture's brightness as height and lights it, `.dither(dark:light:)` screens it into two colors, and `.swirl`, `.bulge`, and `.ripple` bend it around a center you give | [Height, tone, and a center: relight, the two-tone dither, and the warps](20-picturesrestyled.md#height-tone-and-a-center-relight-the-two-tone-dither-and-the-warps) | [Effects](../docs/drawing/effects.md) |
| Droste | `.droste` makes a picture contain a smaller copy of itself, again and again | [A picture inside itself: droste](20-picturesrestyled.md#a-picture-inside-itself-droste) | [Effects](../docs/drawing/effects.md) |
| Luminance melt | A picture liquified by a warped noise field and poured through a palette, the `.melt` filter | [The picture poured: melt](20-picturesrestyled.md#the-picture-poured-melt) | [Effects](../docs/drawing/effects.md) |

### Chapter 21: Pictures you solve

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Diffusion curves | A few marks held as color sources and the color let out between them, so a curve can carry a different color on each side | [A picture made of a few marks: diffusion](21-picturesyousolve.md#a-picture-made-of-a-few-marks-diffusion) | [Effects](../docs/drawing/effects.md) |
| Measured distance fields | How far each pixel is from the nearest drawn edge and which way it lies, read back as contours, grown or shrunk shapes, outlines, and a Voronoi built from the drawn shapes rather than from points | [A field you measure: the distance field](21-picturesyousolve.md#a-field-you-measure-the-distance-field) | [Measured distance fields](../docs/drawing/distancefields.md) |
| Layer styles | A layer given an edge of its own from its alpha: an outline inside, outside, or centered on the edge, a drop or inner shadow, an outer or inner glow, and a lit bevel, each one filter that stacks in the order it is chained | [A field you measure: the distance field](21-picturesyousolve.md#a-field-you-measure-the-distance-field) | [Layer styles](../docs/drawing/layerstyles.md) |
| Combines | `combined(with:_:)` runs an effect that reads a second layer, such as a mask, a displacement, a mix, depth of field, ambient occlusion, and screen-space reflections | [A field you measure: the distance field](21-picturesyousolve.md#a-field-you-measure-the-distance-field); Ch 26: [What the depth buffer is for: ambient occlusion and defocus](26-3dgently.md#what-the-depth-buffer-is-for-ambient-occlusion-and-defocus); Ch 33: [Mirrors that see off screen: ray-traced reflections](33-tracedlight.md#mirrors-that-see-off-screen-ray-traced-reflections) | [Effects](../docs/drawing/effects.md) |
| Light in a flat sketch | Draw a scene in one layer and the lamps in another, and get back the light that reaches each pixel: shadows that soften with distance, falloff, beams through a gap, and the color a lit wall gives back | [Light that works itself out: `.light`](21-picturesyousolve.md#light-that-works-itself-out-light) | [Light in a flat sketch](../docs/drawing/light.md) |
| Seamless clone | `.seamlessClone` sets a piece of one picture into another so the colors meet with no seam (Poisson image editing) | [Putting a piece of one picture into another: `.seamlessClone`](21-picturesyousolve.md#putting-a-piece-of-one-picture-into-another-seamlessclone) | [Effects](../docs/drawing/effects.md) |
| The frequency domain | A picture read as a sum of waves instead of a grid of pixels: filtering by scale is a shape drawn over the spectrum, and a field can be built from a description of its energy (`Filter.fourier`/`.inverseFourier`/`.spectrum`) | [A picture read as waves: the Fourier transform](21-picturesyousolve.md#a-picture-read-as-waves-the-fourier-transform) | [The frequency domain](../docs/drawing/fourier.md) |
| Local averages | The average of the square around each pixel at a price that does not grow with its size: a box blur of any radius, and a threshold that compares each pixel with its own neighborhood, so uneven light stops mattering | [Averages of a neighborhood, at a flat price: the summed-area table](21-picturesyousolve.md#averages-of-a-neighborhood-at-a-flat-price-the-summed-area-table) | [Local averages](../docs/drawing/localaverages.md) |

### Chapter 22: Iterated forms

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Fractals | IFS chaos games, fractal flames, the Buddhabrot, circle-inversion lace, Kleinian limit-set curves, and Schottky circles | [The same fern, played as a game: the chaos game](22-iteratedforms.md#the-same-fern-played-as-a-game-the-chaos-game), [Circles used as mirrors: inversion limit sets](22-iteratedforms.md#circles-used-as-mirrors-inversion-limit-sets), [A group drawn as one curve: Kleinian limit sets](22-iteratedforms.md#a-group-drawn-as-one-curve-kleinian-limit-sets), [The chaos game with a twist: fractal flames](22-iteratedforms.md#the-chaos-game-with-a-twist-fractal-flames), [Circles that pair off: Schottky groups](22-iteratedforms.md#circles-that-pair-off-schottky-groups), [What the escapers leave behind: the Buddhabrot](22-iteratedforms.md#what-the-escapers-leave-behind-the-buddhabrot) | [Fractals](../docs/generators/fractals.md) |
| Strange attractors | Lorenz, Clifford, de Jong, and others, drawn as orbits, and as a field a million particles follow | [A formula that folds the plane: chaotic maps](22-iteratedforms.md#a-formula-that-folds-the-plane-chaotic-maps); Ch 25: [A million following the same field: attractor flow](25-particlesimulations.md#a-million-following-the-same-field-attractor-flow) | [Attractors](../docs/drawing/attractors.md) |
| The bifurcation diagram | `IteratedMap`: the logistic map and its one-dimensional relatives on their way into chaos, watched through bifurcation diagrams, cobweb staircases, and Lyapunov exponents | [One dial away from chaos: the bifurcation diagram](22-iteratedforms.md#one-dial-away-from-chaos-the-bifurcation-diagram) | [Bifurcation](../docs/generators/bifurcation.md) |
| Billiards | `Billiard`: a ball bouncing in a circle, an ellipse, a polygon, or a stadium, with posts standing in it, and its path as geometry you can stroke | [A ball in a room: billiards](22-iteratedforms.md#a-ball-in-a-room-billiards) | [Billiards](../docs/generators/billiards.md) |
| Double pendulum | `DoublePendulum`: two weights on two hinged arms under gravity, stepped by `advance()`; a run repeats exactly, yet a start a ten-thousandth of a radian off soon swings somewhere else | [The classic chaos machine: DoublePendulum](22-iteratedforms.md#the-classic-chaos-machine-doublependulum) | [Motion](../docs/simulation/motion.md) |
| Escape-time fractals | The Mandelbrot set and Julia sets, colored by how fast each point escapes, zoomable; orbit traps color by the closest pass to a shape instead | [Iteration without memory: escape-time fractals and orbit traps](22-iteratedforms.md#iteration-without-memory-escape-time-fractals-and-orbit-traps) | [Effects](../docs/drawing/effects.md) |
| Newton's basins | `.newton` colors each point by the root Newton's method carries it to | [Where it lands: Newton's basins](22-iteratedforms.md#where-it-lands-newtons-basins) | [Effects](../docs/drawing/effects.md) |
| Domain coloring | `.domainColoring` paints a complex function over its own plane: color for direction, rings for size unless you ask for `.phase` alone; placeable zeros and poles, and the named functions with their branch cuts | [A picture of a function: domain coloring](22-iteratedforms.md#a-picture-of-a-function-domain-coloring) | [Effects](../docs/drawing/effects.md) |
| Complex numbers | `Complex`, a point of the plane that multiplies: the polar form, `exp`, `log`, `pow`, `sqrt`, and the trig functions, and `ComplexPlane` to place it on the canvas; the shader library has the same in its `complex` section | [Multiplying turns: the complex plane](22-iteratedforms.md#multiplying-turns-the-complex-plane), [Iteration without memory: escape-time fractals and orbit traps](22-iteratedforms.md#iteration-without-memory-escape-time-fractals-and-orbit-traps) | [Complex](../docs/helpers/complex.md) |

### Chapter 23: Simulations on a grid

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Simulation fields | `SimField` and `withField`: the Game of Life, Gray-Scott reaction-diffusion with feed and kill that can vary across it, and fluid, as state on the GPU that you seed by drawing into it | [State that lives on the GPU: SimField and withField](23-gridsimulations.md#state-that-lives-on-the-gpu-simfield-and-withfield), [The Game of Life: a first field](23-gridsimulations.md#the-game-of-life-a-first-field), [Two chemicals: reaction-diffusion](23-gridsimulations.md#two-chemicals-reaction-diffusion), [Water you can stir: fluid](23-gridsimulations.md#water-you-can-stir-fluid) | [Effects](../docs/drawing/effects.md) |
| Reading a field as data | `.gradientMap`, `.levels`, and `.relight` read a field's numbers as color, contrast, and height | [A field is data: gradientMap, levels, and relight](23-gridsimulations.md#a-field-is-data-gradientmap-levels-and-relight) | [Effects](../docs/drawing/effects.md) |
| Predator-prey field | `.predatorPrey`: prey and predators on one land, with predators released where you draw green, an invasion front, and the spiral waves behind it | [Two species: predator and prey](23-gridsimulations.md#two-species-predator-and-prey) | [Effects](../docs/drawing/effects.md#simfield) |
| Multi-scale Turing patterns | `.multiScaleTuring` runs one activator-inhibitor rule at several sizes at once, with a `TuringScale` for each | [The same rule at many sizes: multi-scale Turing](23-gridsimulations.md#the-same-rule-at-many-sizes-multi-scale-turing) | [Effects](../docs/drawing/effects.md) |
| Ripple pool | `.ripples`: the wave equation as an interactive water surface; drawn marks add height, rings spread and reflect | [A pool you can drop things into: ripples](23-gridsimulations.md#a-pool-you-can-drop-things-into-ripples) | [Effects](../docs/drawing/effects.md#simfield) |
| Self-warp | `.selfWarp` measures which way each part of a picture moved and carries what it showed along that motion, so moving things smear and still ones stay sharp | [The picture dragging its past: self-warp](23-gridsimulations.md#the-picture-dragging-its-past-self-warp) | [Effects](../docs/drawing/effects.md) |
| Falling sand | `.fallingSand` with `SandMaterial`: sand that falls, rolls, and piles, water that spreads flat and lets sand sink through it, and walls that hold still, settled in 2x2 blocks each pass | [Sand that falls: the falling-sand automaton](23-gridsimulations.md#sand-that-falls-the-falling-sand-automaton) | [Effects](../docs/drawing/effects.md) |
| Watercolor wash | `watercolor(pigments:)`: wet paint on rough paper, with darkened edges, backruns, dry brush, and glazing | [Paint that behaves: watercolor](23-gridsimulations.md#paint-that-behaves-watercolor) | [Watercolor](../docs/simulation/watercolor.md) |
| A simulation of your own | `Sim.shader` runs a kernel you write as a `Shader`, whose `shade` returns each cell's next state from its neighbors; `inject:` decides what a drawn mark does | [Life rewritten as a kernel: Sim.shader](23-gridsimulations.md#life-rewritten-as-a-kernel-simshader) | [Effects](../docs/drawing/effects.md#simfield-shader) |

### Chapter 24: Automata

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Percolation | `percolation`: a grid of coin flips whose open cells join into one cluster across the grid once the probability passes about 0.5927 | [When chance acts as a crowd: percolation](24-automata.md#when-chance-acts-as-a-crowd-percolation), [Putting it together: the wildfire](24-automata.md#putting-it-together-the-wildfire) | [Percolation](../docs/generators/percolation.md) |
| Forest fire | `.forestFire`: bare ground, trees, and fire, a field that finds its own critical density, or with growth and lightning at zero burns only what you plant and light | [A forest that keeps burning: the forest fire](24-automata.md#a-forest-that-keeps-burning-the-forest-fire), [Putting it together: the wildfire](24-automata.md#putting-it-together-the-wildfire) | [Effects](../docs/drawing/effects.md#simfield) |
| Cellular automata | `elementaryCA` and `totalisticCA` rules, and `Turmite` ants: small rules run for a long time | [A single row of cells: Wolfram's elementary rules](24-automata.md#a-single-row-of-cells-wolframs-elementary-rules), [An ant on a grid: turmites](24-automata.md#an-ant-on-a-grid-turmites) | [Cellular automata](../docs/generators/cellularautomata.md) |
| Lenia | `.lenia`: the continuous Game of Life, smooth mass that grows colonies and creatures | [Life made continuous: Lenia](24-automata.md#life-made-continuous-lenia) | [Effects](../docs/drawing/effects.md#simfield) |
| SmoothLife | `.smoothLife`: Life's own rule on a continuous field, a disc for the cell and a ring for its neighbors, with the paper's glider as the default regime | [Life with soft edges: SmoothLife](24-automata.md#life-with-soft-edges-smoothlife) | [Effects](../docs/drawing/effects.md#simfield) |
| Grid automata | `.cyclic`, `.excitable`, `.briansBrain`, `.hodgepodge`, `.wireworld`, `.schelling`, and `.ising`: state automata as fields, from spirals and gliders to a circuit, a neighborhood sorting itself, and a magnet against the heat | [The medium that has to rest: excitable media](24-automata.md#the-medium-that-has-to-rest-excitable-media), [A circuit made of cells: Wireworld](24-automata.md#a-circuit-made-of-cells-wireworld), [A neighborhood sorting itself: Schelling's board](24-automata.md#a-neighborhood-sorting-itself-schellings-board), [Spins against the heat: the Ising model](24-automata.md#spins-against-the-heat-the-ising-model) | [Effects](../docs/drawing/effects.md#simfield) |
| Sandpile | `.sandpile`: grains dropped on a grid, each cell toppling onto its neighbors when it holds four | [A pile of sand: the Abelian sandpile](24-automata.md#a-pile-of-sand-the-abelian-sandpile) | [Effects](../docs/drawing/effects.md) |

### Chapter 25: Simulations made of particles

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Compute kernels | Your own GPU code, written in the chapter as the `Particles` step snippet and the `Simulation` step over a texture; `.metal` files that reload as you edit and the typed `ComputeKernel` are in the reference | [A million grains: GPU particles](25-particlesimulations.md#a-million-grains-gpu-particles) | [Compute](../docs/shaders/compute.md) |
| GPU particles | `Particles`: a million particles moved by a Metal snippet run once per particle and drawn on the GPU, with `stepParticles` and `drawParticles` | [A million grains: GPU particles](25-particlesimulations.md#a-million-grains-gpu-particles) | [Compute](../docs/shaders/compute.md) |
| Artificial life | `ParticleLife`, `PPS` (the Primordial Particle System), `Physarum`, `ParticleLenia`, and `SwarmChemistry`, most of them on the public `SpatialHash` neighbor search | [Particles that see their neighbors: Particle Life, the Primordial Particle System, Physarum, and the flock at scale](25-particlesimulations.md#particles-that-see-their-neighbors-particle-life-the-primordial-particle-system-physarum-and-the-flock-at-scale), [Agents that talk through the floor: Physarum](25-particlesimulations.md#agents-that-talk-through-the-floor-physarum), [Matter that decides what shape to be: Particle Lenia](25-particlesimulations.md#matter-that-decides-what-shape-to-be-particle-lenia), [A rule that spreads by winning arguments: swarm chemistry](25-particlesimulations.md#a-rule-that-spreads-by-winning-arguments-swarm-chemistry) | [Artificial life](../docs/simulation/artificiallife.md) |
| Steering at scale | `Swarm`: separation, alignment, cohesion, seek, flee, arrive, wander, and flow as weights over tens of thousands of agents | [The flock, a thousand times bigger: Swarm](25-particlesimulations.md#the-flock-a-thousand-times-bigger-swarm) | [Swarm](../docs/simulation/swarm.md) |
| Particle fluids | `ParticleFluid`: SPH liquid with a free surface, splashes, and grabbing | [Liquids and jellies: SPH and soft bodies](25-particlesimulations.md#liquids-and-jellies-sph-and-soft-bodies) | [Fluids](../docs/simulation/fluids.md) |
| Jellies | `SoftBodies`: shape-matched jellies that squash and pile | [Liquids and jellies: SPH and soft bodies](25-particlesimulations.md#liquids-and-jellies-sph-and-soft-bodies) | [Fluids](../docs/simulation/fluids.md) |
| Ant colony | A colony laying pheromone trails, narrowing a web of possible routes down to a short tour | [A search you can watch: ant colony optimization](25-particlesimulations.md#a-search-you-can-watch-ant-colony-optimization) | [AntColony](../docs/generators/antcolony.md) |
| Evolution | `Evolution`: GPU populations bred toward a target past obstacles, by tournament selection | [Letting the sketch find it: evolution](25-particlesimulations.md#letting-the-sketch-find-it-evolution) | [Evolution](../docs/simulation/evolution.md) |
| Kernel simulations | `Simulation` runs a Metal step once per cell of a texture, the grains' kind of snippet over a grid, stepped with `stepSimulation(_:custom:)`, with `substeps` for several steps a frame and a kernel of your own for the first state | [One step per cell: `Simulation`](25-particlesimulations.md#one-step-per-cell-simulation) | [Compute](../docs/shaders/compute.md#simulation) |

## Part V: The third dimension

### Chapter 26: 3D, gently

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| The camera | `camera(_:)` with a fixed pose such as `.orbiting(...)`, `perspective(eye:target:)` to aim the eye from one point at another, and `ortho(eye:target:height:)`, where far things keep their size | [A camera and a sphere](26-3dgently.md#a-camera-and-a-sphere), [Placing things: transforms compose](26-3dgently.md#placing-things-transforms-compose) | [3D](../docs/3d/3d.md) |
| Camera control and moves | Orbiting with the mouse, the self-driving `cameraShowcase`, and snap views such as `cameraView(.front)`; the cinematic `CameraMove` values are in the reference | [A camera and a sphere](26-3dgently.md#a-camera-and-a-sphere), [Keeping your bearings: views, the axis, and the ground grid](26-3dgently.md#keeping-your-bearings-views-the-axis-and-the-ground-grid) | [Camera](../docs/3d/camera.md) |
| Spherical coordinates | `spherical(azimuth, elevation, radius, around:)` places a point by two angles and a distance, in the camera's own orbit convention; a `Vector3`'s `azimuth` and `elevation` read the angles back | Appendix B: [Two angles and a radius make a point in space](b-justenoughmath.md#two-angles-and-a-radius-make-a-point-in-space) | [Math](../docs/helpers/math.md#spherical) |
| Axis and ground grid | `cameraAxis()` shows a small x-y-z compass and `groundGrid()` a faint floor, drawn in the live window and left out of exports | [Keeping your bearings: views, the axis, and the ground grid](26-3dgently.md#keeping-your-bearings-views-the-axis-and-the-ground-grid) | [Camera](../docs/3d/camera.md) |
| The depth test | Solids nearer the camera hide the ones behind, in whatever order you draw them, over a floor from `drawPlane` or `drawGround()` | [Depth that hides things: the depth test](26-3dgently.md#depth-that-hides-things-the-depth-test) | [3D](../docs/3d/3d.md) |
| Solid primitives | Box, sphere, torus, knots, Platonic solids, lathes, extrusions, and more | [A catalog of solids](26-3dgently.md#a-catalog-of-solids) | [3D](../docs/3d/3d.md) |
| Wireframe | `wireframe()` draws a mesh as its triangle edges, which take no light; each vertex also carries a normal, the way the surface faces there, in the mesh's `normals` | [What a solid is made of: triangles and normals](26-3dgently.md#what-a-solid-is-made-of-triangles-and-normals) | [3D](../docs/3d/3d.md) |
| Lights | Directional, point, spot, and ambient lights, glowing panels, disks, and tubes, and lighting presets | [Light: presets and the kinds of light](26-3dgently.md#light-presets-and-the-kinds-of-light), [A light with a body: area lights](26-3dgently.md#a-light-with-a-body-area-lights) | [3D](../docs/3d/3d.md) |
| Light shaping | A fixture's measured throw on a light (IES files), and an image projected through a spot (a cookie, the stage gobo) | [Light: presets and the kinds of light](26-3dgently.md#light-presets-and-the-kinds-of-light), [Air you can see: fog and volumetric light](26-3dgently.md#air-you-can-see-fog-and-volumetric-light) | [3D](../docs/3d/3d.md#light-shaping-ies-profiles-and-cookies) |
| Several rigs in one frame | `withLights` gives a block its own lamps, and `withoutLights` draws it flat | [Light: presets and the kinds of light](26-3dgently.md#light-presets-and-the-kinds-of-light); Ch 27: [One solid, two shadows: shadow art](27-meshes.md#one-solid-two-shadows-shadow-art) | [3D](../docs/3d/3d.md#light-sets) |
| Shadows | Cast shadows that harden near contact, with a softness setting, ray-traced for point lights on capable GPUs | [Shadows, and what they tell you](26-3dgently.md#shadows-and-what-they-tell-you), [Two lights, two shadows](26-3dgently.md#two-lights-two-shadows) | [3D](../docs/3d/3d.md#shadows) |
| Materials | Stylized finishes (toon, iridescent, velvet, glitter), and physically based metal and gloss from `metallic` and `roughness` | [Materials](26-3dgently.md#materials); Ch 28: [Two numbers for most real surfaces: PBR](28-materialsandsurroundings.md#two-numbers-for-most-real-surfaces-pbr) | [3D](../docs/3d/3d.md) |
| What stacks with what | The compatibility map across the 3D features | [Materials](26-3dgently.md#materials); Ch 32: [The light this needs: materials and shadows on a field](32-sculptingwithfields.md#the-light-this-needs-materials-and-shadows-on-a-field) | [Combining](../docs/3d/combining.md) |
| Contact shadows | `contactShadows(length:)` darkens the seam under a thing resting on another | [The seam under a resting thing: contact shadows](26-3dgently.md#the-seam-under-a-resting-thing-contact-shadows) | [3D](../docs/3d/3d.md#contact-shadows) |
| Atmosphere | Fog that fades surfaces with distance and pools low with a height falloff, aerial perspective that turns far ground blue and brightens the air toward the sky's sun, and volumetric light that turns spot cones, cookies, and cast shadows into visible beams and shafts | [Air you can see: fog and volumetric light](26-3dgently.md#air-you-can-see-fog-and-volumetric-light); Ch 28: [Distant air: aerial perspective](28-materialsandsurroundings.md#distant-air-aerial-perspective) | [Atmosphere](../docs/3d/atmosphere.md) |
| The cartoon look | `outline(width:color:)` draws a line around a mesh's silhouette, and `headlight()` is a light that follows the camera | [The cartoon look: outlines, and a light that follows the camera](26-3dgently.md#the-cartoon-look-outlines-and-a-light-that-follows-the-camera) | [3D](../docs/3d/3d.md#outlines), [3D](../docs/3d/3d.md#camera-relative) |
| Hidden-line solids | `featureEdges(creaseAngle:)` draws a mesh's faces in the fill and over them only its creases, its boundary, and its silhouette in the stroke, near solids hiding the edges of far ones, every copy of an instanced draw in one more draw | [A draughtsman's drawing: hidden-line solids](26-3dgently.md#a-draughtsmans-drawing-hidden-line-solids) | [Hidden-line solids](../docs/3d/hiddenlines.md) |
| Matcaps | Shading read from a picture of a lit sphere, such as chrome, clay, or car paint, with no lights in the scene | [Shading from a picture: matcaps](26-3dgently.md#shading-from-a-picture-matcaps) | [3D](../docs/3d/3d.md#matcap-materials) |
| Depth compositing | Flat 2D drawing placed inside the 3D depth buffer, so nearer solids hide it: `depth(at:)`, `project`, and billboards | [Flat drawing that knows where it is: depth compositing](26-3dgently.md#flat-drawing-that-knows-where-it-is-depth-compositing); Ch 35: [Flat marks at a depth: depth compositing](35-depth.md#flat-marks-at-a-depth-depth-compositing) | [DepthCompositing](../docs/3d/depthcompositing.md) |
| Lines in 3D | `drawLine` and `drawPolyline` over `Vector3`: the 2D stroke laid on the camera's picture, a depth at every point so solids hide it and it hides what lies behind, a color per point, a weight on screen or in world units with `strokeWeight(_:in:)`, and `drawAxes` and `drawGrid` built from it | [Flat drawing that knows where it is: depth compositing](26-3dgently.md#flat-drawing-that-knows-where-it-is-depth-compositing) | [Lines in 3D](../docs/3d/lines.md) |
| Type as a solid | `drawText3D`, over the `Mesh.text` and `Mesh.textGlyphs` builders: a word extruded into a lit solid that throws a shadow, or the same word a letter at a time, each letter knowing where it sits | [A mesh from a word: type as a solid](26-3dgently.md#a-mesh-from-a-word-type-as-a-solid) | [3D](../docs/3d/3d.md#solid-type) |

### Chapter 27: Meshes and maps

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Meshes from file | OBJ, glTF, USDZ, STL, and PLY, with materials and textures; `normalized(scale:)` recenters and fits whatever arrives | [A mesh from a file](27-meshes.md#a-mesh-from-a-file) | [3D](../docs/3d/3d.md) |
| Textures | A mesh wrapped in an image through its UVs, or, with no UVs, through a triplanar projection | [A picture wrapped around it: textured](27-meshes.md#a-picture-wrapped-around-it-textured), [A picture from three sides: triplanar](27-meshes.md#a-picture-from-three-sides-triplanar) | [3D](../docs/3d/3d.md#textures) |
| Subdivision surfaces | `subdivided(levels:)`: a rough cage of few faces refined into a smooth solid (Catmull-Clark, or Loop for triangle meshes), with welding and open edges handled | [Smooth from a cage: subdivision surfaces](27-meshes.md#smooth-from-a-cage-subdivision-surfaces) | [Subdivision surfaces](../docs/generators/subdivisionsurfaces.md) |
| Height maps | A height map carves depth, as shading with `parallaxMapped` or as geometry with `displaced(by:scale:)` | [Depth from a picture: height maps](27-meshes.md#depth-from-a-picture-height-maps), [Putting it together: the raked garden](27-meshes.md#putting-it-together-the-raked-garden) | [3D](../docs/3d/3d.md#height-maps) |
| Detail maps and decals | A detail map keeps texture sharp in a close look, and a decal stamps a picture onto the scene | [Texture that survives a close look: detail maps](27-meshes.md#texture-that-survives-a-close-look-detail-maps), [A picture stamped onto the scene: decals](27-meshes.md#a-picture-stamped-onto-the-scene-decals) | [3D](../docs/3d/3d.md#detail-maps) |
| Maps on a surface | `normalMapped` adds relief the light sees, and `surfaceMapped` sets metal, roughness, occlusion, and glow texel by texel (`glowing(_:)` for a mesh's own colors) | [Relief from a picture: normal maps](27-meshes.md#relief-from-a-picture-normal-maps), [What the surface is, per texel: surface maps](27-meshes.md#what-the-surface-is-per-texel-surface-maps) | [3D](../docs/3d/3d.md#normal-maps) |
| Scenes from file | `loadScene` reads a glTF or USD scene: named nodes drawn in place with `drawScene`, the file's camera and lights as values, a node reached by name, and the animations, skins, and morph targets it holds | [A scene with its camera and lights: loadScene](27-meshes.md#a-scene-with-its-camera-and-lights-loadscene), [Motion the file remembers: animations, skins, and morph targets](27-meshes.md#motion-the-file-remembers-animations-skins-and-morph-targets) | [Scenes](../docs/3d/scenes.md) |
| Bringing a scene over | `ollin new --from-scene`: a glTF or USD scene written out as the camera, light and placement calls that draw it | [A scene you can take apart: the scene written as source](27-meshes.md#a-scene-you-can-take-apart-the-scene-written-as-source) | [SceneImport](../docs/tools/sceneimport.md) |
| Cutting and joining meshes | `union`, `intersection`, `subtracting`, and `symmetricDifference` combine two closed solids, and `Mesh.joined(_:)` makes one mesh from several placed ones | [Cutting one solid with another: mesh booleans](27-meshes.md#cutting-one-solid-with-another-mesh-booleans), [One mesh from several: joined and placed](27-meshes.md#one-mesh-from-several-joined-and-placed) | [3D](../docs/3d/3d.md#booleans), [3D](../docs/3d/3d.md#join) |
| Shadow art | `shadowArt(fromFront:fromSide:)` carves the largest solid that throws the silhouettes you ask for, and `shadow(from:)` shows the shadow it throws | [One solid, two shadows: shadow art](27-meshes.md#one-solid-two-shadows-shadow-art) | [Shadow art](../docs/generators/shadowart.md) |
| Mesh growth | `MeshGrowth`: a surface that grows more area than it has room for and folds, driven evenly, by curvature, by your own field, or by a reaction-diffusion pattern in the surface | [A surface that outgrows itself: differential growth](27-meshes.md#a-surface-that-outgrows-itself-differential-growth) | [Mesh growth](../docs/generators/meshgrowth.md) |
| Sweeps and strips | `Mesh.sweep` carries a `Shape` along a `Curve3D`, whose frames never twist, sized and turned on the way; `Mesh.loft` carries several shapes placed along it and blends the surface from each to the next; `Mesh.strip` is the ribbon between two lines; `Pace` spaces points along a curve by length, or along a strip by area | [A shape along a path: sweeps and strips](27-meshes.md#a-shape-along-a-path-sweeps-and-strips) | [Sweeps and strips](../docs/3d/sweeps.md) |
| The Hopf fibration | A sphere's worth of circles, no two of which meet and every two of which are linked once, handed back as 3D paths to sweep | [A shape from four dimensions: the Hopf fibration](27-meshes.md#a-shape-from-four-dimensions-the-hopf-fibration) | [The Hopf fibration](../docs/3d/hopffibration.md) |

### Chapter 28: Materials and surroundings

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Environments | HDRI image-based lighting (eight bundled, twelve to download) and a procedural sky that needs no files, with its own sun as a light and clouds; the surroundings become the light | [Surroundings as the light: environments](28-materialsandsurroundings.md#surroundings-as-the-light-environments), [Weather in the sky: clouds](28-materialsandsurroundings.md#weather-in-the-sky-clouds) | [3D](../docs/3d/3d.md#environment-lighting) |
| Brushed metal, clearcoat, sheen, and skin | Anisotropy stretches a highlight into a streak, clearcoat and sheen give paint and cloth, and subsurface scattering lets light into skin, wax, and stone | [A streak instead of a dot: anisotropy](28-materialsandsurroundings.md#a-streak-instead-of-a-dot-anisotropy), [Paint and cloth: clearcoat and sheen](28-materialsandsurroundings.md#paint-and-cloth-clearcoat-and-sheen), [Skin, wax, and stone: subsurface scattering](28-materialsandsurroundings.md#skin-wax-and-stone-subsurface-scattering) | [3D](../docs/3d/3d.md#anisotropy) |
| Glass | A material that bends and tints the light passing through it | [Glass](28-materialsandsurroundings.md#glass) | [3D](../docs/3d/3d.md#glass) |
| The scene through glass | `sceneThroughGlass()` draws the frame once more with the glass taken out, so a bottle in your scene shows what stands behind it on any Mac, with no ray tracing | [Glass](28-materialsandsurroundings.md#glass) | [3D](../docs/3d/3d.md#scene-through-glass) |
| Volumes | `Volume`, a box of density samples, drawn by `drawVolume` as smoke, cloud, fire, or ink: the medium blocks light, scatters the scene's lights, and glows, and solids inside it are veiled by what lies in front | [A cloud in the scene: volumes](28-materialsandsurroundings.md#a-cloud-in-the-scene-volumes) | [Volumes](../docs/3d/volumes.md) |
| Thin film | `thinFilm` and `thinFilmThickness` color a surface the way a soap bubble is colored, with no pigment | [Color with no pigment: the thin film](28-materialsandsurroundings.md#color-with-no-pigment-the-thin-film) | [3D](../docs/3d/3d.md#thin-film) |

### Chapter 29: Landscapes and multitudes

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Terrain | `Heightfield`: landscapes grown from noise or diamond-square, weathered by simulated rain and gravity, read out as a mesh, an image, or samples | [A landscape you grow: heightfields and erosion](29-landscapes.md#a-landscape-you-grow-heightfields-and-erosion) | [Terrain](../docs/generators/terrain.md) |
| Instanced meshes | One mesh drawn thousands of times in one draw call: `MeshInstance` placements the GPU applies to each copy, or a buffer a compute kernel writes | [Ten thousand of the same thing: instancing](29-landscapes.md#ten-thousand-of-the-same-thing-instancing) | [Instancing](../docs/3d/instancing.md) |
| Points on a surface | Scatter a mesh's skin by area, not its vertex list, each spot carrying its normal | [Where the copies go: points on a surface](29-landscapes.md#where-the-copies-go-points-on-a-surface) | [SurfaceSampling](../docs/generators/surfacesampling.md) |
| Mesh fields | A world of placed meshes kept between frames and drawn by one call, each copy culled on the GPU against the camera (`MeshField`, `drawMeshField`) | [A world the camera trims: MeshField](29-landscapes.md#a-world-the-camera-trims-meshfield) | [Instancing](../docs/3d/instancing.md) |
| Strand fields | Grass grown inside the draw call: bending, swaying blades with no geometry buffers, camera-culled and distance-graded (`StrandField`/`drawStrands`) | [Grass that was never built: strand fields](29-landscapes.md#grass-that-was-never-built-strand-fields) | [Strands](../docs/3d/strands.md) |
| Drainage | Rivers worked out from a `Heightfield` rather than drawn: hollows filled so water always has a way out, flow counted per cell, the rivers above a `minFlow` as polylines you can stroke, Strahler ordering, and basins | [Where the water goes: drainage](29-landscapes.md#where-the-water-goes-drainage) | [Drainage](../docs/generators/drainage.md) |
| The ocean | A sea built from its own wave spectrum: one inverse Fourier transform makes the surface, drawn as water with no stored geometry, its wave height a measurement in world units (`Ocean`/`makeOceanField`/`drawOcean`) | [The sea, from what a sea is made of: an ocean spectrum](29-landscapes.md#the-sea-from-what-a-sea-is-made-of-an-ocean-spectrum) | [The ocean](../docs/3d/ocean.md) |
| How far a light carries | `reach:` bounds a lamp to its own neighborhood, with no light past it, which lets a frame carry up to 256 lamps: past eight, the lights are culled per screen tile | [A courtyard of lamps: many lights](29-landscapes.md#a-courtyard-of-lamps-many-lights) | [3D](../docs/3d/3d.md#reach) |

### Chapter 30: Worlds with weight

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| 3D physics | `World3D`: rigid bodies that stack, tumble, and swing inside the 3D scene, picked up and thrown with the mouse | [Things with weight: `World3D` and bodies](30-worldswithweight.md#things-with-weight-world3d-and-bodies) | [Physics3D](../docs/simulation/physics3d.md) |
| Motors, gears, and racks | `drive(at:strength:)` turns a hinge or a slider at a speed and `drive(to:)` holds it at a pose; `.gear(teeth:and:)` makes two hinges turn together, and `.rackAndPinion` turns a hinge's turning into a slider's travel | [Machines out of joints: motors, gears, and racks](30-worldswithweight.md#machines-out-of-joints-motors-gears-and-racks) | [Physics3D](../docs/simulation/physics3d.md#motors) |
| Collision groups | `group:` and `ignoreCollisions(between:and:)` let chosen bodies pass through each other | [Things that pass through each other: collision groups](30-worldswithweight.md#things-that-pass-through-each-other-collision-groups) | [Physics3D](../docs/simulation/physics3d.md#groups) |
| Asking the world | `world.contacts` says what hit what, a body made with `isSensor:` counts what is inside it, and `raycast(from:to:)`, `sweep`, and `bodiesOverlapping` ask what is in the way | [What hit what: contacts](30-worldswithweight.md#what-hit-what-contacts), [A region that counts what is inside: sensors](30-worldswithweight.md#a-region-that-counts-what-is-inside-sensors), [What is in the way: rays, sweeps, and overlaps](30-worldswithweight.md#what-is-in-the-way-rays-sweeps-and-overlaps) | [Physics3D](../docs/simulation/physics3d.md#contacts) |
| Holding a body back | `freedom:` takes a direction of motion away, `gravityScale` gives a body a pull of its own, and `checksPath` keeps a fast body from passing through a thin wall | [Taking a direction away: degrees of freedom](30-worldswithweight.md#taking-a-direction-away-degrees-of-freedom), [A pull of its own: `gravityScale`](30-worldswithweight.md#a-pull-of-its-own-gravityscale), [Too fast for a thin wall: `checksPath`](30-worldswithweight.md#too-fast-for-a-thin-wall-checkspath) | [Physics3D](../docs/simulation/physics3d.md#motion) |
| More joints | A cart on a track with `.path(through:looping:alignment:)`, a pulley, and `.allowing(_:at:travel:)`, a joint written as a list of freedoms | [A cart on a track: the path joint](30-worldswithweight.md#a-cart-on-a-track-the-path-joint), [A rope over two hooks: the pulley](30-worldswithweight.md#a-rope-over-two-hooks-the-pulley), [The joint that is a list of freedoms: `.allowing`](30-worldswithweight.md#the-joint-that-is-a-list-of-freedoms-allowing) | [Physics3D](../docs/simulation/physics3d.md#morejoints) |
| Tensegrity | `Tensegrity` and `addTensegrity`: struts held apart by cables in their balanced forms, standing in the world as capsule struts joined by `.cable` joints | [Standing on cables: tensegrity](30-worldswithweight.md#standing-on-cables-tensegrity) | [Tensegrity](../docs/generators/tensegrity.md) |
| Buoyancy | `world.water` with `Water(level:)`: bodies float by the weight of the water they push aside, on waves if you ask | [Water, and what it holds up: buoyancy](30-worldswithweight.md#water-and-what-it-holds-up-buoyancy) | [Physics3D](../docs/simulation/physics3d.md#water) |
| Ground and scenery from elsewhere | `.heightfield` turns a landscape into ground, and `addStaticBodies(from:)` and `addBodies(from:)` read colliders from a scene or a USD file | [Ground from a landscape: the heightfield collider](30-worldswithweight.md#ground-from-a-landscape-the-heightfield-collider), [Scenery and bodies from a file: scenes and USD physics](30-worldswithweight.md#scenery-and-bodies-from-a-file-scenes-and-usd-physics) | [Physics3D](../docs/simulation/physics3d.md#terrain) |
| Physics snapshots | `snapshot()` and `restore(_:)` keep a world as it stands, `save(to:)` writes it to a file, and `assetName` saves a large collider by name | [A world saved as it stands: `snapshot` and `restore`](30-worldswithweight.md#a-world-saved-as-it-stands-snapshot-and-restore), [A large collider saved by name: `assetName`](30-worldswithweight.md#a-large-collider-saved-by-name-assetname); Ch 31: [Snapshots of figures, vehicles, and cloth](31-charactersandcloth.md#snapshots-of-figures-vehicles-and-cloth) | [Physics3D](../docs/simulation/physics3d.md#snapshots) |

### Chapter 31: Characters, vehicles, and cloth

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| A character | `addCharacter(radius:height:at:)`: a capsule steered by `walk(at:)`, often from `moveAxis`, that jumps, climbs steps, and stops at slopes too steep for it | [Someone to be in there: the character controller](31-charactersandcloth.md#someone-to-be-in-there-the-character-controller) | [Physics3D](../docs/simulation/physics3d.md#characters) |
| Vehicles | `addVehicle`: wheels with suspension, an engine, steering, and a hand brake; `isTracked:` makes a machine that turns by driving its two sides at different speeds | [Something to drive: the vehicle](31-charactersandcloth.md#something-to-drive-the-vehicle), [Turning without steering: tracks](31-charactersandcloth.md#turning-without-steering-tracks) | [Physics3D](../docs/simulation/physics3d.md#vehicles) |
| Cloth and soft bodies | `addSoftBody(from:at:)`: cloth that drapes and balloons that hold their air, pinned where you say, touching the rigid world and floating like any body | [Cloth that finds its own shape: soft bodies](31-charactersandcloth.md#cloth-that-finds-its-own-shape-soft-bodies), [A cloth among the contacts](31-charactersandcloth.md#a-cloth-among-the-contacts), [A raft made of cloth: soft bodies that float](31-charactersandcloth.md#a-raft-made-of-cloth-soft-bodies-that-float) | [Physics3D](../docs/simulation/physics3d.md#softbodies) |
| Ragdolls | `addRagdoll(from:at:)`: a figure that falls, and with `drive(toward:strength:)`, one that tries to stand | [Letting a figure fall: the ragdoll](31-charactersandcloth.md#letting-a-figure-fall-the-ragdoll), [A figure that tries to stand: powered ragdolls](31-charactersandcloth.md#a-figure-that-tries-to-stand-powered-ragdolls) | [Physics3D](../docs/simulation/physics3d.md#ragdolls) |
| Cloth a figure carries | `skinnedTo:` and `carriedBy:` hang cloth on a moving figure, with sway and a limit on how far it stretches | [A cape on someone's back: cloth a skeleton carries](31-charactersandcloth.md#a-cape-on-someones-back-cloth-a-skeleton-carries) | [Physics3D](../docs/simulation/physics3d.md#carriedcloth) |
| Ropes | `addRope(through:at:radius:pinned:)`: a rope that knows how far it is twisted as well as where it bends | [A line that knows how it is turned: ropes](31-charactersandcloth.md#a-line-that-knows-how-it-is-turned-ropes) | [Physics3D](../docs/simulation/physics3d.md#ropes) |

### Chapter 32: Sculpting with fields

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| 2D SDF combinators | Shapes as distance fields that merge, melt, morph, and repeat | [A shape as a question: the signed distance field](32-sculptingwithfields.md#a-shape-as-a-question-the-signed-distance-field), [Melting: the smooth minimum](32-sculptingwithfields.md#melting-the-smooth-minimum), [Carving, overlapping, and halfway: the other verbs](32-sculptingwithfields.md#carving-overlapping-and-halfway-the-other-verbs), [Folding space: domain repetition](32-sculptingwithfields.md#folding-space-domain-repetition) | [Combinators](../docs/drawing/combinators.md) |
| Raymarched 3D fields | `SDF3D` drawn by sphere tracing through the camera, sharing depth with meshes | [Into space: `SDF3D` and `drawSDF3D`](32-sculptingwithfields.md#into-space-sdf3d-and-drawsdf3d), [How the picture gets made: sphere tracing](32-sculptingwithfields.md#how-the-picture-gets-made-sphere-tracing) | [Combinators](../docs/drawing/combinators.md) |
| Field distortions | `twisted(_:)`, `bent(_:)`, `displaced(amplitude:frequency:)`, and `roughened(amplitude:frequency:)` bend a whole field at once | [Bending the whole form: distortions](32-sculptingwithfields.md#bending-the-whole-form-distortions) | [Combinators](../docs/drawing/combinators.md#fields-3d) |
| Joins like joinery | `chamferUnion`, `stairsUnion`, and `columnsUnion` join shapes with machined edges, and `smoothUnion(k:) { }` merges ordinary draw calls | [Joins like joinery: the machined family](32-sculptingwithfields.md#joins-like-joinery-the-machined-family), [Merging ordinary draw calls: the block form](32-sculptingwithfields.md#merging-ordinary-draw-calls-the-block-form) | [Combinators](../docs/drawing/combinators.md#combining) |
| The `sculpt { }` block | Add, carve, and blend shapes with stateful verbs, in 2D or 3D, made for live coding | [Building up and carving away: the sculpt block](32-sculptingwithfields.md#building-up-and-carving-away-the-sculpt-block) | [Combinators](../docs/drawing/combinators.md) |
| Fractal fields | `mandelbulb`, `mengerSponge`, and `mandelbox` as leaves of a raymarched field, each a distance estimate | [Infinite detail: the fractal leaves](32-sculptingwithfields.md#infinite-detail-the-fractal-leaves) | [Combinators](../docs/drawing/combinators.md#fractals) |
| Isosurfaces and metaballs | The surface where a field over space crosses a level, built as a `Mesh` by marching cubes, or by dual contouring to keep sharp corners: soft spheres that fuse, and noise volumes | [Any field as a mesh: isosurface](32-sculptingwithfields.md#any-field-as-a-mesh-isosurface), [Soft spheres that add up: metaballs](32-sculptingwithfields.md#soft-spheres-that-add-up-metaballs), [Corners that stay sharp: dual contouring](32-sculptingwithfields.md#corners-that-stay-sharp-dual-contouring) | [Isosurfaces](../docs/generators/isosurface.md) |

### Chapter 33: Traced light

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Ray-traced reflections | `rayTracedReflections()`: surfaces that reflect the scene's geometry, off-screen parts and hidden faces included, on a ray-tracing GPU; `glossyReflections()` blurs them, and `reflectionBounces(_:)` lets mirrors face mirrors | [Mirrors that see off screen: ray-traced reflections](33-tracedlight.md#mirrors-that-see-off-screen-ray-traced-reflections), [The floor that shows the room: glossy reflections](33-tracedlight.md#the-floor-that-shows-the-room-glossy-reflections), [Mirrors facing mirrors: reflectionBounces](33-tracedlight.md#mirrors-facing-mirrors-reflectionbounces) | [3D](../docs/3d/3d.md) |
| Global illumination | `globalIllumination(intensity:)` lets light bounce off one surface and color the next, on a ray-tracing GPU | [Light that bounces: global illumination](33-tracedlight.md#light-that-bounces-global-illumination) | [3D](../docs/3d/3d.md#global-illumination) |
| Caustics | The light glass and polished metal focus, photon-traced: a lens's bright spot inside its own shadow, a chrome ring's folded fan, prism rainbows via dispersion | [The light the glass takes, given back: caustics](33-tracedlight.md#the-light-the-glass-takes-given-back-caustics) | [Caustics](../docs/3d/caustics.md) |
| Temporal anti-aliasing | `temporalAntialiasing()`: 3D edges refined past the fixed samples per pixel by shifting the projection a fraction of a pixel each frame and averaging the frames; `withMotion { }` keeps a moving mesh's edges smooth | [Edges that settle: temporal anti-aliasing](33-tracedlight.md#edges-that-settle-temporal-anti-aliasing) | [3D](../docs/3d/3d.md#temporal-anti-aliasing) |
| Motion blur | `motionBlur(shutter:)`: the streak a shutter leaves, worked out from how far each surface moved since the frame before | [The streak a shutter leaves: motion blur](33-tracedlight.md#the-streak-a-shutter-leaves-motion-blur) | [3D](../docs/3d/3d.md#motion-blur) |
| Lens flare | The light the camera adds: the ghosts a lens prescription throws from a bright source and the star on the source, both shaped by the iris blades, fading as something covers the source | [Light in the camera: lens flare](33-tracedlight.md#light-in-the-camera-lens-flare) | [Lens flare](../docs/3d/lensflare.md) |
| Path-traced export | `--path-traced` renders the 3D scene by tracing light: soft shadows, bounce color, mirror in mirror, glass, glowing meshes as lights, textures in the bounces, and a lens; `--pt-noise` lets a settled pixel stop early and spends the count where the grain is; `--pt-clamp` bounds what one bounce may add to a sample, so a polished scene's fireflies go, at a bias the recipe states; `--pt-reuse` carries the earlier frames' samples into each frame of a sequence, so the grain settles and holds still; `--pt-seconds` gives each frame a time in place of a count, and the recipe records the count it reached; `--denoise` filters out the grain | [Light followed path by path: the path-traced export](33-tracedlight.md#light-followed-path-by-path-the-path-traced-export), [Grain filtered out: denoising](33-tracedlight.md#grain-filtered-out-denoising) | [Path-traced export](../docs/output/pathtraced.md) |
| Specular anti-aliasing | `specularAntialiasing()`: highlights that hold still instead of crawling and sparkling as a surface turns | [Highlights that hold still: specular anti-aliasing](33-tracedlight.md#highlights-that-hold-still-specular-anti-aliasing) | [3D](../docs/3d/3d.md#specular-anti-aliasing) |
| Bokeh | `.defocus(blades:catsEye:)` shapes the out-of-focus blur by the iris blades, with the cat's-eye shape toward the edges | [The shape of a blur: bokeh](33-tracedlight.md#the-shape-of-a-blur-bokeh) | [Effects](../docs/drawing/effects.md#combined) |
| Depth of field on the canvas | `depthOfField()`: the 3D frame blurred by its own depth through the camera's lens (`aperture`, `focusDistance`, `apertureBlades`), a blurred foreground turned into a veil | [The frame through the camera's lens: depthOfField()](33-tracedlight.md#the-frame-through-the-cameras-lens-depthoffield) | [3D](../docs/3d/3d.md#depth-of-field) |
| The overlay | `withOverlay { }`: a block drawn over the finished frame after every pass, so a caption or a readout stays sharp under the lens, the edge average, and the motion blur, and never joins an accumulating canvas | [The frame through the camera's lens: depthOfField()](33-tracedlight.md#the-frame-through-the-cameras-lens-depthoffield) | [Effects](../docs/drawing/effects.md#withoverlay) |
| Depth of field from light | `LineSpray` and `Bokeh`: lines drawn as millions of scattered points through a lens into a running mean, until the lens's blur appears; the `.light` particle style and the `develop` print underneath | [A lens made of samples: depth of field from light](33-tracedlight.md#a-lens-made-of-samples-depth-of-field-from-light); Ch 25: [Grains as light: the light style and the running mean](25-particlesimulations.md#grains-as-light-the-light-style-and-the-running-mean); Ch 19: [Converging instead of brightening: the running mean](19-layersandeffects.md#converging-instead-of-brightening-the-running-mean) | [Depth of field from light](../docs/drawing/depthoffield.md) |
| Motion for a changing mesh | `drawMesh(_:previous:)` hands motion blur and anti-aliasing the mesh's shape from the frame before | [A mesh that changes shape: drawMesh(_:previous:)](33-tracedlight.md#a-mesh-that-changes-shape-drawmesh_previous) | [3D](../docs/3d/3d.md#temporal-anti-aliasing) |
| Temporal upscaling | `temporalUpscaling(_:)`: render fewer pixels and let MetalFX build the frame back at full size, in the live window | [Rendering fewer pixels: temporal upscaling](33-tracedlight.md#rendering-fewer-pixels-temporal-upscaling) | [3D](../docs/3d/3d.md#temporal-upscaling) |
| Frames between the drawn ones | `frameInterpolation()`: `draw()` runs every other refresh and the platform builds the frame in between, so a heavy scene drawn at thirty frames a second moves at the display's sixty, one refresh later | [Drawing fewer frames: frame interpolation](33-tracedlight.md#drawing-fewer-frames-frame-interpolation) | [3D](../docs/3d/3d.md#frames-between-the-drawn-ones) |

## Part VI: The world coming in

### Chapter 34: Seeing

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Camera feeds | The webcam, or any frame source, drawn with `drawFrame` and read by trackers as it runs | [The webcam is an image](34-seeing.md#the-webcam-is-an-image), [Trackers: attach, then read](34-seeing.md#trackers-attach-then-read) | [Vision](../docs/vision/vision.md) |
| Video playback | Video files as live textures you play, seek, and loop, frame for frame the same under an export | [When there is no camera: stills and footage](34-seeing.md#when-there-is-no-camera-stills-and-footage) | [Video](../docs/video/video.md) |
| A feed with no camera | `Camera.orStill` and `StillFrames`, so a sketch that reads the world runs with nothing plugged in | [When there is no camera: stills and footage](34-seeing.md#when-there-is-no-camera-stills-and-footage) | [Vision](../docs/vision/vision.md#nocamera) |
| Motion trackers | Object tracking, the paths of thrown things, and dense optical flow | [The picture as a field: optical flow](34-seeing.md#the-picture-as-a-field-optical-flow), [A patch you point at: ObjectTracker](34-seeing.md#a-patch-you-point-at-objecttracker), [Things that fly: TrajectoryTracker](34-seeing.md#things-that-fly-trajectorytracker) | [Vision](../docs/vision/vision.md) |
| People trackers | Faces with landmarks, hands, 2D and 3D body poses, and person segmentation | [The body as a controller: hands, faces, and bodies](34-seeing.md#the-body-as-a-controller-hands-faces-and-bodies), [The person as pixels: lifting the subject](34-seeing.md#the-person-as-pixels-lifting-the-subject) | [Vision](../docs/vision/vision.md) |
| Still analysis | Most trackers also run once on an `Image` | [The body as a controller: hands, faces, and bodies](34-seeing.md#the-body-as-a-controller-hands-faces-and-bodies) | [Vision](../docs/vision/vision.md) |
| Scene trackers | Contours, rectangles, barcodes, text (OCR), saliency, classification, and the subject lifted from a picture, whole or at a point you give | [Reading outlines and print: contours, rectangles, text, and codes](34-seeing.md#reading-outlines-and-print-contours-rectangles-text-and-codes), [Words for the scene: ImageClassifier](34-seeing.md#words-for-the-scene-imageclassifier), [Where an eye would go: SaliencyTracker](34-seeing.md#where-an-eye-would-go-saliencytracker), [The person as pixels: lifting the subject](34-seeing.md#the-person-as-pixels-lifting-the-subject), [A click cuts it loose: PointSegmenter](34-seeing.md#a-click-cuts-it-loose-pointsegmenter) | [Vision](../docs/vision/vision.md) |
| `ModelTracker` | A Core ML model of your own: classifiers, detectors, image-to-image maps, and segmenters, with `sketchResource(_:)` to find the model file | [Bringing your own model: ModelTracker](34-seeing.md#bringing-your-own-model-modeltracker), [Models of your own](34-seeing.md#models-of-your-own) | [Vision](../docs/vision/vision.md) |
| Depth from a picture | `DepthTracker` estimates depth from one camera and holds it steady from frame to frame; `DepthClip` reads a whole recorded clip first, so an export gets the same depth each run | [Depth that holds still: DepthTracker](34-seeing.md#depth-that-holds-still-depthtracker), [A clip read whole for an export: DepthClip](34-seeing.md#a-clip-read-whole-for-an-export-depthclip) | [Vision](../docs/vision/vision.md#depthtracker) |
| Words as numbers | `ConceptTracker` scores phrases you type against the picture, as numbers a sketch can use | [Words as numbers: ConceptTracker](34-seeing.md#words-as-numbers-concepttracker) | [Vision](../docs/vision/vision.md#concepttracker) |
| The camera in a 3D scene | `Environment.feed` lights a 3D scene with the camera's picture, and `textured(_:)` wraps a mesh in the live frame | [The room as the light: Environment.feed](34-seeing.md#the-room-as-the-light-environmentfeed), [The room as the surface: textured](34-seeing.md#the-room-as-the-surface-textured) | [3D](../docs/3d/3d.md#live-environment) |
| Screen capture | `ScreenCapture`: a display, an app, or one window on the Mac as a live frame source, with nothing asked of the app it captures; a tracker reads it like a camera, and `excludesOwnWindows = false` puts the sketch's own window in the picture as a feedback tunnel | [Drawing with the screen: ScreenCapture](34-seeing.md#drawing-with-the-screen-screencapture) | [ScreenCapture](../docs/integration/screencapture.md) |
| Slit scan | A rolling frame history read back through a per-pixel time delay: time as a spatial dimension | [Every pixel its own moment: SlitScan](34-seeing.md#every-pixel-its-own-moment-slitscan) | [SlitScan](../docs/video/slitscan.md) |

### Chapter 35: Depth

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| RGBD frames | Color plus depth plus intrinsics; `unproject` turns a pixel into a point in meters | [What a depth camera sees](35-depth.md#what-a-depth-camera-sees), [Standing the picture up](35-depth.md#standing-the-picture-up) | [RGBD](../docs/3d/rgbd.md) |
| Point clouds | Points drawn as instanced splats that face the camera, in the hundreds of thousands | [Standing the picture up](35-depth.md#standing-the-picture-up) | [3D](../docs/3d/3d.md) |
| World fusion | `WorldCloud` fuses depth frames into one world cloud by their poses, and `ScanGraph` recognizes a place the scan comes back to, so the scan agrees with itself | [One world from many frames](35-depth.md#one-world-from-many-frames), [When the camera loses its place: correcting drift](35-depth.md#when-the-camera-loses-its-place-correcting-drift), [Coming back to where you started: closing the loop](35-depth.md#coming-back-to-where-you-started-closing-the-loop) | [Phone](../docs/3d/phone.md) |
| A depth frame as the stage | `drawDepthScene(_:)` puts a depth frame behind the 3D scene as both backdrop and depth, with `camera(.intrinsic(_:))` matched to its lens | [Solids behind the scene: drawDepthScene](35-depth.md#solids-behind-the-scene-drawdepthscene) | [DepthCompositing](../docs/3d/depthcompositing.md) |
| Surface reconstruction | `reconstructSurface` and `particleSurface`: a scanned or generated point cloud turned back into a `Mesh`, with holes in the data left open, and particle sets skinned as one blended body | [A solid from a sweep: reconstructSurface](35-depth.md#a-solid-from-a-sweep-reconstructsurface), [Points as their own material: particleSurface](35-depth.md#points-as-their-own-material-particlesurface) | [Surface reconstruction](../docs/generators/surfacereconstruction.md) |

### Chapter 36: The iPhone as a sensor

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Recorded captures | Open `.r3d` depth recordings as point clouds, with the intrinsics of the camera that made them | [Depth footage: Record3D clips and the live stream](36-thephoneasasensor.md#depth-footage-record3d-clips-and-the-live-stream) | [Record3D](../docs/3d/record3d.md) |
| Live USB depth | A tethered phone's RGBD stream, frame by frame | [Depth footage: Record3D clips and the live stream](36-thephoneasasensor.md#depth-footage-record3d-clips-and-the-live-stream) | [Record3D](../docs/3d/record3d.md) |
| The capture app | Ollin's own iPhone app runs ARKit on the phone and streams typed results through `PhoneDevice`, starting with LiDAR depth and the phone's pose as it moves | [Ollin's own app: Ollin Capture](36-thephoneasasensor.md#ollins-own-app-ollin-capture) | [Phone](../docs/3d/phone.md) |
| A body in solids | The phone's skeleton in meters, each joint with an orientation, dressed in capsules, and read from a film with `BodyTracker3D` when no phone streams | [A pose you can dress in solids: the body](36-thephoneasasensor.md#a-pose-you-can-dress-in-solids-the-body), [When no phone is streaming: the film](36-thephoneasasensor.md#when-no-phone-is-streaming-the-film), [Putting it together: the dancer in solids](36-thephoneasasensor.md#putting-it-together-the-dancer-in-solids) | [Phone](../docs/3d/phone.md#the-body), [Vision](../docs/vision/vision.md#bodytracker3d) |
| The room from the phone | The phone's labeled room mesh, the flat surfaces it found, and the light it measured in the room | [The room from the phone: its mesh, its surfaces, and its light](36-thephoneasasensor.md#the-room-from-the-phone-its-mesh-its-surfaces-and-its-light), [A surface the phone already built: the room mesh](36-thephoneasasensor.md#a-surface-the-phone-already-built-the-room-mesh), [Somewhere to stand: flat surfaces](36-thephoneasasensor.md#somewhere-to-stand-flat-surfaces), [The light in the room: PhoneLight](36-thephoneasasensor.md#the-light-in-the-room-phonelight) | [Phone](../docs/3d/phone.md#the-room-mesh) |
| More of a person from the phone | Hands measured in meters, and where a look lands | [More of a person from the phone: hands and a gaze](36-thephoneasasensor.md#more-of-a-person-from-the-phone-hands-and-a-gaze), [A hand you can reach in with: hands](36-thephoneasasensor.md#a-hand-you-can-reach-in-with-hands), [Where a look lands: gaze](36-thephoneasasensor.md#where-a-look-lands-gaze) | [Phone](../docs/3d/phone.md#the-hands) |
| The picture from the phone | Text read and placed in the world, where an eye would go, how the picture is moving, and pictures the phone was told to look for | [The picture from the phone: words, attention, motion, and a known print](36-thephoneasasensor.md#the-picture-from-the-phone-words-attention-motion-and-a-known-print), [The words on the wall: text](36-thephoneasasensor.md#the-words-on-the-wall-text), [What draws the eye: attention](36-thephoneasasensor.md#what-draws-the-eye-attention), [How the picture is moving: flow](36-thephoneasasensor.md#how-the-picture-is-moving-flow), [A picture it knows: markers](36-thephoneasasensor.md#a-picture-it-knows-markers) | [Phone](../docs/3d/phone.md#the-text-in-view) |
| The phone in your hand | The phone as a pointer, its `Ray3` hitting things in the scene, the sounds it hears named, touches on its glass, and the air pressure around it | [The phone in your hand: a wand, its ears, the glass, and the air](36-thephoneasasensor.md#the-phone-in-your-hand-a-wand-its-ears-the-glass-and-the-air), [Pointing at it with the phone: the wand](36-thephoneasasensor.md#pointing-at-it-with-the-phone-the-wand), [What the phone hears: sound events](36-thephoneasasensor.md#what-the-phone-hears-sound-events), [Playing the glass: touches](36-thephoneasasensor.md#playing-the-glass-touches), [The air it is standing in: the barometer](36-thephoneasasensor.md#the-air-it-is-standing-in-the-barometer) | [Phone](../docs/3d/phone.md#the-phone-as-a-pointer), [Geometry](../docs/drawing/geometry.md#ray3) |

### Chapter 37: Listening

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Audio analysis | Amplitude, spectrum, waveform, and log-spaced bands | [Loudness from the microphone: `amplitude`](37-listening.md#loudness-from-the-microphone-amplitude), [What the analyzer hears: waveform, spectrum, and bands](37-listening.md#what-the-analyzer-hears-waveform-spectrum-and-bands) | [Audio](../docs/helpers/audio.md) |
| Audio sources | The microphone, audio files (the same numbers under an export), test tones, and a video's soundtrack | [Four sources: the microphone, a file, a tone, and a video](37-listening.md#four-sources-the-microphone-a-file-a-tone-and-a-video) | [Audio](../docs/helpers/audio.md) |
| Feeding the analyzer yourself | An `AudioAnalyzer` fed samples you make with `analyze(samples:count:)`, one frame's worth at a time, so its numbers are the same on every run; the chapter's `StageMic` feeds it a made-up band this way | [A band that plays the same every run: `StageMic`](37-listening.md#a-band-that-plays-the-same-every-run-stagemic) | [Audio](../docs/helpers/audio.md#audioanalyzer) |
| Beat detection | Onsets as events: `beat`, `beatCount`, `timeSinceBeat` | [Hearing the beat: onsets](37-listening.md#hearing-the-beat-onsets) | [Audio](../docs/helpers/audio.md) |
| Pitch tracking | The note being sung or played as `pitch` (its hertz, confidence, nearest note, cents, and MIDI number) and `nearestPitch`, and the twelve pitch classes as `chroma`, with the octaves folded together | [One note at a time: `pitch`](37-listening.md#one-note-at-a-time-pitch), [Every note in the air: `chroma`](37-listening.md#every-note-in-the-air-chroma) | [Audio](../docs/helpers/audio.md#pitch) |
| Listening | Speech as a caption that corrects itself, phrases you can trigger from, and about 300 everyday sounds named as they happen | [Words as they are spoken: `SpeechListener`](37-listening.md#words-as-they-are-spoken-speechlistener), [Sounds with names: `SoundClassifier`](37-listening.md#sounds-with-names-soundclassifier) | [Listening](../docs/helpers/listening.md) |

### Chapter 38: Controls and signals

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| MIDI | Knobs, notes, and messages from hardware controllers, sent as well as read, and each held note's own bend, pressure, and slide from an MPE surface | [Parameters from anywhere: MIDI and OSC](38-controlsandsignals.md#parameters-from-anywhere-midi-and-osc); Ch 39: [A note under the finger: expression](39-makingsound.md#a-note-under-the-finger-expression) | [MIDI](../docs/integration/midi.md) |
| OSC | `OSCReceiver` reads network control messages from tablets, DAWs, and other machines, and `OSCSender` sends them out | [Over the network: OSC](38-controlsandsignals.md#over-the-network-osc) | [OSC](../docs/integration/osc.md) |
| MIDI clock | `TempoClock(from:)` follows the beat a drum machine, a DJ mixer, or a DAW sends as MIDI clock, as beats, bars, and a phase to animate with | [Musical time: MIDI clock and Link](38-controlsandsignals.md#musical-time-midi-clock-and-link) | [MIDI](../docs/integration/midi.md#tempo-sync-tempoclock) |
| Link | `LinkClock` joins the shared tempo session on the network, so every app that joins keeps one tempo and lands the same downbeat, with the reads `TempoClock` has | [One beat for the whole room: Link](38-controlsandsignals.md#one-beat-for-the-whole-room-link) | [Link](../docs/integration/link.md) |
| Parameter binding | One `@Param` driven by MIDI (a knob or the pitch wheel), OSC, serial, Bluetooth, and the inspector alike, with smoothing, and show-rules that hide a parameter while another leaves it nothing to do | [One parameter, three hands: binding and smoothing](38-controlsandsignals.md#one-parameter-three-hands-binding-and-smoothing) | [Parameters](../docs/helpers/parameters.md) |
| Game controllers | Sticks, triggers, and buttons read in `draw()`, plus motion and a touchpad on hardware that has them, with several players at once and centered sticks and unpressed buttons when nothing is plugged in | [Something to hold: game controllers](38-controlsandsignals.md#something-to-hold-game-controllers) | [Controller](../docs/integration/controller.md) |
| The weather outside | `Weather` reads the sky over a place or a name in plain units, and `Place.sun(at:)` puts the sun where the clock says | [The weather outside: Weather](38-controlsandsignals.md#the-weather-outside-weather) | [Weather](../docs/helpers/weather.md) |
| Haptics | A pattern of taps and hums played from `draw()`, put together like a phrase, and turned into a trackpad's three feelings and one strength | [Touch as an output: haptics](38-controlsandsignals.md#touch-as-an-output-haptics) | [Haptics](../docs/integration/haptics.md) |
| Pinch and turn | Two fingers on the trackpad, or on the phone showing the sketch, read in `draw()` as this frame's change of size and turn, with a hook for each, recorded into a take, and zooming `viewControl()` and `cameraControl()` | [Two fingers on the trackpad: pinch and turn](38-controlsandsignals.md#two-fingers-on-the-trackpad-pinch-and-turn) | [Input](../docs/helpers/input.md#pinch) |
| Typed text | The keyboard read as a text field reads it: a dead key's accent, the emoji viewer's pick, and an input method's confirmed word arrive through `typedText()`, the reading still being composed in `composingText`, with a hook as text arrives | [Text the way a text field takes it: typed text](38-controlsandsignals.md#text-the-way-a-text-field-takes-it-typed-text) | [Input](../docs/helpers/input.md#typed-text) |
| TUIO | Touches, tagged pieces, and shapes from a marker table, a touch wall, or a phone app | [A table you put things on: TUIO](38-controlsandsignals.md#a-table-you-put-things-on-tuio) | [TUIO](../docs/integration/tuio.md) |
| Serial | A USB microcontroller's sensor lines read in `draw()` or bound to a parameter, lines written back to drive the hardware, a port that waits through unplugs and reopens itself, and `FirmataBoard` for a board running Firmata | [A wire to the physical world: serial](38-controlsandsignals.md#a-wire-to-the-physical-world-serial) | [Serial](../docs/integration/serial.md) |
| Bluetooth | A Bluetooth Low Energy sensor read in `draw()` or bound to a parameter, `BluetoothScan` listing the devices in range, the formats that turn bytes into values, and a connection that waits and reconnects by itself | [The same loop, without the wire: Bluetooth](38-controlsandsignals.md#the-same-loop-without-the-wire-bluetooth) | [Bluetooth](../docs/integration/bluetooth.md) |
| OSCQuery | The sketch's parameters published as a tree a control app browses and builds its own controls from, the values coming back over OSC | [The sketch that says what it takes: OSCQuery](38-controlsandsignals.md#the-sketch-that-says-what-it-takes-oscquery) | [OSCQuery](../docs/integration/oscquery.md) |
| Curves and bars | A `ResponseCurve` parameter shaped by dragging its points and read like an easing, and a list of numbers painted as a row of bars, both saved into the sketch and held by a cue | [Shapes you draw: a curve and a row of bars](38-controlsandsignals.md#shapes-you-draw-a-curve-and-a-row-of-bars) | [Parameters](../docs/helpers/parameters.md#response-curve) |
| Smoothing | `@Smoothed` calms a jittery input, such as the mouse, a tracker, or a sensor, as it arrives | [A value that is not a parameter: `@Smoothed`](38-controlsandsignals.md#a-value-that-is-not-a-parameter-smoothed) | [Animation](../docs/helpers/animation.md) |
| Live data | `DataFeed` reads one address over and over in the background, counting only the answers that changed; `PushFeed` holds a connection open for messages that arrive on their own | [Numbers that keep arriving: DataFeed](38-controlsandsignals.md#numbers-that-keep-arriving-datafeed), [Messages that arrive on their own: PushFeed](38-controlsandsignals.md#messages-that-arrive-on-their-own-pushfeed) | [LiveData](../docs/helpers/livedata.md) |

## Part VII: Out into the world

### Chapter 39: Making sound

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Synthesis | A `Synth` the sketch plays: notes by name or number, voice presets, envelopes, and filters | [A sketch that plays](39-makingsound.md#a-sketch-that-plays) | [Synthesis](../docs/helpers/synthesis.md) |
| Physical models | A plucked string worked out sample by sample, a shape you strike that rings in its own modes, and a bowed string and a blown tube you keep playing | [A string worked out sample by sample: the plucked string](39-makingsound.md#a-string-worked-out-sample-by-sample-the-plucked-string), [A shape you can hit: modal synthesis](39-makingsound.md#a-shape-you-can-hit-modal-synthesis), [A note you keep playing: bowed and blown](39-makingsound.md#a-note-you-keep-playing-bowed-and-blown) | [Synthesis](../docs/helpers/synthesis.md#physical-models) |
| The effects chain | `synth.effects`: distortion, delay, reverb, chorus, and a limiter in a chain after the note, in the order you list them, and a room of your own from a recording or a rule (convolution reverb) | [After the note: the effects chain](39-makingsound.md#after-the-note-the-effects-chain), [A room you can draw: convolution reverb](39-makingsound.md#a-room-you-can-draw-convolution-reverb) | [Synthesis](../docs/helpers/synthesis.md#effects) |
| Patches and FM | `Patch` builds an instrument from oscillators, and `modulated(by:amount:)` lets one oscillator push another's frequency back and forth (FM) | [Building an instrument instead of choosing one: patches and FM](39-makingsound.md#building-an-instrument-instead-of-choosing-one-patches-and-fm) | [Synthesis](../docs/helpers/synthesis.md#patch) |
| Sampled instruments | `SampledInstrument`: an instrument played from recordings, the built-in one or an SFZ set you load | [An instrument somebody recorded: sampled instruments](39-makingsound.md#an-instrument-somebody-recorded-sampled-instruments) | [Synthesis](../docs/helpers/synthesis.md#sampled-instruments) |
| Wavetables and grains | A wavetable read by position, and a grain cloud cut from a sound, so a moment can be held and dragged through | [A wave you can draw: wavetables](39-makingsound.md#a-wave-you-can-draw-wavetables), [A sound in pieces: grains](39-makingsound.md#a-sound-in-pieces-grains) | [Synthesis](../docs/helpers/synthesis.md#wavetables) |
| More effects | The four effects that move a sound (chorus, flanger, phaser, tremolo), the three that hold its level (compressor, limiter, gate), pitch shift, freeze, and stretch, and an effect you write yourself | [Something that moves: chorus, flanger, phaser, tremolo](39-makingsound.md#something-that-moves-chorus-flanger-phaser-tremolo), [Something that holds a level: compressor, limiter, gate](39-makingsound.md#something-that-holds-a-level-compressor-limiter-gate), [Something that takes the sound apart: pitch shift, freeze, stretch](39-makingsound.md#something-that-takes-the-sound-apart-pitch-shift-freeze-stretch), [An effect nobody wrote for you: custom effects](39-makingsound.md#an-effect-nobody-wrote-for-you-custom-effects) | [Synthesis](../docs/helpers/synthesis.md#effects) |
| Per-note expression | `noteOn` returns a `PlayingNote`, and `bend(_:semitones:)`, `press(_:_:)`, and `slide(_:_:)` shape that one note while it sounds | [A note under the finger: expression](39-makingsound.md#a-note-under-the-finger-expression) | [Synthesis](../docs/helpers/synthesis.md#expression) |

### Chapter 40: Music by rule

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Tempo and steps | `Tempo` turns the clock's seconds into beats and a `NoteLength` into seconds, and `StepCounter` hands back each step number the beats have passed | [Beats and note lengths: `Tempo` and `NoteLength`](40-musicbyrule.md#beats-and-note-lengths-tempo-and-notelength), [One step at a time: `StepCounter`](40-musicbyrule.md#one-step-at-a-time-stepcounter) | [Composition](../docs/helpers/composition.md) |
| Euclidean rhythms | `Rhythm` spreads hits as evenly as it can over a number of steps, rotated to start where you say | [Hits spread evenly: Euclidean rhythms with `Rhythm`](40-musicbyrule.md#hits-spread-evenly-euclidean-rhythms-with-rhythm) | [Composition](../docs/helpers/composition.md) |
| Swing | Every second step played late by the same fraction of its pair, through the wait a synth's `play(_:velocity:for:after:)` takes | [Late on purpose: swing](40-musicbyrule.md#late-on-purpose-swing) | [Composition](../docs/helpers/composition.md) |
| Scales | `Scale` turns a degree into a note that stays in key | [Staying in key: `Scale`](40-musicbyrule.md#staying-in-key-scale) | [Composition](../docs/helpers/composition.md) |
| Chords and arpeggios | `Chord` names a chord by its root and kind, `chord(on:)` builds one on a degree of a `Scale`, and `Arpeggio` plays its notes one step at a time | [Chords from the key: `Chord` and `Arpeggio`](40-musicbyrule.md#chords-from-the-key-chord-and-arpeggio) | [Composition](../docs/helpers/composition.md) |
| Markov chains | `MarkovChain` counts what followed what in a motif and picks each next element by those counts, the same line for the same seed | [What comes next: a `MarkovChain`](40-musicbyrule.md#what-comes-next-a-markovchain); Ch 4: [A roll that remembers the last one: `MarkovChain`](04-randomness.md#a-roll-that-remembers-the-last-one-markovchain) | [Composition](../docs/helpers/composition.md) |
| Chord progressions | `Progression` plays a key's chords by Roman numeral, or chords named by symbol from any key, with named progressions and `wandering(_:)` for a longer run that makes only the moves the original made | [Chords that come out of a key: `Progression`](40-musicbyrule.md#chords-that-come-out-of-a-key-progression) | [Composition](../docs/helpers/composition.md) |
| MIDI files | A Standard MIDI File read into notes a sketch plays or draws, and written back out so a phrase opens in a sequencer; its tempo map read from beats to seconds and back; a take recorded from a `Synth` as it plays | [Keeping what it played: writing a MIDI file](40-musicbyrule.md#keeping-what-it-played-writing-a-midi-file), [Music that travels between programs: MIDI files](40-musicbyrule.md#music-that-travels-between-programs-midi-files) | [MIDI files](../docs/helpers/midifiles.md) |
| A step sequencer | `StepSequencer`: a grid of steps with swing, velocity, chance, and ratchets, read at the beat you hand it | [A grid with a feel: `StepSequencer`](40-musicbyrule.md#a-grid-with-a-feel-stepsequencer) | [Composition](../docs/helpers/composition.md) |
| An arpeggiator | `Arpeggiator` plays the notes you hold as a pattern, one step at a time | [A chord played as it is held: `Arpeggiator`](40-musicbyrule.md#a-chord-played-as-it-is-held-arpeggiator) | [Composition](../docs/helpers/composition.md) |
| Tunings | `Tuning`: equal temperament, just intonation, Pythagorean tuning, other divisions of the octave, and Bohlen-Pierce | [Other divisions of the octave: `Tuning`](40-musicbyrule.md#other-divisions-of-the-octave-tuning) | [Composition](../docs/helpers/composition.md#tuning) |
| Playing along with the room | `BeatFollower` finds the beat in the sound it hears, so the music keeps time with the room | [Playing along with the room: tempo sync](40-musicbyrule.md#playing-along-with-the-room-tempo-sync) | [Composition](../docs/helpers/composition.md#beatfollower) |
| Sonification | Numbers read out as notes: a table column, a terrain profile, or a picture row spread over a range of pitch and snapped to a scale | [Numbers you can hear: sonification](40-musicbyrule.md#numbers-you-can-hear-sonification) | [Sonification](../docs/helpers/sonification.md) |
| Spatial audio and sound in an export | `place(at:heardFrom:)` sounds a synth from a point in the 3D scene, heard from the camera; an export renders what the synths play into its soundtrack, the same on every run, with the placing kept | [Sound from a place in the scene: spatial audio](40-musicbyrule.md#sound-from-a-place-in-the-scene-spatial-audio), [Putting it together: the music box](40-musicbyrule.md#putting-it-together-the-music-box) | [Synthesis](../docs/helpers/synthesis.md#placing-a-sound), [Sound in an export](../docs/helpers/synthesis.md#sound-in-an-export) |

### Chapter 41: Finishing a sketch

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Stills and sequences | `--export` writes a frame as PNG or HEIC, and `--export-sequence` a folder of them | [Every export runs without a window](41-finishingasketch.md#every-export-runs-without-a-window) | [Export](../docs/output/export.md) |
| Paper sizes | `canvasSize` as a sheet such as `.a4`, `.a3`, or `.usLetter`, turned `.landscape`, at a `.dpi(_:)` you choose | [Sized for the output: fractions of the canvas, and paper sizes](41-finishingasketch.md#sized-for-the-output-fractions-of-the-canvas-and-paper-sizes) | [Canvas](../docs/core/canvas.md#export-size) |
| Video and GIF | `--export-video` (H.264, HEVC, ProRes) and `--export-gif`, the same frames on every run | [Motion: video and GIF](41-finishingasketch.md#motion-video-and-gif); Ch 3: [Putting it together: a loop that never ends](03-motionandtime.md#putting-it-together-a-loop-that-never-ends) | [Export](../docs/output/export.md) |
| SVG and PDF for plotters | `--export-svg` and `--export-pdf` write the drawing as vector paths, and `--hatch` turns fills into line work | [Lines for a pen: SVG and PDF](41-finishingasketch.md#lines-for-a-pen-svg-and-pdf); Ch 15: [How a plot runs](15-shapesasmaterial.md#how-a-plot-runs) | [Export](../docs/output/export.md) |
| Describable output | `describe(_:)` and `describe(_:as:in:)`: the sketch says what it shows and what its parts are, so a screen reader has something to read | [Saying what it shows: describable output](41-finishingasketch.md#saying-what-it-shows-describable-output) | [Accessibility](../docs/helpers/accessibility.md) |
| Reproducibility metadata | PNG, SVG, PDF, and video files carry their recipe: the seed, the `@Param` values, the git commit, and the frame; `--capture-source` keeps the code too | [The recipe in the file](41-finishingasketch.md#the-recipe-in-the-file) | [Export](../docs/output/export.md#reproducibility-metadata) |
| Setting a parameter for one run | `--param name=value` sets a parameter for an export, and `--list-params` shows what a sketch declares | [Passing the parameters back in](41-finishingasketch.md#passing-the-parameters-back-in) | [Export](../docs/output/export.md#setting-a-parameter-for-the-run) |
| Headless capture | `OllinApp.image(of:frame:)` renders a sketch to a `CGImage` in code, with no window; the export flags wrap it, and the guide's figures are made with it | [Rendering from code: `OllinApp.image(of:frame:)`](41-finishingasketch.md#rendering-from-code-ollinappimageofframe) | [Export](../docs/output/export.md) |
| Drawing finer than you save | `--render-scale` draws each frame larger and averages it back down, for finer edges on filled shapes and outline text | [Drawing finer than you save: supersampling](41-finishingasketch.md#drawing-finer-than-you-save-supersampling) | [Export](../docs/output/export.md#render-scale) |
| Linear frames for a compositor | `--export-exr` writes the frame before the tone map: light past white, the frame's coverage, and, for a 3D scene, the distance from the eye as a `Z` channel | [The frame before the tone map: OpenEXR](41-finishingasketch.md#the-frame-before-the-tone-map-openexr) | [Export](../docs/output/export.md) |
| Wide gamut and HDR output | `colorOutput`: Display P3 on screen, highlights brighter than white, HDR10 video, and HEIC stills with a gain map; `Color(displayP3:green:blue:)` for colors outside sRGB | [Brighter than white: HDR output](41-finishingasketch.md#brighter-than-white-hdr-output) | [Wide gamut & HDR output](../docs/drawing/coloroutput.md) |
| Transparent output | `background(.clear)` keeps the canvas see-through, and PNG and the two video codecs that carry alpha, `proRes4444` and `hevcWithAlpha`, keep that transparency, so the sketch lands over another layer | [Leaving the background behind: transparent video](41-finishingasketch.md#leaving-the-background-behind-transparent-video) | [Export](../docs/output/export.md#transparent-output) |
| Frame rates | `--fps` by number or by name (`ntsc`, `film`), a `FrameRate` in code, the broadcast fractions kept exact | [The grid a broadcast asks for: named frame rates](41-finishingasketch.md#the-grid-a-broadcast-asks-for-named-frame-rates) | [Export](../docs/output/export.md#frame-rates) |
| Slow motion in an export | `--slow-motion` renders the extra frames a slowed shot needs, so the motion stays smooth rather than stepping, and `--made-frames` has the GPU build the ones between for a heavy 3D scene | [Slower than it happened: slow motion](41-finishingasketch.md#slower-than-it-happened-slow-motion) | [Export](../docs/output/export.md#slow-motion) |
| Settled frames | `--settle` lets a running mean settle before each frame of a video is written | [Settled, then written: a running mean in a video](41-finishingasketch.md#settled-then-written-a-running-mean-in-a-video) | [Export](../docs/output/export.md#settled-frames) |
| Motion blur from subframes | `--subframes` draws each frame at moments across the open shutter and averages them, so anything a sketch draws streaks, 2D included, at that many times the render cost | [Blurred the slow way: subframes](41-finishingasketch.md#blurred-the-slow-way-subframes) | [Export](../docs/output/export.md#motion-blur-from-subframes) |
| A web page | `--export-web` records what the sketch draws and writes a page that plays it back in a browser, with the framework's shape shader rewritten in GLSL, as one file or a fragment for your own page | [A page that plays it: the web export](41-finishingasketch.md#a-page-that-plays-it-the-web-export) | [Web page](../docs/output/web.md) |

### Chapter 42: Making it physical

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| G-code for machines | `--export-gcode` writes the frame's line work as a machine program: pen plotter, laser, or mill, with the pen-up travel planned short | [Driving the machine itself: G-code](42-makingitphysical.md#driving-the-machine-itself-g-code) | [G-code](../docs/output/gcode.md) |
| A named sheet | `GCode(.plotter(), paper: .a4)` and `DXF(paper: .a3)` size a drawing for a sheet with a margin clear on every side, holding its height as well as its width; `--gcode-paper`, `--dxf-paper` | [Driving the machine itself: G-code](42-makingitphysical.md#driving-the-machine-itself-g-code) | [G-code](../docs/output/gcode.md#a-named-sheet) |
| Line drawing | `lineDrawing(of:)`: a 3D scene written down as 2D line work, with what the surfaces hide taken out: the silhouettes, creases, and boundaries a draftsman would draw, so a plotter, a laser, or a vector file can have the scene | [A 3D scene on the plotter: `lineDrawing(of:)`](42-makingitphysical.md#a-3d-scene-on-the-plotter-linedrawingof), [Putting it together: the printed knot](42-makingitphysical.md#putting-it-together-the-printed-knot) | [Line drawing](../docs/3d/linedrawing.md) |
| Print separations | `--export-separations`: one grayscale master per spot ink, screened into dots with `--screen` if you ask, with an overprint preview | [Printing one ink at a time: separations](42-makingitphysical.md#printing-one-ink-at-a-time-separations), [Putting it together: the printed knot](42-makingitphysical.md#putting-it-together-the-printed-knot) | [PrintSeparations](../docs/output/printseparations.md) |
| 3D printing | `mesh.write(to:)` as STL, OBJ, or 3MF at the size you set, with `printCheck()` reporting whether the surface is a solid | [Something you can hold: a 3D print](42-makingitphysical.md#something-you-can-hold-a-3d-print) | [Fabrication](../docs/output/fabrication.md) |
| Embroidery for a machine | `--export-embroidery` writes the frame as the stitches an embroidery machine sews: strokes as running stitch, fills as rows, each color its own thread | [Thread instead of ink: embroidery](42-makingitphysical.md#thread-instead-of-ink-embroidery) | [Embroidery](../docs/output/embroidery.md) |
| A drawing for the shop | `--export-dxf` writes the frame as a DXF drawing a CAD program or a laser's software opens: lines, polylines, and circles in millimeters, each color on its own layer | [A drawing for the shop: DXF](42-makingitphysical.md#a-drawing-for-the-shop-dxf) | [DXF](../docs/output/dxf.md) |
| Print color | `SoftProof` and `Filter.softProof`: the canvas as a press profile will print it, the colors it cannot reach flagged, and `--export-plates` for the process plates | [Seeing the print before you print it: soft proofs](42-makingitphysical.md#seeing-the-print-before-you-print-it-soft-proofs) | [PrintColor](../docs/output/printcolor.md) |
| Spatial models | `--export-usdz` writes a 3D frame, and `write(to:)` any `Scene`, as USDZ that Quick Look and Messages open and that stands in a room in AR | [Something you can walk around: USDZ](42-makingitphysical.md#something-you-can-walk-around-usdz) | [Spatial](../docs/output/spatial.md) |
| Spatial video | `--export-spatial` writes the motion as a stereo pair per frame (MV-HEVC), with `stereoGeometry` naming how far apart the eyes stand and how far away they agree | [Something you can look into: spatial video](42-makingitphysical.md#something-you-can-look-into-spatial-video) | [Spatial](../docs/output/spatial.md#spatial-video) |

### Chapter 43: Performing

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Live coding | `swift run OllinLiveCoding`: the code shown over the visuals, evaluated while it moves, with names completed under the text cursor | [Performing the code itself: live coding](43-performing.md#performing-the-code-itself-live-coding), [Finishing a name as you type: completion](43-performing.md#finishing-a-name-as-you-type-completion) | [LiveCoding](../docs/tools/livecoding.md) |
| Live recording | `startRecording()` or ⌘⇧R keeps a run as it happens, sound included, through evaluations | [Keeping the take](43-performing.md#keeping-the-take) | [Recording](../docs/output/recording.md) |
| Cues | Each parameter's value saved under a name and called back at once or over a fade: `saveCue`, `cue(_:over:)`, `nextCue`, the inspector's Cues card, a `.cues.json` file named after the sketch, and `--cue` | [A look you come back to: cues](43-performing.md#a-look-you-come-back-to-cues) | [Cues](../docs/helpers/cues.md) |
| The host on a controller | The live-coding host's own actions, such as evaluate and record, answer to fixed OSC addresses and to MIDI you teach it | [The host on a controller: OSC and learned MIDI](43-performing.md#the-host-on-a-controller-osc-and-learned-midi) | [LiveCoding](../docs/tools/livecoding.md) |
| Record & replay | `--record-take` writes down a run's seed, clock, inputs, and parameters; `--replay` plays it back the same, steps through it frame by frame, and renders it through any export | [Playing the night again: replay](43-performing.md#playing-the-night-again-replay) | [Replay](../docs/core/replay.md) |
| Keyframed parameters | `automate($parameter) { }` writes a parameter's values down over time, with named or Bezier curves, looped or at any speed, and rendered the same by any export | [A value at each moment: keyframes](43-performing.md#a-value-at-each-moment-keyframes) | [Automation](../docs/core/automation.md) |
| Parameter timeline | OllinLive's panel: drag the playhead, set a parameter, and click its diamond to place a key; lanes, curves shaped by eye, a rule typed in the parameter's own row, and an automation file OllinLive reads and other exports take with `--automation` | [Directing by hand: the timeline panel](43-performing.md#directing-by-hand-the-timeline-panel) | [Timeline](../docs/tools/timeline.md) |
| Timecode | `TimecodeClock` follows the MIDI Time Code a deck or an editing system sends, so a sketch keeps to the show's position rather than its own clock | [Following another timeline: timecode](43-performing.md#following-another-timeline-timecode) | [MIDI](../docs/integration/midi.md#timecode-timecodeclock) |
| Parameters driven by a formula | `drive($parameter, "190 + sin(time) * 80")` reads a parameter's rule from text rather than from Swift source, so it can arrive from a file or a typed field, and one parameter can be worked out from another | [A rule instead of keys: formulas](43-performing.md#a-rule-instead-of-keys-formulas), [A rule for each part: parameters that hold several numbers](43-performing.md#a-rule-for-each-part-parameters-that-hold-several-numbers) | [Formula](../docs/helpers/formula.md) |
| Syphon | Publish frames to (and read frames from) other Mac apps, GPU to GPU | [Into another app: Syphon](43-performing.md#into-another-app-syphon) | [Syphon](../docs/integration/syphon.md) |
| Virtual camera | `publishVirtualCamera()` makes the sketch a camera any app can pick, a video call or a web page included, once the Ollin Camera extension is installed | [The sketch as a webcam: the virtual camera](43-performing.md#the-sketch-as-a-webcam-the-virtual-camera) | [VirtualCamera](../docs/integration/virtualcamera.md) |

### Chapter 44: Handing it over

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| A sketch as the screen saver | `ollin new --kind screen-saver` wraps a sketch as a `.saver` the system loads when the machine goes idle, with one script to build, sign, and install it | [Living in the system: a screen saver](44-handingitover.md#living-in-the-system-a-screen-saver) | [Screen saver](../docs/output/screensaver.md) |
| A sketch as the wallpaper | `ollin new --kind wallpaper` runs a sketch as the desktop: one window per display at desktop level, behind the icons, quit from its menu-bar mark | [Wallpaper and a menu-bar strip](44-handingitover.md#wallpaper-and-a-menu-bar-strip) | [Wallpaper](../docs/output/wallpaper.md) |
| A sketch in the menu bar | `ollin new --kind menu-bar` runs a sketch as a small live strip among the status items, at 30 frames a second, since it stays on screen all day | [Wallpaper and a menu-bar strip](44-handingitover.md#wallpaper-and-a-menu-bar-strip) | [Menu bar](../docs/output/menubar.md) |
| A sketch as a widget | `ollin new --kind widget` shows a sketch on the desktop as a widget: `widgetTimeline` says how far apart the pictures sit, one is drawn for each moment on the day's own clock, and `--export-widget` shows the run without waiting for it | [A widget, and what it does to a sketch](44-handingitover.md#a-widget-and-what-it-does-to-a-sketch), [A widget's clock: the time of day](44-handingitover.md#a-widgets-clock-the-time-of-day), [How far apart the pictures sit: `widgetTimeline`](44-handingitover.md#how-far-apart-the-pictures-sit-widgettimeline), [Seeing the run without waiting: `--export-widget`](44-handingitover.md#seeing-the-run-without-waiting-export-widget) | [Widget](../docs/output/widget.md) |
| A sketch as an app | `ollin new --kind mac-app` wraps a finished sketch as a `.app`, signed for this Mac, or with `--sign` and `--notarize` for any Mac without the toolchain, with a frame of itself as its icon | [An app to hand somebody: signing and notarizing](44-handingitover.md#an-app-to-hand-somebody-signing-and-notarizing) | [A sketch as an app](../docs/output/app.md) |
| The sketch on the phone | `ollin phone` puts a sketch on a paired iPhone or iPad and installs it again on each save, its clock and parameters carried across, with the parameters live on the Mac | [In your pocket: the sketch on the phone](44-handingitover.md#in-your-pocket-the-sketch-on-the-phone) | [OnThePhone](../docs/tools/onthephone.md) |
| The phone as the sketch's screen | `device.show(self)` keeps the sketch running on the Mac and shows its frames full screen on the capture app, sent down the cable as video, with the first finger on the glass as the sketch's pointer and nothing built for the phone | [Leaving it on the Mac: the phone as the sketch's screen](44-handingitover.md#leaving-it-on-the-mac-the-phone-as-the-sketchs-screen) | [Phone](../docs/3d/phone.md#the-sketch-on-the-phones-screen) |
| Extensions | `extend(_:)` registers a `SketchExtension` that hears about setup and each frame before and after `draw()`, and can ask for the rendered image, for recorders, overlays, and guides | [Adding behavior from outside `draw()`: `SketchExtension`](44-handingitover.md#adding-behavior-from-outside-draw-sketchextension) | [Sketch](../docs/core/sketch.md#extensions) |
| Writing an extension | `ollin new --kind extension`: a library other sketches import, the `ollinx-` naming convention, and the four seams to build on | [Giving it to somebody else: an extension package](44-handingitover.md#giving-it-to-somebody-else-an-extension-package) | [Extensions](../docs/tools/extensions.md) |

### Chapter 45: Installations

| Capability | What it is | Taught in | Reference |
|---|---|---|---|
| Running unattended | `Installation` puts a sketch on a wall: full screen, no pointer, the display kept awake, and, with a loop declared, a shader clock that starts over at the end of a lap so it stays exact for weeks (every sketch already treats a gap in the frames as a pause) | [Leaving it running: `Installation`](45-installations.md#leaving-it-running-installation), [The clock over a long run: gaps and precision](45-installations.md#the-clock-over-a-long-run-gaps-and-precision) | [Installation](../docs/output/installation.md) |
| Resuming after a stop | `Installation(checkpoint:)` writes the `@Saved` properties, the seed, the clock, and every `@Param` value to a file on a cadence you set, so a relaunch carries on near where the sketch was | [Picking up where it left off: checkpoints and `@Saved`](45-installations.md#picking-up-where-it-left-off-checkpoints-and-saved) | [Installation](../docs/output/installation.md) |
| Restarting | `Installation(restarts: .onFailure)` starts the sketch again after a crash or a stall | [When it falls over: restarting](45-installations.md#when-it-falls-over-restarting) | [Installation](../docs/output/installation.md#getting-back-up-on-its-own) |
| Opening hours | `Installation(schedule:)` with `.open(from:to:)`, or parts of the day named with `.from(_:_:)` and read back as `scheduledPeriod`, with `.dark(from:)` for the hours with nothing on screen | [Gallery hours: the schedule](45-installations.md#gallery-hours-the-schedule) | [Installation](../docs/output/installation.md#keeping-hours) |
| DMX lighting | Lights driven from `draw()` over Art-Net or sACN: a 512-channel universe filled through the fixtures you patch with `DMXFixture` and sent each frame, and a lighting console driving the sketch back | [Light instead of pixels: DMX and LED maps](45-installations.md#light-instead-of-pixels-dmx-and-led-maps), [A console that drives the sketch: `DMXReceiver`](45-installations.md#a-console-that-drives-the-sketch-dmxreceiver) | [DMX](../docs/integration/dmx.md) |
| LED maps | `LEDMap` lays strips and matrices of LEDs over the canvas and sends each frame's pixels under them out as DMX | [Light instead of pixels: DMX and LED maps](45-installations.md#light-instead-of-pixels-dmx-and-led-maps) | [DMX](../docs/integration/dmx.md#ledmap) |
| Show lasers | `LaserProjector` sends line work to a show laser through an Ether Dream: points spaced evenly, held at corners, the beam dark between shapes, and no light until `arm()` | [Drawing with light: a show laser](45-installations.md#drawing-with-light-a-show-laser) | [Laser](../docs/integration/laser.md) |
| Fitting a projector | Corner pinning with Command-K fits the picture to a wall, and `Installation.Projection` blends the edges where two projectors overlap | [Fitting a projector: corner pinning](45-installations.md#fitting-a-projector-corner-pinning), [Two projectors, one picture: edge blending](45-installations.md#two-projectors-one-picture-edge-blending) | [Installation](../docs/output/installation.md#fitting-the-wall) |
| Several displays | `Installation(displays: .spanning)` spreads one canvas over several displays | [Several displays, one machine: `.spanning`](45-installations.md#several-displays-one-machine-spanning) | [Installation](../docs/output/installation.md#several-displays-one-machine) |
| Several windows, one world | `canvasOnScreen` tells each window where its canvas sits in the space all the screens share, so several windows show one world | [Several windows, one world: `canvasOnScreen`](45-installations.md#several-windows-one-world-canvasonscreen) | [Installation](../docs/output/installation.md#several-windows-one-world) |
| Room | Several machines drawing one sketch: they find each other by a name with no server, share values and `@Param` parameters, agree on one clock so motion stays in step, and take a seat each across a wall | [Several machines, one sketch: `Room`](45-installations.md#several-machines-one-sketch-room) | [Room](../docs/integration/room.md) |
| Remote surface | `RemoteInspector` serves the sketch's `@Param` parameters to a phone on the same Wi-Fi as touch controls, live both ways, for tuning an installation from in front of it | [Tuning it from the floor: `RemoteInspector`](45-installations.md#tuning-it-from-the-floor-remoteinspector) | [Remote](../docs/integration/remote.md) |
| MQTT | The message bus a building speaks: a house's sensors subscribed to and read in `draw()` or bound to a parameter, lamps and machines published back to, retained values, a last will for when the sketch is cut off, and a connection that resubscribes and resends on its own | [What the building already says: MQTT](45-installations.md#what-the-building-already-says-mqtt) | [MQTT](../docs/integration/mqtt.md) |

---

[Contents](index.md#contents) · Previous: [Appendix C, Coming from p5.js and Processing](c-comingfromp5.md) · Next: [Appendix E, Coming from openFrameworks and OPENRNDR](e-comingfromopenframeworksandopenrndr.md)
