Glossary

Words in the shaders

The words the shaders use, in plain language, each with the shaders that use it and the functions that do it.

Absorption also transmittance, Beer-Lambert law

How a fog, smoke or flame hides what lies behind it. Each stretch a ray passes through lets only a share of the light through, exp(-density × length), so the share left, the transmittance, falls off smoothly the deeper the ray goes.

Shaders Smoke Stack

Accretion disk also accretion disc

The flat ring of gas spiraling into a black hole or a star, heated white-hot by friction and orbiting faster the nearer it is, as the planets do. Seen from near a black hole, the far side of the disk appears above and below the hole, because the hole's gravity bends its light over and under.

Shaders Black Hole

Ambient occlusion

Darkening the places that light has trouble reaching, such as creases, corners and the ground under an object. A raymarcher estimates it by taking a few short steps out from the surface and seeing how close the rest of the scene is.

Shaders Molten MetaballsMandelbulbMenger Sponge

Functions ambientOcclusion

Anisotropic reflection also anisotropy, anisotropic, brushed metal

A highlight with two roughnesses, one along a direction on the surface and one across it, as on brushed or spun metal whose scratches all run one way. The surface is rough across the scratches and smooth along them, so the highlight stretches into a streak across the brushing.

Shaders Copper Kettle

Aperiodic tiling also aperiodic, non-periodic tiling

A tiling with no shift that lays it exactly over itself: slide a copy any distance in any direction and somewhere the tiles disagree. A wallpaper pattern is periodic, since one patch repeats along two directions; an aperiodic one has order without that repeat.

Shaders Penrose Tiles

Atmosphere also air, atmospheric rim, limb glow

The thin shell of air around a planet. Looking straight down we see through little of it, but along the edge we look through a long slant of it, so it glows there: a shader adds light that grows steeply toward the rim, and a halo just outside it from how close each ray passes the planet. It is blue-white where the sun is up and red where the sun is setting, since the long path at dusk scatters the blue away.

Shaders Spinning Planet

Atmospheric scattering also single scattering, sky scattering

Working out a sky from the air instead of painting it. A ray is stepped through the atmosphere, and each step adds the sunlight its air sends towards the eye, less what is lost on the way from the sun to the step and from the step to the eye. Blue sky, red sunsets and the pale horizon all come out of that sum.

Shaders Sunset

Aurora also northern lights, aurora borealis

Light given off high in the air, in tall thin curtains with a sharp lower edge. In a shader each curtain can be a line on a layer of sky, the same line on every layer above it, so a ray marched up through the layers gathers light wherever it passes along a curtain: a wall of light, brightest where you look along it.

Shaders Aurora

Bessel functions also Bessel function, J_n

A family of wavy curves, J_0, J_1, J_2 and so on, that start near zero and swing with a slowly shrinking swing. In FM synthesis they give the size of each sideband: the one k steps of the modulator away from the note is as loud as J_k of the index, so as the index grows the energy spreads outwards from the note.

Shaders Pulse Synth

Black holes also black hole, Schwarzschild radius, event horizon, photon sphere

A mass so dense that inside a certain distance, the Schwarzschild radius, nothing gets out, not even light: that boundary is the event horizon, and it is why a black hole is black. Just outside it, at one and a half times that radius, light can circle the hole; a shader draws the hole by walking rays and letting those that come too close fall in.

Shaders Black Hole

Blur also disc blur, blurring

Each point shown as the average of what is around it, so fine detail is smoothed away. The wider the area averaged, the deeper the blur; with only a few samples, sharp edges turn into faint copies of themselves unless the samples are placed differently from point to point.

Shaders Frosted Glass

Boids also boid, flocking, flock

Craig Reynolds' model of a flock, from 1987: each bird looks only at the birds near it and follows three rules, keep a little apart from them (separation), fly the way they fly (alignment) and steer toward their middle (cohesion). No bird knows the flock's shape; it comes out of the rules.

Shaders Murmuration

Bokeh also out of focus, defocus

How a lens draws a point of light it isn't focused on: a soft disc, bigger the further out of focus, often a little brighter at its edge. In a shader each light can simply be a disc whose radius grows with the blur and whose brightness falls as its area grows, so a big blurred light is dimmer than a sharp one.

Shaders Rain on Glass

Bump mapping also bump lighting

Lighting a surface as if it had a height to it, without changing its shape. The slope of the height gives a normal for each point, and the light is worked out from that normal, so a flat picture looks raised and carved.

Shaders Cracked Clay

Cellular noise also Worley noise

Noise made from the distances to scattered points, rather than from values blended on a grid. It looks like cells, scales, stones or cracked earth.

Shaders Cracked Clay

Functions voronoi

Chaos also butterfly effect, sensitive dependence, chaotic system

Rules with no chance in them whose outcome still can't be told far ahead, because any two starts, however close, move apart faster and faster: the gap doubles again and again until it is as large as the system itself. To know twice as far ahead you need the start many times more exactly.

Shaders Lorenz Attractor

Cloth also fabric

A thin sheet that bends freely but hardly stretches. A shader can fake it without simulating anything: a flat grid pinned along one edge and moved by waves that grow away from it reads as cloth in the wind, once it is lit from both sides.

Shaders Flag in the Wind

Color matching functions also CIE color matching functions, CIE 1931

Three curves over the wavelengths of visible light, measured from how people match colors in 1931, that say how much of each of three standard amounts, X, Y and Z, one wavelength gives. Add any light's spectrum up through them and you get its color as the eye sees it; a fixed matrix then turns X, Y and Z into the red, green and blue of a screen.

Shaders Soap Bubble

Complex numbers also complex number

Numbers with two parts, written x + iy, where i times i is -1. Each is a point on a plane, so a shader can treat every pixel as one. Adding two of them adds their parts; multiplying adds their angles and multiplies their distances from zero.

Shaders Fractal Glow

Compute shaders also compute shader, compute kernel

Programs on the graphics chip that don't draw anything: they read and write numbers in buffers. Run once for each item of a large job, all at the same time, they move particles, run simulations and do anything else that isn't a picture yet.

