Bearing Flow Field
An ordered crystal of polished steel balls that pours and pools like water across a concrete floor, lit by one low raking lamp. The terraces and ragged edges of the pile are kept on purpose. Drag the pointer through it and it digs a trench that slumps back in; click and a handful of sixty drops.
WebGL20 deps1 file · 65 KB TSXreduced-motion aware
Props
"use client";
import { useEffect, useRef, useState } from "react";
import type { CSSProperties, ReactNode } from "react";
/**
* BearingFlowField: an ordered crystal of polished steel spheres that pours and
* pools like water. Balls fall from above the frame in a rope, land on a pile,
* roll down it in layers and spread across a concrete floor as a thin hexagonal
* sheet whose ragged edge is a staircase of terraces. Nothing is simulated as a
* fluid; every ball sits on one exact hexagonal lattice, and the liquid
* behaviour is what a crystal does when it is poured.
*
* HOW IT IS MADE. Hand-written WebGL2, no dependencies.
* - THE LATTICE. A hex-lattice height field on the CPU: one integer (a stack
* of balls) per cell, ~9k cells by default. Layers alternate between the
* lattice and its hollows (ABAB), so every ball touches its neighbours
* exactly: spacing 1, layer rise 0.8165.
// ---------------------------------------------------------------
// Full source available with a viberdy Pro subscription.
// https://viberdy.dev/pricing
// ---------------------------------------------------------------
}Details
About this background
Poured ball bearings look like a liquid that forgot to stop being a crystal. This background keeps that on purpose. A rope of steel balls falls from above the frame, lands on a heap and rolls down it in layers, spreading across a concrete floor as a thin hexagonal sheet whose ragged edge is a staircase of terraces. Every ball sits on one exact lattice, touching its neighbours, so the pour reads as liquid and the structure never lets go of being a crystal. One low lamp rakes across the pile so every terrace edge throws a long shadow and the concrete shows its grain, and a tilt-shift blur keeps one band sharp. Each ball reflects a procedural studio and goes dark where its neighbours crowd it. Move the pointer through the pile and a plough digs a trench, throwing berms to either side before the walls slump back. Click or tap and a handful of sixty balls drops. Scrolling tilts the table a few degrees, and a Pause control stops the loop.
Curator’s note
Nothing here is a fluid. Every ball sits on one exact hexagonal lattice, so the liquid behaviour is what a crystal does when it is poured: balls roll to the lowest hollow, hollows fill first, and the pile advances one terrace at a time. The look is the point of the piece: a real studio, one low lamp, reflections occluded by the neighbouring balls. Change the metal or the fluidity and the pile behaves differently with no code changes.


