Backdrops · effect

Contour

A topographic relief on paper, printed with its own contour lines.

ambient, watch the land breathe

Paste into Claude Code, Cursor or any agent. Pinned to a tag, so it will not change under you.

Options

paper #fbfaf4

css colour

The paper behind the land. Match it to your page background or the horizon reads as a hard edge.

land #f4f1e7

css colour

The land itself. Keep it close to the paper but not identical, or the horizon disappears entirely.

ink #6f665a

css colour

The contour lines. A warm grey reads as print; pure black reads as a wireframe.

indexInk #c44400

css colour

Every fifth line is an index contour, the one a real map would label. This is the obvious place for your own colour.

relief 1.9

0.2 to 5, good: 1 to 2.4

Height of the land. Past about 3 the ridges are steeper than the sun can light and the far side goes black.

scale 0.3

0.1 to 2, good: 0.2 to 0.5

Size of the landforms. Lower is broader country with fewer, longer ridges.

density 1.7

0.5 to 12, good: 1.2 to 3

Contour lines per unit of height. More lines reads as steeper country. Past about 8 the lines are closer than the pixels and the map turns grey.

weight 0.72

0 to 1, good: 0.45 to 0.85

Weight of the lines. Zero is bare land with no map printed on it, which is a perfectly good backdrop in its own right.

elevation 26

5 to 80 deg, good: 15 to 40

Sun height above the horizon. Low rakes the ridges and is most of where the depth comes from. High flattens the whole thing into a map.

azimuth 38

0 to 360 deg, good: 20 to 70

Sun direction around the compass. Convention on a printed map is light from the north west, which is about 315.

tilt 0.5

0 to 1, good: 0.3 to 0.7

Camera height. Zero is down on the deck with a horizon, one looks straight down at a map. The interesting ground is in between.

zoom 0.55

0.3 to 2, good: 0.45 to 0.8

How much of the frame the land fills.

period 6

4 to 120 s, good: 6 to 40

Seconds for one loop of the morph. The land travels a closed orbit through noise space and returns exactly. The default is 6 so the preview video is a whole cycle; 20 to 40 is right behind a page, where the land should be moving slowly enough that nobody catches it.

reducedMotionTime 3

0 to 120 s

The single frame shown when the user prefers reduced motion. Any time works here: a still relief is a map, which is a finished thing to look at.

What it needs

Dependencies
three@>=0.160.0
Browser
WEBGL1
Frame budget
~6 ms · 1 context
Pinned to
v0.2.0
  • three.js must already be a dependency of the project. It is not bundled
  • The displacement runs in the vertex shader, so a 160 square grid is one upload and costs memory rather than frame time
  • The same displacement is injected into a custom depth material. Without that the land casts the shadow of a flat plane and the relief detaches from its own shading
  • 25,600 vertices, four octaves of noise each, twice: once for the surface and once for the shadow pass
  • Nothing is uploaded per frame. Only uniforms change

Concept credit: real-time terrain with shader displacement, by Codrops. The implementation here is written from scratch.