Shaders Particle SwarmCurl-Noise FlowMurmurationSpiral GalaxyFirefliesCrawling GlazeLorenz AttractorFireworks

Contour lines also contour line, contours, isolines, index contour

Lines that join the points of one height, drawn at even steps, as on a walker's map: far apart on gentle ground, crowded on steep ground. A shader draws one where a pixel's height is near a whole step, and divides that distance in height by how fast the height changes from one pixel to the next, so it becomes a distance in pixels and every line is the same width. Every fifth, an index contour, is drawn heavier.

Shaders Topographic Map

Cosine palette also cosine gradient, procedural palette

A smooth color ramp from one formula, a + b · cos(2π(c · t + d)), with a, b, c and d each a color's worth of three numbers: a is the middle, b how far each channel swings, c how many times it swings as t goes from 0 to 1, and d where it starts. Twelve numbers give a whole palette, cheap to work out in a shader.

Shaders Lava Flow

Coupled oscillators also Kuramoto model, Kuramoto

Many things that each repeat at their own rhythm, a phase going round and round, and that each nudge their phase towards the phases of the others: forward when another is a little ahead, back when it is a little behind, by the sine of the gap. That is Kuramoto's model, from 1975. With enough pull for how different their rhythms are, they fall into step.

Shaders Fireflies

Crystals also crystal, quartz

Solids whose atoms sit in a repeating pattern, so they grow with flat faces at fixed angles. Quartz grows as a six-sided prism with a point on top, longer at the tip as more matter settles there. A shader can build one as rings of corners up a prism and a fan of triangles to the point, and light each face flat.

Shaders Crystal Bloom

Curl noise also curl, divergence-free flow

A flow made from noise by following its contour lines instead of its slope: the slope at each point, turned a quarter. A flow made this way never gathers anywhere or runs dry, so particles carried on it stay evenly spread while they swirl, part and join.

Shaders Curl-Noise Flow

Functions curl

Density wave also density waves, spiral density wave

A place where things crowd for a while and then move on, like a traffic jam that cars drive into and out of while the jam itself stays put or drifts slowly. A spiral galaxy's arms are density waves: no star stays in an arm, so the arms don't wind up as the inner stars outrun the outer ones. One way to draw one is to put each star on an oval and turn each oval a little further than the one inside it: the ovals crowd along spiral lines.

Shaders Spiral Galaxy

Diffusion also spreading

Something spreading from where there is more of it to where there is less, as ink spreads in water, until it is even. In a step-by-step simulation each cell moves a little toward the average of its neighbors every step (the Laplacian times a rate); a faster rate spreads further in the same time.

Shaders Crawling Glaze

Discard also discard_fragment, alpha test, cutout

Throwing a pixel of a triangle away instead of drawing it. A pixel shader that calls discard_fragment() writes no color and no depth for that pixel, so whatever is behind shows, and a shape can be cut out of geometry that has no hole in it.

Shaders Jellyfish

Displacement also displacement mapping

Moving the corners of a surface to give it shape, instead of only shading it as if it had one: a flat grid lifted by a height at every corner into waves or hills. Unlike bump mapping, the outline changes too, and so does what hides what.

Shaders Rippling WaterFlag in the WindSpinning PlanetOcean WavesJellyfish

Distance estimation also distance estimate, distance estimators, distance estimator

Working out roughly how far a point is from a fractal's edge, from how far its orbit flew and how fast it grew. It lets a shader draw the edge as a thin line of even width, however fine the detail, and in 3D it gives a raymarcher a step it can always take without passing through the fractal's surface.

Shaders Mandelbulb

Distortion also distortion effect, distortionEffect

Showing each point of a picture with the color of another point a little way off. Ripples, lenses, heat haze and water all come down to choosing, for every point, where to look instead.

Shaders Heat Haze

Domain repetition also repetition, infinite repetition

Drawing endless copies of a shape while describing only one. Space is cut into equal cells, and each point is moved into the first cell before its distance is measured, so every cell measures the same shape. The cell's number, from floor(), is still known, so each copy can be given its own color, size or state.

Shaders Ember Tunnel

Domain warping

Shifting each point's coordinates by an amount read from noise, then reading noise (or anything else) at the shifted spot. The picture becomes noise of noise, and it swirls and flows like liquid or smoke.

Shaders Flowing Color FieldLava Flow

Doppler also Doppler effect, Doppler shift, relativistic beaming

Light or sound from something coming towards you arrives at a higher pitch, and from something going away at a lower one. Near the speed of light the effect also beams the light: the approaching side looks far brighter and the receding side dimmer, which is why one side of a black hole's disk burns white while the other glows dark.

Shaders Black Hole

Drag also air resistance

The air slowing anything that moves through it. Multiplying a velocity by exp(-drag × dt) each step takes the same fraction of the speed every second, and under gravity a thing ends up falling at a steady speed, gravity over drag: its terminal velocity.

Shaders Fireworks

Dust also dust lanes, dust lane

Fine grains in the gas between the stars that dim the light behind them. In a spiral galaxy it gathers in dark lanes along the inner edge of each arm, where the gas is squeezed first; a shader dims the starlight there by exp(-amount), so it fades towards black without going past it, and breaks the lanes into wisps with noise.

Shaders Spiral Galaxy

Emission also emissive

Light a thing gives off itself, rather than light falling on it and bouncing back. A flame or hot metal is emissive: in a volume, every step along a ray adds the light the material gives off there.

Shaders Kiln FireCrystal BloomPine Cone

Envelope also amplitude envelope, ADSR

How loud a sound is over its life: how fast it rises when it starts and how it dies away. Multiplying a voice by its envelope turns a steady tone into a pluck, a drum or a bell, and the same curve can drive brightness in the picture.

Shaders A Shader That Keeps the BeatPulse Synth

Equi-angular sampling also equiangular sampling

A way to place the steps along a ray through fog lit by a point of light: evenly in the angle the light sees them at, instead of evenly in distance. Most steps then fall where the ray passes nearest the light, where nearly all of the light is, and since light falls off as one over the distance squared, every step ends up standing for the same share of it.

