Skip to content
Back to the lab

Three.js instancing + procedural geometry

A procedurally grown mossy root

A moss-covered root generated entirely in code, with no model files: swept tubes, a moss cushion, ferns, flower sprays and two hundred and thirty thousand instanced blades of grass.

Source · GitHub

All progress in the scene is computed from the scroll position: where the survey front is, how bright the wireframe is, how long the moss is, when the flowers open and where the butterfly is. The pointer is the only live input: the view tilts with it, the moss parts under it, pollen rises where it passes, and the perched butterfly flaps its wings when the pointer comes close. This part runs only while something is still changing; once the pollen has settled, the tilt has returned and the butterfly is still, rendering stops. The scroll-window study uses the same moss (the same lib/grove). It used to be the home page's cover; since September 2026 it is only in the lab.

Specifications

Runtime
three.js r185 · custom GLSL · CanvasTexture
Passes
Two bark plates baked the moment there is a renderer, once per page; a single scene render per frame after that.
Assets
No textures and no model files; it loads only its code.
Geometry
All generated from one seed: swept tubes, a moss cushion that is thicker on the lit side, ferns, flower sprays, and 230,000 instanced blades (59,000 on a narrow viewport).
Dresses
4, switchable at the top right. The geometry is the same; the materials, fog and sky colour differ.
Pixel ratio
The display's own, capped at 2 — and at 1.5 once the canvas passes 2.6 million pixels.
Fallback
With no WebGL, or for a reader on save-data, this is a static composition instead.

Source

Source files on GitHub:

Back to the lab