Parametric shapes
Starting from the obvious…
SDF ray marching
open full size ↗Each shape above is defined by a signed distance function taken from Inigo Quilez’s website.
A signed distance function \(f(\mathbf{p})\) takes a point \(\mathbf{p}\) in space and returns how far it is from the nearest surface of a shape — positive outside, negative inside, zero exactly on the surface. That sign is what makes it “signed.”
A sphere of radius \(r\) centered at the origin is the cleanest example. The distance from any point \(\mathbf{p}\) to the sphere’s surface is simply how far \(\mathbf{p}\) is from the origin, minus the radius:
To render these shapes, the fragment shader uses ray marching: a ray is cast from the camera through each pixel. At each step along the ray, the SDF is evaluated to find the distance to the nearest surface. That distance is safe to advance — stepping that far in any direction can’t overshoot the surface. This continues until the distance is nearly zero (a hit) or the ray travels too far (a miss). No mesh, no rasterization — just a function queried repeatedly until the surface is found.
Or Platonic solids…
Platonic duals
open full size ↗The five Platonic solids are the only convex polyhedra where every face is the same regular polygon and every vertex joins the same number of faces. Each has a dual, formed by placing a new vertex at the centre of every face and connecting adjacent face-centres with new edges.
The swap is exact. The cube has 6 faces and 8 vertices; its dual, the octahedron, has 6 vertices and 8 faces. Both share 12 edges. The tetrahedron is its own dual — its four face-centres form a second tetrahedron pointing the opposite way. The dodecahedron and icosahedron are duals of each other, exchanging 12 and 20 throughout.
Or we can leave behind piecewise constructions for geometry born function-first, defined entirely by continuous, differentiable equations, which feels more true to our rules.
Scalar fields
open full size ↗A scalar field assigns a single number to every point in space — temperature, pressure, elevation. The shapes above are level sets of scalar fields: the set of all points where the field equals a fixed value. Written as an equation, that is \(F(x, y, z) = 0\), where \(F\) is the field function.
Quadric surfaces. When one or two of the variables appear squared (or multiplied together), the resulting surfaces are called quadric surfaces — the 3D cousins of the conic sections you draw in 2D. The elliptic paraboloid \(y = x^2 + z^2\) is a bowl: horizontal cross-sections are circles, vertical ones are parabolas. Flip one sign and you get the hyperbolic paraboloid \(y = x^2 - z^2\) — a saddle that curves up in one direction and down in the other, popular in architecture because it can be built from straight beams. The cone \(y^2 = x^2 + z^2\) is the boundary case between them.
Higher-degree surfaces. Higher-degree polynomials produce richer geometry. The monkey saddle \(y = x^3 - 3xz^2\) has three valleys meeting at the origin — enough room for two legs and a tail. The torus and hyperboloid come from quadratics involving a square root, encoding the distance to a circle rather than a point.
These surfaces are rendered the same way as the SDF demo — a ray is cast per pixel and marched through space — but without a true distance field to guide the step size. Instead, the shader takes uniform small steps and watches for a sign change in \(F\), meaning the ray has crossed the surface. A short binary search then pins down the exact crossing point.
Moving scalar fields
open full size ↗Each surface below has one or more parameters that change continuously with time — a radius that breathes, a phase that advances, a threshold that slides. The shape is still the zero set of a function \(F(x,y,z,t) = 0\), but now \(t\) is part of the equation, not just the camera rotation. The marcher re-evaluates the full field every frame.
Shape index
\(y = e^{-r} \cos(5r - 2t)\), \(r = \sqrt{x^2+z^2}\). A damped standing wave whose phase \(2t\) advances with time, so the crests travel outward from the origin. The exponential envelope \(e^{-r}\) kills the oscillation at large radius, keeping the shape compact.
\((\sqrt{x^2+z^2} - R(t))^2 + y^2 = r_t(\theta,t)^2\). The major radius \(R\) breathes with two beating frequencies. The tube radius \(r_t\) varies around the ring: two azimuthal waves — one with three lobes, one with seven — travel in opposite directions, creating a surface that writhes and shifts without any single repeating pattern.
\(y = \sin(2x + t)\cos(2z + 0.7t)\). A product of two traveling sinusoids, one in \(x\) and one in \(z\), each with its own phase velocity. Their product creates a grid of crests that drift diagonally across the plane. Where one factor is near zero the surface flattens into a node line; where both peak the surface rises to a local maximum.
\(|p| = r_0 + A(t),P_2(\cos\theta)\). Rather than inflating uniformly, the radius varies with the second Legendre polynomial \(P_2\), which is positive at the poles and negative at the equator. The surface alternates between a prolate (tall) and oblate (flat) ellipsoid, with \(A(t)\) driven by two incommensurate frequencies so the oscillation never simply repeats.
\(y = A(t)(x^2 - z^2)\), \(A(t) = 0.70 + 0.30\sin(0.75t)\). A hyperbolic paraboloid — the standard architectural saddle — whose curvature amplitude breathes. When \(A\) is large the surface curves sharply; when it nears zero the sheet flattens to the \(xz\)-plane before curving back the other way.
\(\cos(kx)\sin(ky) + \cos(ky)\sin(kz) + \cos(kz)\sin(kx) = 0\), \(k(t) = 1.45 + 0.42\sin(0.5t)\). A triply periodic minimal surface: its mean curvature is zero everywhere, like a soap film. Scaling \(k\) stretches the repeating cell — a larger \(k\) packs the tunnels closer together, a smaller \(k\) opens them up. The gyroid has no straight lines and no mirror planes.
\(\cos 2x + \cos 2y + \cos 2z = c(t)\), \(c(t) = 0.88\sin(0.55t)\). Another triply periodic minimal surface at \(c = 0\). Moving the threshold \(c\) away from zero breaks the equal area balance between the two labyrinthine regions the surface divides space into — one inflates as the other shrinks. At \(c = \pm 3\) the surface degenerates to three sets of parallel planes.
\((x^2+y^2+z^2)^2 = a(t)^2(x^2 - z^2)\). The 3D analogue of the figure-eight lemniscate of Bernoulli. The right side \(a^2(x^2-z^2)\) is positive in the \(x\)-dominant quadrants and negative in the \(z\)-dominant ones, so the surface has two lobes along \(x\) and a pinch at the origin. As \(a\) oscillates the lobes expand and contract.
\(x’^2/a^2 + y’^2/b^2 + z’^2/c^2 = 1\), with \((x’, y’)\) rotated by \(\phi(t)\). The ellipsoid is elongated along its \(y\)-axis. That long axis slowly tilts back and forth by rotating the coordinate frame before computing the surface — so the shape sways as a whole while the three semi-axes continue to breathe. The tilt and the breathing run at incommensurate rates, so the motion never locks into a periodic cycle.
\(x^4 - 5x^2 + y^4 - 5y^2 + z^4 - 5z^2 + c(t) = 0\). A degree-4 algebraic surface named for the tangle of its topology. The function \(u^4 - 5u^2\) has two valleys (minima) at \(u = \pm\sqrt{5/2} \approx \pm 1.58\) separated by a local maximum at the origin. Sliding \(c\) controls which of the eight octant-centred lobes are present and whether they are connected.
\(T_4(sx) + T_4(sy) + T_4(sz) = 0\), \(T_4(u) = 8u^4 - 8u^2 + 1\) (the 4th Chebyshev polynomial), \(s(t)\) oscillates. This degree-4 surface has exactly 12 ordinary double points — one at the midpoint of each edge of a cube — which is the maximum for a degree-4 surface (the Kummer-type bound). Scaling \(s\) morphs it between an angular multi-lobed form and a smoother rounder one.
\(x^2 + z^2 = (y + A\sin(4y - t))^2\). A cone \(x^2+z^2 = y^2\) with the axial coordinate deformed by a sinusoidal ripple whose phase \(t\) advances upward. This compresses and expands alternating bands of the cone, creating travelling pinch-points that climb the axis.
\(y = A(t),e^{-r^2/\sigma(t)^2}\), \(r = \sqrt{x^2+z^2}\). A radially symmetric bump whose height \(A\) and width \(\sigma\) oscillate at different rates. When \(\sigma\) is small the bump is a sharp spike; when large it is a broad shallow mound. Because \(A\) and \(\sigma\) beat against each other, the bump never simply repeats.
\(\cos 2x,\cos 2y + \cos 2y,\cos 2z + \cos 2z,\cos 2x = c(t)\). Like the Schwartz P, this is a triply periodic surface — but from a different symmetry family. The I-WP surface divides space into two regions with different connectivities (one is simply connected, the other is multiply connected). Sliding \(c\) morphs between the balanced minimal surface and thickened or thinned versions of its two labyrinths.
\(y = x^2 - z^2 + A(t),xz\). The term \(x^2-z^2\) is a saddle with principal curvatures along \(x\) and \(z\). Adding \(A,xz\) rotates the curvature axes in the \(xz\)-plane — when \(A = \pm 2\) the axes have rotated \(45°\). As \(A\) oscillates the saddle continuously spins its principal directions.
Tube radius \(r(\theta, t) = r_0 + \varepsilon\sin(4\theta - t)\). A standard torus has uniform tube radius. Here the tube is pinched and bulged four times as you go around the ring (\(n = 4\) in the sinusoid), and the pattern rotates with time. The resulting surface has four bulges chasing each other in a circle.
\(|p| = 1 + A\sin(3\lambda - t)\sin(2\varphi)\), where \(\lambda\) is longitude and \(\varphi\) is latitude. A sphere with a spherical-harmonic-like bump pattern that rotates about the polar axis. The \(\sin 2\varphi\) factor makes the bumps zero at the poles and maximum at mid-latitudes; the \(\sin 3\lambda\) gives three bumps per latitude circle.
\(x^2(1 + A\sin(2.8y - t)) + z^2 - y^2 = 0.40\). A one-sheet hyperboloid \(x^2+z^2-y^2 = c\) has circular cross-sections. Here the \(x^2\) coefficient is modulated by a sinusoid that travels along \(y\), squeezing the cross-section alternately into an ellipse in \(x\) and a circle, producing a surface that looks like a hyperboloid with standing waves pressed into it.
\(x^2 y + y^2 z + z^2 x = A(t)\). A cyclic cubic: the monomials \(x^2 y, y^2 z, z^2 x\) are related by the cyclic permutation \((x, y, z) \to (y, z, x)\). This gives the surface a 3-fold rotational symmetry about \((1,1,1)\). As \(A\) oscillates the surface swells and tightens around the symmetry axis.
\(y = \sin(t),x^2 + \cos(t + \varphi),z^2\). As \(t\) advances, \(a = \sin(t)\) and \(b = \cos(t+\varphi)\) independently sweep through positive and negative values. The surface cycles through four qualitatively different states: elliptic paraboloid (bowl), hyperbolic paraboloid (saddle), inverted bowl, and saddle again — passing through a degenerate parabolic cylinder each time one coefficient crosses zero.
Scalar field blend
open full size ↗Pick any two surfaces from the full catalogue — static or moving — and drag the slider between them. At every point in space the shader evaluates both field functions and linearly interpolates the result: \(F_{\text{blend}}(p) = (1-t)\,F_A(p) + t\,F_B(p)\). The zero set of this blended field is a new surface that continuously deforms from one to the other as \(t\) goes from 0 to 1.