Shaders Lighthouse

Exponential decay also time constant

Falling by the same fraction in each equal step of time: exp(-t / τ), which drops to about a third (1/e) after one time constant τ. A struck object rings down this way, each mode with its own τ, the higher ones usually sooner.

Shaders Wind ChimesHall of Mirrors

Finite differences also finite difference, central differences

Finding how fast something changes by trying it a small step either side and dividing the difference by the step. A shader uses it for a slope or a normal when the formula is too tangled to work out by hand: ask the surface where two neighbors are, and the directions to them say which way it runs.

Shaders Flag in the WindJellyfishTopographic Map

Fireflies also firefly, lightning bugs

Beetles that make light, flashing to find each other at night. In a few places, among them the Great Smoky Mountains and the rivers of Southeast Asia, thousands of them flash together, each shifting its next flash towards those it sees: the best-known case of coupled oscillators in nature.

Shaders Fireflies

Fireworks also firework

A shell that rises and bursts into stars that fly out, slow in the air, fall under gravity and cool as they burn out. As particles, each star and each of its sparks is stepped many times a second, and each shell's time, place and color can come from a hash of its number, so the picture and the sound agree on them.

Shaders Fireworks

Flat shading also faceted shading, face normals

Lighting each triangle with one normal, so a shape shows its facets instead of looking smooth. When corners are shared between faces they can't carry a normal for each one, so the fragment shader works it out per pixel: the cross product of dfdx and dfdy of the world position, how it changes from one pixel to the next across the screen, is the normal of the flat triangle under the pixel.

Shaders Crystal BloomPine Cone

Flicker also flickering

A light switching or wavering on its own. A shader makes it from the clock: time is cut into steps, and a hash of each step's number says whether the light is on, so it is random-looking but the same at the same moment every time, for the picture and the sound alike.

Shaders Neon Sign

Flow fields also flow field, vector field

A direction and a speed at every point, like a map of a current. Particles dropped into one are carried along it, each step moving them by the flow where they are.

Shaders Curl-Noise Flow

Flow noise also flow map, flow mapping, advected noise

Noise that moves along a flow instead of sliding across the screen. Each point looks back along the flow for where its noise came from. Carried too far, the noise would stretch and tear, so two copies are carried half a cycle apart, and each fades out before it jumps back to the start. Lava, rivers and clouds move this way.

Shaders Lava Flow

FM synthesis also frequency modulation, FM

Making a rich tone from two sine waves: the phase of one, the carrier, is pushed back and forth by the other, the modulator. How hard it is pushed, the index, decides how bright the tone is; the ratio of the two frequencies decides whether the partials fall on harmonics (a whole-number ratio) or between them, as a bell's do.

Shaders Pulse Synth

Foam also whitecaps, sea foam

The white froth on breaking waves. A shader puts it where the surface is pinched hardest, often found from the Jacobian of the waves, and tears it into lace with noise so it shows as threads and patches rather than a smooth band.

Shaders Ocean Waves

Fog also distance fog, haze

Fading things out with distance. The share of a surface's light that reaches the camera is exp(-distance × density), and the rest is replaced by the fog's own color, so far-off things sink into the haze. It gives a scene depth and hides detail too small or too far to draw well.

Shaders Ember TunnelEndless TerrainLighthouse

Folding space also space folding, fold, folding

Moving every point into one small region before measuring anything, with abs(), a mirror, or a cell found with floor(). Whatever is drawn in that region then appears wherever points were folded from, so one shape is written and many are seen. Folding again at a smaller size, in a loop, makes a fractal.

Shaders Menger Sponge

Fractal noise also fBm, fractal Brownian motion

Several layers, or octaves, of noise added together, each finer and fainter than the one before. The big layers give the overall shape and the small ones the detail, like clouds or a coastline.

Shaders Wood & Marble

Functions fbm

Fractals also fractal

Shapes that show more detail however far you zoom in, often repeating small copies of themselves. Many come from repeating one simple rule many times, as a Julia set does.

Shaders Fractal GlowMandelbulbLightningMenger Sponge

Fragment shader also pixel shader

A small program that the graphics chip runs once for every pixel, millions of times a frame, to work out that pixel's color. In Ray Kiln it is the function called shade.

Free-free beam also free beam

A bar or tube held at neither end, as a hanging chime or a xylophone bar nearly is. Its modes have wavenumbers that solve cos(β) cosh(β) = 1 (4.730, 7.853, 10.996, 14.137 and on) and frequencies that go as β², so its partials sit at 1, 2.756, 5.404 and 8.933 times the lowest.

Shaders Wind Chimes

Fresnel also Fresnel effect, Schlick's approximation

How the share of light a surface reflects grows with the angle. Looking straight at glass or water, little is reflected and you see through it; looking across it at a low angle, nearly all of it is reflected. Schlick's approximation is the usual shortcut: f0 + (1 − f0)(1 − cos θ)⁵, where f0 is the share reflected head on.

Shaders Glass OrbRippling WaterPottery WheelCrystal BloomOcean WavesSoap BubbleCopper Kettle

Frosted glass also ground glass, etched glass

Glass with a rough surface, etched or sandblasted, whose tiny facets send the light from behind in many directions. Each point of it shows light from a whole patch of what is behind, mixed together, with a grain from the facets.

Shaders Frosted Glass

Gear ratios also gear ratio

How much faster or slower a gear turns than the gear that drives it: the driver's teeth over its own. Teeth pass the meeting point one for one, so a 24-tooth gear turning a 36-tooth one turns it 24/36 as fast, the other way round.

Shaders Clockwork

Gears also gear, cog, gear train

Wheels with teeth round their edges that push one another by their teeth. As a distance field a gear is a circle whose radius rises into a tooth and falls into a gap as the angle goes round: a clamped cos(n × angle) added to the radius gives n teeth with flat tips and roots.

Shaders Clockwork

Gerstner waves also gerstner wave, trochoidal waves

