Deep-Time Diamond: a scroll-driven rough-to-brilliant morph with Three.js

This is a project showcase from the prodiam brand account. prodiam is a natural-diamond cutting house and bespoke jewellery business in South Africa; the affiliation is disclosed because the experience lives on the company website. This post was prepared with AI assistance from the published source code, not as a personal developer story.

Try the live experience | Source on GitHub

The Oldest Thing You’ll Ever Own is a scroll-driven visual story following a diamond from formation to a cutter’s bench. It combines a transparent WebGL canvas with DOM text, background images, video and optional audio. The geological sequence is an illustrative narrative, not a simulation or a provenance claim about an individual stone.

How the geometry transition works

The diamond is constructed in code with indexed BufferGeometry: table, upper girdle and lower girdle rings plus a culet. The current implementation uses 18 segments. A second position attribute supplies an irregular rough-crystal shape on the same vertex layout, so a single mesh can move from rough to cut through morphTargetInfluences[0], rather than swapping models mid-story.

During the bench scene, a GSAP timeline moves that influence from 1 to 0. At the same time it changes MeshPhysicalMaterial roughness, transmission, dispersion and clearcoat. The material uses an IOR of 2.42 with a PMREM environment generated from RoomEnvironment. This is a stylised real-time material, not a ray-traced diamond-optics model.

Coordinating the story

Seven weighted scenes share one ScrollTrigger timeline. Camera distance, object rotation, text reveals and background transitions are driven from the same scene positions. Lenis is connected to the GSAP ticker, with ScrollTrigger updated on scroll. Giving the deep-time text sequence more scroll space keeps it readable without stretching every other scene equally.

The renderer caps pixel ratio at 2. Only the active scene’s background video plays; inactive scene videos are paused. The repository also includes a render-on-demand mode for deterministic screenshots. The project is a Vite/TypeScript website, not a reusable npm library.

Useful limitations to inspect

The background imagery and films are AI-generated illustrative media, separate from the procedural Three.js mesh. Media weight is a substantial part of this experience, so it is not presented as a lightweight benchmark. The geometry and material are intentionally simplified; the full source makes those trade-offs inspectable. Source code is MIT-licensed; check the repository’s media notes before reusing assets.

Technical feedback on the morph-target construction, material trade-offs and scroll pacing is welcome. There is no signup or payment required to try the demo.