Studio demo · the procedural world

Rooms

01  /  04  ·  one world, four shapes
Procedural geometry, plus one dog from Blender
Drag to orbit · scroll to zoom · M reshapes · L for night
Ulric.
Building the world
The miniature house and its fenced yard on the turntable

This browser cannot run WebGL, so the world is a still here. On a current phone or laptop it reshapes in front of you.

How it is built

Four worlds. Not one model file.

A room, a house with a yard, a forest of a few hundred trees, and an office floor. Every plank, picket, canopy and monitor is drawn from code when the page loads, out of boxes, cylinders and a few spheres. Drag to orbit, scroll or pinch to zoom, and switch the light off for the evening.

The clusters

Each world is a set of clusters: the sofa, the porch, the fence, a row of desks. Everything inside a cluster that shares a material is welded into one buffer at load, so the yard fence, 57 pickets and 110 rail sections, costs two draws instead of 167.

The repeats

Anything that appears more than a handful of times is an instanced mesh: one geometry, one material, a matrix per copy. The forest is 210 trees on a laptop and 130 on a phone, drawn three times. During a reshape each copy gets its own start time, so the trees grow outward from the path.

The reshape

A change of world is a staggered tween per cluster. The old one shrinks and sinks, the new one rises into place with a short overshoot, and the ground blends between planks, lawn, leaf litter and carpet in one shader so the floor never cuts.

53Draws, rooms
35Draws, house
19Draws, forest
37Draws, office

Counted at rest with Ronin and his shadow on screen, 1440 by 900, one directional shadow. A reshape peaks near 156 for the two seconds both worlds are on screen at once.

The sky, the brass turntable and the staggered-morph idea come from my earlier morphing rooms demo, which adapts home-sweet-home by Techartist under the MIT licence. That page draws every object separately and pays about 1,700 draws a frame for it. This one merges and instances instead, which is the whole point of the rebuild. Three.js r185.

Want a hero like this on your own site, drawn to your brand?

Book a call