Tuning Prism Hero
A first screen whose glass prism is the reader's own six values: it turns to face them as they scroll, splits the light into a spectrum, and its values draw out as chips they can pull to retune the page.
WebGL20 deps1 file · 66 KB TSXreduced-motion aware
Props
"use client";
import { useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
import type { CSSProperties, KeyboardEvent as ReactKeyboardEvent, PointerEvent as ReactPointerEvent, RefObject } from "react";
/**
* TuningPrismHero — a first screen whose glass prism is the reader's own tuning.
*
* The prism is ray-marched live in WebGL2 (no three.js, no assets): its
* cross-section is the reader's hexagon, so it is a different object for
* every person. Glass with dispersion splits the key light (tinted by
* warmth, 6,500 K to 2,700 K) into a spectrum that falls on the wall behind.
* Pinned, the scroll turns it from a gem pose to face the reader, then six
* rays draw out of its corners, each ending in a chip: drag a chip along its
* ray (or use the arrow keys) and the prism re-forms while every Ultra asset
* on the page retunes. The prism leans toward the pointer and sways a little
* at rest when motion allows. Paper light swaps the dark studio for a white
* sweep with black flags. The canvas starts on first approach, draws on
// ---------------------------------------------------------------
// Full source available with a viberdy Pro subscription.
// https://viberdy.dev/pricing
// ---------------------------------------------------------------
}Details
About this heroe
Most heroes put a beautiful object next to the headline and leave it there. Here the object is the reader. The glass prism's cross-section is their own six values (contrast, warmth, light, density, motion and focus), so no two visitors see the same shape. It is rendered live: real refraction, a slight split of the light into colour at every edge, and a spectrum falling on the wall behind it, all lit by a key light whose colour follows warmth. The section pins while the scroll turns the prism from a gem pose to face the reader; then six rays draw out of its corners, each ending in a chip with a value. Pull a chip along its ray and the prism re-forms while everything else on the page follows. Turn the light up past the middle and the dark studio becomes a white sweep, with the ink re-solved so the headline still reads.
Curator’s note
The Ultra kit's hero. Pro: a hand-written WebGL2 ray marcher for an extruded irregular hexagon (iq's polygon SDF, rounded extrusion) with per-channel refraction for dispersion, a studio of softboxes that swaps for a flagged paper sweep, a spectral caustic, and DOM chips projected from the prism's corners with the shader's own camera. Every Ultra entry reads the same six values (contrast, warmth, light, density, motion, focus) from one shared store, so a change made in any of them re-forms all of them.