A model of water waves in which each bit of the surface moves in a circle as a wave passes, up and forward on the crest, down and back in the trough, instead of only bobbing up and down. The crests come out sharp and the troughs wide, as real swell does; pushed too far, a crest folds through itself.

Shaders Ocean Waves

Glaze also glazed, glossy

A glassy coat on fired clay, and the material that shows it: a surface lit like clay underneath, the room mirrored on top of it by Fresnel's share, a highlight where the light itself is mirrored, and the color deeper where the coat pools in grooves and thinner over ridges.

Shaders Pottery Wheel

Glow also halo, bloom

Light that spreads from a bright thing into the air around it. A shader adds it as a function of the distance to the light that falls away without quite reaching zero, such as an inverse square, radius² / (d² + radius²), so every pixel gets a little and glows near each other add up.

Shaders Neon SignLightning

Golden angle also phyllotaxis, fibonacci sphere

About 137.5°, the full turn divided in the golden ratio. Stepping round by it each time, while moving steadily from one pole of a sphere to the other, spreads points evenly with no rows or gaps, as seeds are spread in a sunflower head.

Shaders Pine Cone

GPU buffers also GPU buffer, storage buffer

A block of memory on the graphics chip that shaders read and write, such as one record for every particle. Unlike the picture, it is kept from one frame to the next, so a simulation can carry on where it left off.

Shaders Particle Swarm

Gradient noise also Perlin noise

Noise that gives each corner of a grid a random slope instead of a random height, and blends between them. It is zero at every corner and hides its grid far better than value noise, which is flat at every corner.

Shaders Curl-Noise Flow

Functions gnoise

Gravitational lensing also lensing, Einstein ring, light bending

Gravity bends light, so a heavy mass works as a lens: what lies behind it is stretched, doubled, or drawn into a ring around it, an Einstein ring. In a shader each ray is walked in steps and, at every step, its direction is pulled a little towards the mass, more the closer it passes.

Shaders Black Hole

Gravity

A pull toward the ground that changes a falling thing's speed, not its position, by the same amount every second: 9.8 meters a second each second near the Earth. In a simulation each step takes gravity times the step's length off the upward speed.

Shaders Fireworks

Gray-Scott model also gray-scott, Gray Scott

A reaction-diffusion system with two chemicals, A and B. A is fed in everywhere at a rate called feed; where B meets A, B uses up A to make more of itself (A times B squared); B dies away at a rate called kill. A spreads faster than B. Small changes to feed and kill give spots that split, worms, mazes, holes or a flood of B.

Shaders Crawling Glaze

Grid also grids

A flat sheet of squares, each cut corner to corner into two triangles, that a vertex shader bends into a shape. A Ray Kiln vertex episode asks for one with a // @grid N line: N by N squares, with each corner's place on it from 0 to 1.

Shaders Rippling WaterFlag in the WindSpinning PlanetOcean WavesJellyfish

Hash

A function that turns a number or a point into a value that looks random but is always the same for the same input. Shaders have no random number generator, so noise of every kind starts from a hash.

Shaders Ember TunnelParticle Swarm

Functions hash21hash22hashU

Heat haze also heat shimmer, mirage

The wavering of things seen through hot air. Warm air is thinner than cool air and bends light where the two meet, so as pockets of warm air rise and mix, what lies behind them seems to swim.

Shaders Heat Haze

Heightfield also height field, height map, terrain

A surface described by one height for every point on the ground: give it (x, z) and it returns y. Fractal noise makes a good one, and it is never stored, only worked out where a ray looks, so the land can go on forever. A ray is marched over it by stepping a share of its height above the ground until it drops below.

Shaders Topographic Map

Hex grid also hexagonal grid, hexagonal tiling

Cutting the plane into hexagons, found as two grids of rectangles, the second shifted by half a rectangle each way: each point belongs to whichever of its two nearest centers is closer. A point's offset from its center and the center itself are all a shader needs to draw on each tile.

Shaders Kiln Floor Tiles

High dynamic range also HDR, brighter than white

Light values with no ceiling at 1. A shader can return a highlight several times brighter than white; a screen shows everything above 1 as the same white, so what is inside it, its shape and bands, is only seen when the picture is darkened or tone mapped.

Shaders Copper Kettle

Hill shading also hillshade, shaded relief

Lighting a map seen from above as if it were the land itself: the slope at each point tilts a surface, and a lamp, by custom at the upper left, brightens the faces turned toward it and darkens those turned away. The flat map seems to stand up in relief.

Shaders Topographic Map

Jacobian also jacobian determinant

How a mapping stretches or squeezes space around a point: the matrix of how each output changes with each input, whose determinant says how much an area grows or shrinks. On a sea of Gerstner waves it is 1 on still water and falls toward 0 where a crest pinches the surface together, which is where foam gathers.

Shaders Ocean Waves

Julia sets also Julia set

The points z that never fly off to infinity when z is squared and a fixed number c is added, over and over. Each c gives a different set: whole shapes for c inside the Mandelbrot set, scattered dust for c outside it.

Shaders Fractal Glow

Kaleidoscope

A picture drawn in one thin wedge and repeated and mirrored around a center. A shader gets it by moving every pixel into the first wedge before drawing anything there.

Shaders Kaleidoscope

Functions kaleido

Laplacian also discrete Laplacian, Laplace operator

How much a value differs from the average around it: positive in a dip, negative on a bump. On a grid it is a weighted sum of a cell's neighbors less the cell itself, here 0.2 for each of the four beside it and 0.05 for each corner. Adding a little of it each step moves every cell toward its neighbors, which is diffusion.

Shaders Crawling Glaze

Layer effect also layerEffect

A SwiftUI effect that is given the whole view as a layer it can sample anywhere, within maxSampleOffset of the point it is drawing, and returns that point's color. It can move, blend and recolor, where a color effect only recolors and a distortion only moves.

Shaders Heat HazeFrosted Glass

Level of detail also LOD

