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.
- 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 06 · Molten Metaballs
Functions
ambientOcclusion- 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 05 · 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 05 · Cracked Clay
Functions
voronoi- 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 01 · Flowing Color Field
- 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.
Functions
fbm- 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 colour. In Ray Kiln it is the function called shade.
- 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.
- Kaleidoscope
A picture drawn in one thin wedge and repeated and mirrored around a centre. A shader gets it by moving every pixel into the first wedge before drawing anything there.
Shaders 04 · Kaleidoscope
Functions
kaleido- 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.
- 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 06 · Molten Metaballs
- 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 02 · Morphing Shapes
- 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 01 · Flowing Color Field
- 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 03 · Floating 3D Scene
Functions
normalAt- Polar coordinates
Describing a point by how far it is from the centre 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 04 · Kaleidoscope
- Procedural sound
Sound computed by a formula for every moment, rather than played from a recording. Each Ray Kiln shader has a sound function that returns the stereo sample at time t, and it runs on the graphics chip like the picture.
Shaders 01 · Flowing Color Field02 · Morphing Shapes03 · Floating 3D Scene04 · Kaleidoscope05 · Cracked Clay06 · Molten Metaballs
- 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.
- 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 02 · Morphing Shapes03 · Floating 3D Scene04 · Kaleidoscope06 · Molten Metaballs
- 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 02 · Morphing Shapes06 · Molten 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 06 · Molten Metaballs
Functions
softShadow- 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 04 · Kaleidoscope
- 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.
- 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 05 · Cracked Clay
Functions
voronoi