Gyre is a concept for a collectible table cast in one block of optical acrylic: a 900 mm top whose centre sinks into a whirlpool, a twisted column and a round base. It is written in TypeScript with plain Three.js, with no model file and no HDRI download: the geometry, the studio lighting and the flow are all generated in code.
The table never moves. The scene has three meshes, the same split a designer's GLB would have: a static top, a static base and the funnel (the dish in the top plus the column) between them. Their matrices are frozen. Only the funnel's surface changes, in its vertex shader. Each vertex carries a radial UV (u is the angle around the axis, v runs from the rim of the dish to the foot) and the two tangents of the undeformed surface, so a modelled funnel with the same UV layout can replace the generated one without touching the shader.
The flow. The height of the surface is a sum of four spiral waves in polar coordinates, sin(n·α + k·v − phase), where α is the angle twisted by the position along the funnel. The arm counts n are whole numbers, so there is no seam where the angle wraps. The phase grows with time, which carries every crest from the rim into the centre and down the column. The spiral angle itself is bent by two slow harmonics (a domain warp made of sines), and each wave has a slow envelope. All speeds are in irrational ratios (φ, √2, √3, √5, π), so the sum is quasi-periodic and never returns to an earlier state; a unit test checks a full day. The waves fade to zero at the rim, the centre of the dish, the underside of the top and the foot, so the moving surface stays welded to the static parts. Normals are rebuilt per vertex from two displaced neighbours, so reflections and refraction follow the folds.
Precision. The flow time is kept in JavaScript as a float64. The shader never sees it: the phase of every term is computed on the CPU, wrapped to 2π and sent as a uniform, so the folds do not start to jitter on a page left open for hours.
One formula, two places. The same field is written in TypeScript (core/flow.ts) and generated into the GLSL from the same constants (view/flowGlsl.ts). The shape is a pure function of the seed and the time, never of accumulated frame deltas, so a 60 Hz and a 120 Hz screen show the same funnel at the same time.
Freeze. Freeze moment stops the time on a whole millisecond and returns { seed, time, code }, with a code like GYR3-5A3F-58142445 (formula version, seed, milliseconds). The code goes into the page address, can be pasted back to restore exactly that shape, and is available to scripts through window.gyre.freeze(), window.gyre.restore(code), window.gyre.state() and a gyre:freeze event. Export STL rebuilds the frozen funnel on the CPU at a finer resolution (384 × 356 quads), adds the top and the base, and writes a binary STL in millimetres.
The acrylic. The funnel uses MeshPhysicalMaterial transmission (real refraction of the room, index 1.49, thickness, a faint blue-green attenuation, dispersion) extended with onBeforeCompile: the flow in the vertex stage, a Fresnel rim light, and toward the silhouette a ray that refracts at the front face, reflects off the back face and is looked up in the HDR environment, which gives the dark and bright streaks of a solid crystal. The flat top and base would gain little from a refraction pass and would hide the column behind them, so they are drawn as clear glass blended over the scene: reflections at full strength, a Fresnel rise and polished edges that glow with trapped light.
Studio light without a download. The environment is a small scene rendered once into a PMREM cube: a grey cyclorama, an overhead softbox, eight tall strip boxes with black flags between them (a light tent, so the acrylic catches long highlights from any angle) and a warm kicker. The floor shader adds the soft shadow of the top, a contact shadow at the base and moving caustics driven by the same phases as the funnel, so they freeze with it.
Post-processing. A half-float composer with multisampling: Unreal bloom above a threshold of 1.0, so only the brightest highlights glow, then a lens pass with radial chromatic aberration (zero in the middle, growing toward the edges), a slight vignette and fine grain.
Performance. Phones get a lighter mesh (136 × 134 quads instead of 224 × 208), a pixel ratio capped at 1.5 and the refraction pass at half resolution. If frames stay slower than about 42 fps, the viewer drops multisampling first, then lowers the pixel ratio in quarter steps. It renders only while visible and only when something changes (flow, camera inertia or the slow turntable). OrbitControls gives the inertia; vertical swipes still scroll the page on touch, and the wheel zooms only with Ctrl or ⌘.