Drawing only as much detail as the picture can show. Something smaller than a pixel can't be drawn properly and shimmers as it moves, so a shader compares the size of a detail with the width of a pixel at that distance and leaves it out, or fades it out, when it is too small.

Shaders Menger Sponge

Light shafts also god rays, crepuscular rays, volumetric light, beams

Beams of light seen in the air because dust or haze scatters a little of it towards the eye. A shader walks along each view ray in steps and adds light wherever the sun can reach that point, and nothing where something blocks it.

Shaders Stained GlassLighthouse

Lighting

Working out how bright a surface is from where the light is. The simplest kind, diffuse light, is how squarely the surface faces the light: the dot product of its normal and the direction to the light.

Shaders Floating 3D SceneCracked ClayHall of Mirrors

Lightning also thunder

A flash that lights the sky for a moment, often twice in quick succession, with thunder arriving later because sound is slower than light. Made from the clock alone, the strikes can come from a hash of each window of time, so the picture and the sound follow the same strikes without sharing any state.

Shaders Rain on GlassLightning

Lorenz attractor also Lorenz system, Lorenz butterfly

The two-winged shape that Edward Lorenz's three equations of 1963 draw: three numbers, x, y and z, each changing at a rate set by the others (10 (y - x), x (28 - z) - y and x y - 8/3 z). A point following them circles one wing, then the other, switching with no pattern, and never comes to rest or repeats.

Shaders Lorenz Attractor

Mandelbulb

A Mandelbrot set in three dimensions. Each point is written as a distance and two angles, the distance raised to a power (8 in the classic bulb) and the angles multiplied by it, and the starting point added back, over and over. The points that never run away make a bulb with buds on its buds, drawn by marching rays with a distance estimate.

Shaders Mandelbulb

Marble also marble veins

Stripes from a sine of the position, pushed sideways by turbulence, so they bend and crease; thin veins run where the sine crosses zero.

Shaders Wood & Marble

Menger sponge also Menger sponges, Sierpinski carpet, Cantor set

A fractal made from a box: cut it into 27 smaller boxes, take out the middle one and the middle of each face, and do the same to each of the 20 that are left, again and again. Every round leaves 20/27 of the volume, so in the end it weighs nothing and its surface has no end. Each face is a Sierpinski carpet, and a line through it is a Cantor set.

Shaders Menger Sponge

Mesh shaders also mesh shader, mesh

Shaders that make geometry on the GPU instead of reading it from a buffer. The work is split into pieces; for each, a group of threads decides how many corners and triangles it needs this frame, works out each corner and lists each triangle by its corners' numbers. A piece can change shape and size from frame to frame, or ask for nothing at all. In Ray Kiln a // @mesh N line makes N pieces of up to 64 corners and 64 triangles each.

Shaders Crystal BloomPine Cone

Metaballs

Blobs that melt into each other when they come close, like drops of mercury. With distance fields they are spheres joined by a smooth minimum instead of a plain one.

Shaders Molten Metaballs

Metals also conductor

Materials that send light back from their very surface and absorb whatever gets in within a few tens of nanometers, so they have no diffuse color: everything a metal shows is a reflection, tinted by the metal's own reflectance (copper's is about 95% of red head on, 64% of green, 54% of blue) and turning white at a glancing angle.

Shaders Copper Kettle

Microfacets also microfacet, GGX, microfacet highlight, Smith shadowing

A rough surface drawn as countless tiny mirrors, each facing a slightly different way. A distribution such as GGX gives the share of them facing halfway between the eye and a light, which is the highlight; Smith's term takes out those hidden by their neighbors, and Fresnel says how much each mirrors. Rougher spreads the facets, so the highlight grows wider and dimmer.

Shaders Copper Kettle

Midpoint displacement

A way to make a rough line or surface: push the middle of a straight line sideways by a random amount, then the middle of each half by less, and so on. Each level adds the same kind of detail at half the size, so the result is a fractal. A shader can find any point of it without building the line, as a sum of tents, one per level.

Shaders Lightning

Mie scattering also Mie, Henyey-Greenstein

How things about the size of the waves of light or bigger, such as dust and droplets, scatter it: every color about alike, and most of it nearly straight on. It makes haze white and puts the bright glow round the sun. Shaders usually use Henyey and Greenstein's formula for how much goes each way.

Shaders Sunset

Mode shape also mode shapes, node, nodes, vibration mode

How far each point of a vibrating object moves when it rings in one mode alone. Points that stay still are its nodes. A chime hung by a string through a node of its lowest mode, 22.4% of the way along, rings longest, because the string barely touches that motion.

Shaders Wind Chimes

Morphing

Turning one shape smoothly into another. With distance fields it can be as simple as mixing the two shapes' distances, since every in-between value is a shape too.

Shaders Morphing Shapes

Neon also neon sign

A glass tube of gas that glows when a current runs through it, bent into letters and shapes. In a shader each tube is a stroke, the distance to its line: white-hot near the middle, its color at the edge, and a glow around it.

Shaders Neon Sign

Noise also value noise

Randomness that changes smoothly from place to place, rather than jumping between pixels. It is the raw material for clouds, fire, wood, stone and anything else that should look natural rather than drawn.

Shaders Endless TerrainWood & MarbleSpinning PlanetSpiral GalaxyBlack HoleHeat Haze

Functions vnoisefbmsnoise

Normals also normal, surface normal

The direction a surface faces at a point, as a vector one unit long that points straight out of it. Lighting needs it. For a distance field it is how fast the distance grows in each direction.

Shaders Floating 3D SceneRippling WaterFlag in the WindOcean WavesJellyfish

Functions normalAt

Numerical integration also integration, Euler's method, time stepping

Following a rule for how fast something changes, a small step at a time: work out the rate where the point is, move that rate times the step, and do it again. That simplest way is Euler's method; its error shrinks only as fast as the step does, so better methods look at the rate at several points within each step.

Shaders Lorenz AttractorFireworks

Optical depth also optical thickness, air mass

How much of something a ray has passed through, added up along it: density times length. The share of light that gets through is exp(-optical depth × what a unit of it scatters or absorbs), so twice the depth leaves the square of the share.

