GYROID

Guide · How it was made

Flying through a minimal surface that keeps changing its mind

Gyroid is a single-page study of the triply periodic minimal surfaces — the soap-film geometries that divide space into two perfect interlocking labyrinths. The page's one job: put the visitor inside the surface, mid-flight, while it morphs on a slow cycle through the three classical TPMS — gyroid, Schwarz P, diamond — and let them steer the morph themselves.

Palette

#0A0A10 · voidThe dark inside a lattice. Everything sits on it; fog resolves into it.
#46D8C4 · membrane tealChannel A's tint and the line/mark accent. Lines only — never body copy.
#8E6CF0 · iridescent violetChannel B, and the far end of every fresnel shift. Formulae and marks.
#E4E8EC · bone inkThe body ink — derived cool off-white, ~15:1 on void. All copy sits here.

Butterfly wing scales grow real gyroids and get their green from geometry, not pigment — so the palette refuses flat colour: the two channels are tinted teal and violet, and every surface reads through an angle-dependent sheen between them. The bright accents are reserved for lines, marks and canvas light; body copy sits in bone ink for contrast.

Type

Techniques

The scene is a vanilla three.js fullscreen RawShaderMaterial on a single triangle — no geometry, no lights, everything happens in the fragment shader. Each TPMS is an implicit field (sin x cos y + sin y cos z + sin z cos x for the gyroid, and the P and D identities). The three fields are blended by a weight uniform driven from JS, the blend is shelled (|f| − 0.3) into a thin wall, and the result is sphere-traced with 92 bounded steps, a relaxed step factor and a hard far cap so scroll stays smooth (measured ~240 fps at 1440×900 while scrolling, DPR-capped and pixel-budgeted). A smooth-subtracted bubble around the camera carves a clean opening through any wall the flight path crosses, so the drift never clips. At the hit point the sign of the field says which of the two channels the face borders — teal side or violet side — and a fresnel term slides each face toward its opposite tint at grazing angles: structural colour, the butterfly's trick. The morph cycle (hold 7 s, morph 3.5 s) is exposed on window.__gyroid, the same hook the three surface cards use to steer the cycle, and the DOM readout reports surface, morph progress and the lattice cell the camera currently occupies. Reduced motion renders one settled mid-morph frame and stops; a lost WebGL context swaps in a layered CSS-gradient scene.

Iteration log

← Back to the site