3D · terrain-build-3d
Terrain build (3D)
A procedural mountain heightmap rebuilds itself in labelled stages — flat, noise, fractal, erosion, materials, sun, atmosphere, clouds, lens — with a typing code panel, then a cinematic eased fly-by past the peak.
A free, MIT-licensed 3D motion graphic from the Opus Motion Library — 616 motions for Remotion, React and plain HTML.

What Terrain build (3D) is for
"How it is made" / generative-art explainers: show a world being built step by step, then reward with a hero fly-through.
Details
- Category
- 3D motion graphics (three.js)
- Length
- 21.7 s (650 frames at 30 fps)
- Formats
- 16:9, 1:1, 9:16
- Weight
- heavy (three.js / WebGL — export to video for mobile)
- Transparent overlay
- no
- Seamless loop
- no
- Text props
stages- Colour props
contourColortrailColor- Mood
- mid, 3d, cinematic, nature
- Roles
- subject
- Pairs with
- End card credits, Typewriter code window, Film finishing stack
Use Terrain build (3D) in Remotion, React or HTML
Remotion project
# copy this motion into your Remotion project
node cli/mgl.mjs add terrain-build-3d --to ../my-app/src
# render an mp4 (run in the library folder)
node cli/mgl.mjs render terrain-build-3d --props '{"stages":[{"title":"NOTHING","subtitle":"a flat plane.","file":"world.glsl","code":"float terrain(vec2 p) {\n return 0.0;\n}"},{"title":"NOISE","subtitle":"one octave of noise.","file":"world.glsl","code":"float terrain(vec2 p) {\n return 1500.0 * noise(p / 2600.0);\n}"},{"title":"FRACTAL","subtitle":"twelve octaves. mountains.","file":"terrain.js","code":"for (let o = 0; o < 12; o++) {\n const n = noised(p); d += n.yz;\n h += a * n.x / (1.0 + dot(d, d));\n a *= 0.5; p = m2 * p * 2.0;\n}"},{"title":"EROSION","subtitle":"10,485,760 simulated raindrops.","file":"erosion.js","code":"for (let d = 0; d < 10485760; d++) {\n const cap = max(-dh * speed * water, 0.01);\n if (sed > cap) deposit(sed - cap);\n else erode(cap - sed);\n}"},{"title":"MATERIAL","subtitle":"rock. scree. snow.","file":"world.glsl","code":"rock = mix(rock, scree, sediment);\nsnow = smoothstep(.62, .80, normal.y);\nalbedo = mix(rock, vec3(.9, .92, .95), snow);"},{"title":"SUN","subtitle":"a star, 8 light-minutes away.","file":"world.glsl","code":"float sh = softShadow(p + n * 2.0, SUN);\nvec3 sun = sunTrans(p) * SUNI;\ncol = albedo * (sun * max(dot(n, SUN), 0.0) * sh\n + sky * occ);"},{"title":"ATMOSPHERE","subtitle":"rayleigh · mie · ozone.","file":"world.glsl","code":"const vec3 BR = vec3(5.8e-6, 13.5e-6, 33.1e-6);\nconst vec3 BM = vec3(21e-6);\ncol = col * transmittance + inscatter(ro, rd, t);"},{"title":"CLOUDS","subtitle":"volumetric. perlin-worley.","file":"world.glsl","code":"for (int i = 0; i < 110; i++) {\n float d = clouds(p, true, HF);\n acc += Tr * (1.0 - exp(-d * dt));\n Tr *= exp(-d * dt);\n}"},{"title":"LENS","subtitle":"and a camera.","file":"post.glsl","code":"motionBlur(); depthOfField();\ngodRays(); lensFlare();\nbloom(); filmGrain();"}],"contourColor":"#8fc9ff","trailColor":"#ff8a2a"}'
# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export terrain-build-3d --as mp4 --props '{"stages":[{"title":"NOTHING","subtitle":"a flat plane.","file":"world.glsl","code":"float terrain(vec2 p) {\n return 0.0;\n}"},{"title":"NOISE","subtitle":"one octave of noise.","file":"world.glsl","code":"float terrain(vec2 p) {\n return 1500.0 * noise(p / 2600.0);\n}"},{"title":"FRACTAL","subtitle":"twelve octaves. mountains.","file":"terrain.js","code":"for (let o = 0; o < 12; o++) {\n const n = noised(p); d += n.yz;\n h += a * n.x / (1.0 + dot(d, d));\n a *= 0.5; p = m2 * p * 2.0;\n}"},{"title":"EROSION","subtitle":"10,485,760 simulated raindrops.","file":"erosion.js","code":"for (let d = 0; d < 10485760; d++) {\n const cap = max(-dh * speed * water, 0.01);\n if (sed > cap) deposit(sed - cap);\n else erode(cap - sed);\n}"},{"title":"MATERIAL","subtitle":"rock. scree. snow.","file":"world.glsl","code":"rock = mix(rock, scree, sediment);\nsnow = smoothstep(.62, .80, normal.y);\nalbedo = mix(rock, vec3(.9, .92, .95), snow);"},{"title":"SUN","subtitle":"a star, 8 light-minutes away.","file":"world.glsl","code":"float sh = softShadow(p + n * 2.0, SUN);\nvec3 sun = sunTrans(p) * SUNI;\ncol = albedo * (sun * max(dot(n, SUN), 0.0) * sh\n + sky * occ);"},{"title":"ATMOSPHERE","subtitle":"rayleigh · mie · ozone.","file":"world.glsl","code":"const vec3 BR = vec3(5.8e-6, 13.5e-6, 33.1e-6);\nconst vec3 BM = vec3(21e-6);\ncol = col * transmittance + inscatter(ro, rd, t);"},{"title":"CLOUDS","subtitle":"volumetric. perlin-worley.","file":"world.glsl","code":"for (int i = 0; i < 110; i++) {\n float d = clouds(p, true, HF);\n acc += Tr * (1.0 - exp(-d * dt));\n Tr *= exp(-d * dt);\n}"},{"title":"LENS","subtitle":"and a camera.","file":"post.glsl","code":"motionBlur(); depthOfField();\ngodRays(); lensFlare();\nbloom(); filmGrain();"}],"contourColor":"#8fc9ff","trailColor":"#ff8a2a"}'React / Next.js
import {MotionPlayer} from 'opus-motion-library/web';
<MotionPlayer
motion="terrain-build-3d"
props={{
stages: [
{
title: 'NOTHING',
subtitle: 'a flat plane.',
file: 'world.glsl',
code: 'float terrain(vec2 p) {
return 0.0;
}',
},
{
title: 'NOISE',
subtitle: 'one octave of noise.',
file: 'world.glsl',
code: 'float terrain(vec2 p) {
return 1500.0 * noise(p / 2600.0);
}',
},
{
title: 'FRACTAL',
subtitle: 'twelve octaves. mountains.',
file: 'terrain.js',
code: 'for (let o = 0; o < 12; o++) {
const n = noised(p); d += n.yz;
h += a * n.x / (1.0 + dot(d, d));
a *= 0.5; p = m2 * p * 2.0;
}',
},
{
title: 'EROSION',
subtitle: '10,485,760 simulated raindrops.',
file: 'erosion.js',
code: 'for (let d = 0; d < 10485760; d++) {
const cap = max(-dh * speed * water, 0.01);
if (sed > cap) deposit(sed - cap);
else erode(cap - sed);
}',
},
{
title: 'MATERIAL',
subtitle: 'rock. scree. snow.',
file: 'world.glsl',
code: 'rock = mix(rock, scree, sediment);
snow = smoothstep(.62, .80, normal.y);
albedo = mix(rock, vec3(.9, .92, .95), snow);',
},
{
title: 'SUN',
subtitle: 'a star, 8 light-minutes away.',
file: 'world.glsl',
code: 'float sh = softShadow(p + n * 2.0, SUN);
vec3 sun = sunTrans(p) * SUNI;
col = albedo * (sun * max(dot(n, SUN), 0.0) * sh
+ sky * occ);',
},
{
title: 'ATMOSPHERE',
subtitle: 'rayleigh · mie · ozone.',
file: 'world.glsl',
code: 'const vec3 BR = vec3(5.8e-6, 13.5e-6, 33.1e-6);
const vec3 BM = vec3(21e-6);
col = col * transmittance + inscatter(ro, rd, t);',
},
{
title: 'CLOUDS',
subtitle: 'volumetric. perlin-worley.',
file: 'world.glsl',
code: 'for (int i = 0; i < 110; i++) {
float d = clouds(p, true, HF);
acc += Tr * (1.0 - exp(-d * dt));
Tr *= exp(-d * dt);
}',
},
{
title: 'LENS',
subtitle: 'and a camera.',
file: 'post.glsl',
code: 'motionBlur(); depthOfField();
godRays(); lensFlare();
bloom(); filmGrain();',
},
],
contourColor: '#8fc9ff',
trailColor: '#ff8a2a',
}}
playOnView
loop="auto"
/>Plain HTML / WordPress
<script src="opus-motion.element.js" defer></script>
<opus-motion motion="terrain-build-3d"
props='{"stages":[{"title":"NOTHING","subtitle":"a flat plane.","file":"world.glsl","code":"float terrain(vec2 p) {\n return 0.0;\n}"},{"title":"NOISE","subtitle":"one octave of noise.","file":"world.glsl","code":"float terrain(vec2 p) {\n return 1500.0 * noise(p / 2600.0);\n}"},{"title":"FRACTAL","subtitle":"twelve octaves. mountains.","file":"terrain.js","code":"for (let o = 0; o < 12; o++) {\n const n = noised(p); d += n.yz;\n h += a * n.x / (1.0 + dot(d, d));\n a *= 0.5; p = m2 * p * 2.0;\n}"},{"title":"EROSION","subtitle":"10,485,760 simulated raindrops.","file":"erosion.js","code":"for (let d = 0; d < 10485760; d++) {\n const cap = max(-dh * speed * water, 0.01);\n if (sed > cap) deposit(sed - cap);\n else erode(cap - sed);\n}"},{"title":"MATERIAL","subtitle":"rock. scree. snow.","file":"world.glsl","code":"rock = mix(rock, scree, sediment);\nsnow = smoothstep(.62, .80, normal.y);\nalbedo = mix(rock, vec3(.9, .92, .95), snow);"},{"title":"SUN","subtitle":"a star, 8 light-minutes away.","file":"world.glsl","code":"float sh = softShadow(p + n * 2.0, SUN);\nvec3 sun = sunTrans(p) * SUNI;\ncol = albedo * (sun * max(dot(n, SUN), 0.0) * sh\n + sky * occ);"},{"title":"ATMOSPHERE","subtitle":"rayleigh · mie · ozone.","file":"world.glsl","code":"const vec3 BR = vec3(5.8e-6, 13.5e-6, 33.1e-6);\nconst vec3 BM = vec3(21e-6);\ncol = col * transmittance + inscatter(ro, rd, t);"},{"title":"CLOUDS","subtitle":"volumetric. perlin-worley.","file":"world.glsl","code":"for (int i = 0; i < 110; i++) {\n float d = clouds(p, true, HF);\n acc += Tr * (1.0 - exp(-d * dt));\n Tr *= exp(-d * dt);\n}"},{"title":"LENS","subtitle":"and a camera.","file":"post.glsl","code":"motionBlur(); depthOfField();\ngodRays(); lensFlare();\nbloom(); filmGrain();"}],"contourColor":"#8fc9ff","trailColor":"#ff8a2a"}'>
</opus-motion>Compose spec (multi-scene video)
{
"width": 1920,
"height": 1080,
"fps": 30,
"scenes": [
{
"motion": "terrain-build-3d",
"props": {
"stages": [
{
"title": "NOTHING",
"subtitle": "a flat plane.",
"file": "world.glsl",
"code": "float terrain(vec2 p) {\n return 0.0;\n}"
},
{
"title": "NOISE",
"subtitle": "one octave of noise.",
"file": "world.glsl",
"code": "float terrain(vec2 p) {\n return 1500.0 * noise(p / 2600.0);\n}"
},
{
"title": "FRACTAL",
"subtitle": "twelve octaves. mountains.",
"file": "terrain.js",
"code": "for (let o = 0; o < 12; o++) {\n const n = noised(p); d += n.yz;\n h += a * n.x / (1.0 + dot(d, d));\n a *= 0.5; p = m2 * p * 2.0;\n}"
},
{
"title": "EROSION",
"subtitle": "10,485,760 simulated raindrops.",
"file": "erosion.js",
"code": "for (let d = 0; d < 10485760; d++) {\n const cap = max(-dh * speed * water, 0.01);\n if (sed > cap) deposit(sed - cap);\n else erode(cap - sed);\n}"
},
{
"title": "MATERIAL",
"subtitle": "rock. scree. snow.",
"file": "world.glsl",
"code": "rock = mix(rock, scree, sediment);\nsnow = smoothstep(.62, .80, normal.y);\nalbedo = mix(rock, vec3(.9, .92, .95), snow);"
},
{
"title": "SUN",
"subtitle": "a star, 8 light-minutes away.",
"file": "world.glsl",
"code": "float sh = softShadow(p + n * 2.0, SUN);\nvec3 sun = sunTrans(p) * SUNI;\ncol = albedo * (sun * max(dot(n, SUN), 0.0) * sh\n + sky * occ);"
},
{
"title": "ATMOSPHERE",
"subtitle": "rayleigh · mie · ozone.",
"file": "world.glsl",
"code": "const vec3 BR = vec3(5.8e-6, 13.5e-6, 33.1e-6);\nconst vec3 BM = vec3(21e-6);\ncol = col * transmittance + inscatter(ro, rd, t);"
},
{
"title": "CLOUDS",
"subtitle": "volumetric. perlin-worley.",
"file": "world.glsl",
"code": "for (int i = 0; i < 110; i++) {\n float d = clouds(p, true, HF);\n acc += Tr * (1.0 - exp(-d * dt));\n Tr *= exp(-d * dt);\n}"
},
{
"title": "LENS",
"subtitle": "and a camera.",
"file": "post.glsl",
"code": "motionBlur(); depthOfField();\ngodRays(); lensFlare();\nbloom(); filmGrain();"
}
],
"contourColor": "#8fc9ff",
"trailColor": "#ff8a2a"
}
}
]
}Terrain build (3D) props
18 parameters — change any of them to make the motion yours.
| Prop | Default | What it does |
|---|---|---|
stages | [{"title":"NOTHING","subtitle":"a flat plane.","file":"world.glsl","code":"float terrai… | list of {title, subtitle, file, code}; index order maps to the fixed build techniques (0 flat … 8 lens) |
seed | 3 | terrain seed |
stageFrames | 48 | frames per stage |
leadIn | 6 | frames before stage 0 |
flyby | true | fly past the peak after the build (overlay fades out) |
flybyFrames | 210 | length of the fly-by |
showCode | true | show the typing code panel |
showTitle | true | show the stage title block + progress dashes |
sunElevation | 7 | final sun elevation in degrees (low = golden hour) |
sunAzimuth | 104 | final sun azimuth in degrees (90 = from screen right) |
snowLine | 13 | height above which snow settles (world units, hero peak ≈ 32) |
look | "natural" | natural (default) | contours (illuminated topographic iso-lines on a dark void: no sky, clouds or lens; the build stages still run) |
camera | "fly" | fly (default fly-by) | dive (camera dives from above down the canyon toward the lowest point) |
trail | false | a glowing orange route descending the steepest slope during the fly-by (the spark path) |
contourColor | "#8fc9ff" | contours: iso-line colour |
contourStep | 1.6 | contours: height between lines in world units (hero peak ~ 32) |
trailColor | "#ff8a2a" | trail colour |
colors | {"rock":"#6e6a66","scree":"#9a948c","grass":"#4f6a3a","snow":"#f2f2f2","clay":"#bcbcbc"… | rock / scree / grass / snow / clay / sun / zenith / horizon / cloudShadow / cloudLight |
Related motions

End card credits
Closing cards, "how it was made" stats, credits and calls to action over the last shot.
end-card-credits
Typewriter code window
Show the code behind a visual, a command being run, or a "made with code" credit beat.
typewriter-code
Film finishing stack
Making any still or scene feel shot on film; a final pass over composites; a flare accent on a light source.
film-look
Low-poly terrain flyover
Travel and outdoors intros, game / world-building teasers, nature or sustainability titles, calm looping hero backdrops. Change `seed` for…
low-poly-terrain-flyover
Iso blocks (3D clay)
Declining (or any) metric stories, step-by-step progress, playful looping data explainers in real 3D.
iso-blocks-3d
Accumulation render 3D
A Blender-like finish for 3D shots and a drop-in AccumPass pattern (copy the component) for any three.js motion that needs real motion…
accum-render-3d
Notes & credits
Technique sources:
- video8 0:04-0:38