Shaders Sunset

Orbit also orbits, rotation curve

The path a star or planet takes round what holds it. A shader that knows the orbit doesn't need to move a particle a step at a time: where it is at any moment is a function of the clock, an angle that grows at the orbit's rate. In a galaxy the rate comes from the rotation curve: a star's speed along its orbit rises through the core and then stays about the same, so the inner stars go round in far less time than the outer ones.

Shaders Spiral Galaxy

Orbit trap also orbit traps, orbit-trap color

Coloring a fractal by where each point's orbit went, not only whether it escaped: as the point is transformed again and again, the trap keeps how near its path ever came to a chosen point, line or plane. It varies smoothly over the surface, so it colors without the bands of a step count.

Shaders Mandelbulb

Oscilloscope also scope, waveform display

A picture of a signal over time: a line drawn across the screen at the height of each sample. A trigger starts each sweep at the same point of the wave, such as where it crosses zero going up, so a steady tone stands still on screen instead of rolling.

Shaders Pulse Synth

Partials also partial, overtones, overtone

The sine waves a sound is made of, the lowest of them the fundamental. When they sit at whole multiples of the fundamental they are harmonics and the sound has a clear pitch, as a string's does; a bar or a tube has partials between the harmonics, which is why it sounds like a bell.

Shaders Wind Chimes

Particles also particle, particle system

Many small things, each with its own position, speed and state, moved a step at a time by the same rule. On the graphics chip, each step runs the rule for every particle at once, and each one is drawn as a dot.

Shaders Particle SwarmCurl-Noise FlowMurmurationSpiral GalaxyFirefliesLorenz AttractorFireworks

Penrose tiling also Penrose tiles, rhomb tiling

A way to cover the plane with two tiles, here a thick rhomb with 72 degree corners and a thin one with 36, so that the pattern never repeats however far it goes. Every finite patch of it turns up again and again, and it can have five-fold symmetry about one point, which no repeating pattern can.

Shaders Penrose Tiles

Pentagrid also de Bruijn's method, multigrid

Five grids of parallel, evenly spaced lines, each a fifth of a turn from the last and each slid along its own direction by some amount. De Bruijn showed in 1981 that every crossing of two of its lines stands for one rhomb of a Penrose tiling, when the five amounts add up to a whole number, so the tiling can be worked out for any point without laying tiles one by one.

Shaders Penrose Tiles

Periodic noise also tileable noise, wrapping noise

Noise that repeats exactly after a whole number of lattice cells, made by wrapping each lattice point's number by the period before it is hashed. Each octave doubles the lattice and the period together, so a sum of octaves repeats too.

Shaders Kiln Floor TilesWood & Marble

Phase function also Henyey-Greenstein, scattering, silver lining

Of the light a bit of smoke or cloud scatters, the share sent off at each angle from the way it was going. Henyey and Greenstein's has one number, g: at 0 the light goes every way alike, toward 1 more and more of it straight on, so a cloud with the sun or moon behind it glows at its edges.

Shaders Smoke StackLighthouse

Polar coordinates

Describing a point by how far it is from the center and at what angle, instead of by x and y. Anything that goes round, such as rings, spirals, flowers and kaleidoscopes, is simpler in them.

Shaders KaleidoscopeA Shader That Keeps the BeatClockwork

Premultiplied alpha also premultiplied, premultiplied color

A color stored with its red, green and blue already multiplied by its alpha, so a half-transparent white is (0.5, 0.5, 0.5, 0.5). SwiftUI passes colors to its shader effects this way and expects them back the same; blending and averaging premultiplied colors gives the right answer at soft edges.

Shaders Frosted Glass

Quasicrystal also quasiperiodic

Order that never repeats: a pattern made from a few frequencies whose ratios are not fractions, as a Penrose tiling is from five grids. Some metal alloys arrange their atoms this way, and show the five-fold symmetry no ordinary crystal can have.

Shaders Penrose Tiles

Rain also raindrops, rain on glass

Drops on a window are small lenses: each bends the light from a wide patch of what is behind the glass into its own circle, upside down. In a shader, a pixel inside a drop reads the scene on the far side of the drop's middle, and drops that slide stick and slip, leaving trails behind them.

Shaders Rain on Glass

Ray tracing also ray tracer, ray-traced

Drawing a 3D scene by working out exactly where a ray from the camera first meets each surface, with no stepping: where a ray leaves a box is one division per axis, and where it meets a sphere is the root of a quadratic. At a mirror the ray is turned with reflect and traced again, so one pixel can follow its light through many bounces.

Shaders Hall of Mirrors

Rayleigh scattering also Rayleigh

How things much smaller than the waves of light, such as air molecules, scatter it: in every direction, and far more strongly the shorter the wave, with the fourth power of the frequency. Blue is scattered nearly six times as much as red, which makes the sky blue and takes the blue out of a low sun's light.

Shaders Sunset

Raymarching also sphere tracing

Drawing a 3D scene by sending a ray from the camera through each pixel and stepping along it. A distance field says how far the nearest surface is, so each step can be that long without passing through anything, until the ray is close enough to call it a hit.

Shaders Floating 3D SceneMolten MetaballsKiln FireEmber TunnelEndless TerrainGlass OrbPottery WheelMandelbulbBlack HoleSunsetMenger SpongeLighthouseCopper Kettle

Reaction-diffusion also reaction diffusion, Turing pattern, Turing patterns

Chemicals that react with each other where they meet and spread out to their neighbors at different speeds. From an almost even start, the two together make spots, stripes and mazes that nobody drew. Alan Turing proposed it in 1952 for how an animal's markings form. In a shader it is a grid of cells, each worked out again every step from itself and the cells around it.

Shaders Crawling Glaze

Reflection also mirror, reflect, reflections

Light bouncing off a surface as off a mirror. In a shader, reflect(d, n) turns a ray's direction about the surface's normal, flipping the part along the normal, and the new ray goes on to see what the mirror shows.

Shaders Rippling WaterOcean Waves

Refraction also refract, index of refraction, IOR

Light bending as it passes from one material into another, because it goes at a different speed in each. The index of refraction says how much slower: 1 for air, about 1.5 for glass, 2.4 for diamond. In a shader, refract(d, n, ratio) bends a ray by the ratio of the two indices, and gives nothing back when the ray meets the surface too slantwise to leave (total internal reflection).

Shaders Glass OrbRain on GlassHeat Haze

Ripples also ripple

Small waves spreading out in rings from where something touched the water. In a shader, a height made from a sine of the distance to that point, running outward with time and weakening as it spreads, so many of them can simply be added where they cross.

Shaders Rippling Water

Runge-Kutta also RK4, Runge-Kutta method

A way to take a step of numerical integration from four rates instead of one: the rate at the start, two at the middle of the step (each reached with the rate before it) and one at the end, averaged with the middle two counted twice. Halving the step makes the error sixteen times smaller, so far fewer steps are needed than with Euler's method.

Shaders Lorenz Attractor

Seamless loop also loop, looping

A moving picture whose last moment leads straight back into its first, so it can play round and round without a jump. A shader loops after L seconds when everything in it that moves has come back to where it began at L: whole turns, whole cycles, whole numbers of ticks.

Shaders Clockwork

Self-shadowing also light marching, self shadowing

A cloud or smoke darkening itself: the light reaching a point inside it has passed through the rest of it first. A shader finds out how much with a light march, a second, shorter march from the point toward the light, adding up the density on the way and letting through exp(-sum), as Beer and Lambert's law says.

Shaders Smoke Stack

Sequencer also step sequencer, drum machine

A clock that counts time in steps, usually sixteen to a bar, and a pattern that says which instruments play on which steps. In a shader it is a function of the time: from t, the step playing and how long ago each instrument hit, so the picture and the sound can both ask it and stay in time.

Shaders A Shader That Keeps the Beat

Signed distance fields also signed distance field, SDF, distance field

A shape described by a function that gives, for any point, the distance to its edge: negative inside, zero on the edge, positive outside. Shapes made this way are easy to blend, round off, repeat and outline.

Shaders Morphing ShapesFloating 3D SceneKaleidoscopeMolten MetaballsEmber TunnelGlass OrbPottery WheelNeon SignClockworkMenger SpongeFrosted GlassCopper Kettle

Functions sdCirclesdBoxsdTrianglesdSpheresdBoxsdTorussmin

Sky also sky gradient

The light a ray sees when it meets nothing. In a shader it is usually a gradient on the ray's direction: dim overhead, brighter toward the horizon and brightest around the sun, often with the sun's disc where the ray points almost straight at it. Fog that fades into the same color makes the land meet the sky.

Shaders Endless TerrainSunset

Smooth iteration count also smooth coloring

A way of coloring an escape-time fractal without bands. The plain count of steps before a point escapes is a whole number; how far past the limit the point landed says how close it came to one step more, and adding that in makes the count smooth.

Shaders Fractal Glow

Smooth minimum also smin

Like min, but where two values are close it pulls the result below both of them. Applied to two distance fields, the shapes melt into one another with a smooth neck instead of meeting at a crease.

Shaders Morphing ShapesMolten Metaballs

Functions smin

Soft shadows

Shadows whose edges fade instead of stopping at a sharp line, as they do under a light of some size. A raymarcher gets them by marching towards the light and noting how close the ray came to anything on the way.

Shaders Molten MetaballsEndless Terrain

Functions softShadow

Solid texture also solid textures, 3D texture, procedural solid texture

A texture that gives a color to every point in space rather than to points on a surface, worked out from the point itself. An object is carved out of it, so its faces agree at every edge and a cut through it shows the pattern carrying on inside.

Shaders Wood & Marble

Solids of revolution also solid of revolution, surface of revolution, revolve, lathe

A shape made by spinning one curve round an axis: a pot, a vase, a bowl. The curve is the radius at each height, so the distance to the shape is a point's distance from the axis less the radius there, which makes any profile easy to raymarch. Letting the radius depend on the angle round the axis too lets the surface be carved.

Shaders Pottery WheelCopper Kettle

Spectral rendering also wavelength sampling, spectral sampling

Working light out one wavelength at a time instead of as red, green and blue, then adding the wavelengths up into a color. It is needed when what happens depends on the wavelength, as in thin-film interference, dispersion in a prism or a rainbow, where three channels can't carry it.

Shaders Soap Bubble

Speed of sound

How fast sound travels through air, about 343 meters a second, so a bang a kilometer away is heard about three seconds after it is seen. A sound made late by its source's distance over that speed says how far away the source is.

Shaders Fireworks

Sphere also spheres, UV sphere, latitude and longitude

A ball made from a flat grid: one direction of the grid becomes longitude, once round, and the other latitude, from pole to pole. The grid's two side edges meet in a seam along one meridian, and its top and bottom rows each shrink to a single point, the poles. Anything read from the grid's place jumps at the seam, so a shader reads noise and color from the point on the ball instead.

Shaders Spinning Planet

Spiral galaxy also spiral galaxies, galaxy, galaxies

A flat disk of stars, gas and dust turning round a bulging core of old stars, with bright arms winding out from the middle. The arms are bright because the gas squeezed in them makes new stars, young and hot, which burn out before they drift far from the arm; most of the disk's stars are older and dimmer, and spread all round it.

Shaders Spiral Galaxy

Stained glass also leaded glass, came

A window made of pieces of colored glass held in strips of lead. Each pane lets through only its own color of the light, so the window glows in the wall and throws the same colors across whatever the sunlight lands on.

Shaders Stained Glass

Stars also star field, starfield

Points of light in the sky, made from directions rather than positions: the sky is cut into small cells by angle (azimuth and elevation), a hash of each cell decides whether it holds a star, and more hashes give it a place inside the cell, a brightness, a tint and a rate to twinkle. Kept inside its cell and about a pixel wide, a star stays sharp at any size of picture.

Shaders AuroraSpinning PlanetSpiral GalaxyBlack Hole

Steering also steering forces

Moving a particle by forces rather than by placing it: a pull toward where it wants to be, drag that takes away speed. The velocity changes by the forces at each step and the position by the velocity, so motion stays smooth, and things overshoot, swing and settle.

Shaders Particle SwarmMurmuration

Strange attractor also attractor

A shape that every path of a system is drawn onto and then never leaves, yet on which paths never settle or repeat. Nearby paths on it move apart, and since they can't leave it, the shape keeps stretching them and folding them back, which gives it layer on layer of fine sheets.

Shaders Lorenz Attractor

Stroke also strokes, outline

A line drawn by its distance: every pixel closer than half the line's width to it is on the line. The distance is to the line itself, not to a shape's inside, so it is never negative; abs() of a shape's signed distance is the distance to its outline, which turns any shape into a stroke.

Shaders Neon Sign

Swarm

In a Ray Kiln particle shader, every particle as it was after the last step, which update can read to see the others: swarm.count of them, swarm.at(j) for particle j. The step writes a second buffer, so what each particle sees doesn't depend on the order the GPU runs them in.

Shaders MurmurationFireflies

SwiftUI also SwiftUI effect, stitchable

Apple's framework for building app interfaces. Since iOS 17 and macOS 14 it can run a Metal function marked [[ stitchable ]] on a view's pixels, as a color, distortion or layer effect, with the function's extra arguments passed in from Swift.

Shaders Heat HazeFrosted Glass

Swing also shuffle

A rhythm where every other short step comes a little late, so the beat lilts instead of marching. At 0 it is straight; half a step late, it becomes a shuffle.

Shaders A Shader That Keeps the Beat

Symmetry

A picture that stays the same when it is mirrored, turned or repeated. A shader gets symmetry by folding coordinates, for example taking the absolute value of x, so that several places on screen read the same point of the picture.

Shaders KaleidoscopePenrose Tiles

Synchronization also sync, order parameter

Falling into step: many oscillators coming to share one rhythm and one phase with no leader, from small pulls between them. How far a swarm has got is measured by Kuramoto's order parameter: put every phase on a circle and average them; the length of the average is 1 when all are together and near 0 when they are spread round.

Shaders Fireflies

Thin-film interference also thin film, iridescence, interference colors

The colors of soap bubbles and oil on water. A film a few hundred nanometers thick reflects light off its front and off its back; the two reflections meet out of step by twice the film's thickness (more inside a denser film, and more at a slant), and the wavelengths that come back in step are bright while those out of step cancel. Which ones survive depends on the thickness, so the thickness is the color.

Shaders Soap Bubble

Trails also motion trails

Streaks left behind by moving things. Each frame starts from the last one, a little faded, instead of from black, so everything drawn lingers for a while and dims away.

Shaders Particle SwarmCurl-Noise FlowFireworks

Translucency also translucent, subsurface light

A body that light passes into and through, like wax, a leaf or a jellyfish, instead of bouncing off its surface. Without tracing the light inside, a shader can fake it: light the side that faces away from the lamp as well, and show more of the body's own color where the eye looks through more of it, at its edges.

Shaders Jellyfish

Transmission also transmitted light, colored glass

Light that passes through a material rather than bouncing off it. Colored glass keeps a share of each color per unit of thickness (Beer-Lambert's law), so a shader can raise the glass's color to the power of its thickness: thick glass deep and dark, thin glass pale.

Shaders Stained Glass

Truchet tiles also Truchet tile, Truchet

Tiles whose pattern meets every edge at the same places and in the same way, so any tile can sit beside any other and the lines carry on. Turned or picked at random, a grid of them makes long winding paths that nobody drew.

Shaders Kiln Floor Tiles

Turbulence

Octaves of noise, each folded at its middle (the absolute value of the noise taken from -1 to 1) before they are added up. Every fold leaves a sharp crease, so turbulence looks more cracked and veined than smooth fractal noise.

Shaders Wood & Marble

Twisting also twist

Turning a shape by an angle that grows along its length, so a straight groove becomes a spiral. In a distance field it is done before the shape is measured: the point is turned round the axis by an angle in proportion to its height, and the plain shape is measured at the turned point.

Shaders Pottery Wheel

Two-sided lighting also two-sided light

Lighting a thin surface, such as a leaf, paper or cloth, from whichever side is seen. The normal points out of one side only, so it is turned to face the eye first; and light reaching the other side can shine through the surface, dimmer and in its color.

Shaders Flag in the WindJellyfish

Uniforms

The values that are the same for every pixel of a frame, such as the time, the size of the picture and where the mouse is. The app passes them to the shader each frame.

Vertex shader also vertex shaders

A small program that runs once for every corner of a shape and decides where that corner lands on the screen, and what it carries to the pixels between. The GPU then fills each triangle, blending what its three corners carry, and a fragment shader colors each pixel inside.

Shaders Rippling WaterFlag in the WindSpinning PlanetOcean WavesJellyfish

Volume rendering also volume raymarching, volumetric rendering, volumetrics

Drawing something with no surface, such as fog, smoke, cloud or fire. The ray walks through it in small, even steps, and at each step adds the light given off there and loses some to what it has passed through.

Shaders Smoke Stack

Voronoi also Voronoi diagram

Splitting the plane into cells, one around each of a set of points, so that every place belongs to the point it is nearest to. The edges between cells are where two points are equally near.

Shaders Cracked ClayStained Glass

Functions voronoi

Wallpaper symmetry also wallpaper, seamless tiling

A pattern that repeats in two directions, as a wallpaper does. For a shader's picture to repeat with its own edges, everything on it must: a whole number of cells both ways, cell numbers that wrap round, and noise and light that wrap too. The playground's tile view shows whether it does.

Shaders Kiln Floor Tiles

Wood grain also tree rings, growth rings

Rings drawn from the distance to a log's center line: the fraction part of the distance times the number of rings, each ring pale where it starts and dark towards its end. Noise added to the distance bends the rings, and noise stretched along the log gives fine streaks.

Shaders Wood & Marble