Technique · three.js

three.js website templates, real-time 3D driven by scroll

These templates render 3D live in the browser with three.js rather than playing pre-made footage. In MANJARI and Zelvo the whole hero is a real-time scene; Kestra and Orbitly use three.js for the light layers, 3D models and interactive sections around their image-sequence heroes.

Templates built this way (3)

How it works

Under the hood.

SC.01

How much of each template is three.js

"Uses three.js" covers a wide range, so here is exactly where it appears in each template, taken from the published feature lists.

TemplateHerothree.js elsewhere
MANJARIFour-chapter WebGL hero rendered live from AI images, no videoDepth-parallax orchard, procedural 3D mango, GPU juice droplets, juice-flood shader
ZelvoReal-time clay money town, four scroll chaptersExploded-view phone, glass force field, ~4,300 hex-pillar world map, coin rain with cannon-es
OrbitlyImage sequence with a three.js light layer on top3D phone on spring physics, download section with a 3D planet
KestraImage sequence with a WebGL ink-drawing shader3D model tower on spring physics, 3D blueprint floor plans you can spin

Zelvo builds every object in code with no 3D model files, which makes colours and shapes easy to change. MANJARI bakes its mango textures from AI images onto a procedural mesh. Neither ships a glTF you have to open in a 3D editor.

SC.02

Driving a camera from scroll progress

A scroll-driven three.js scene keeps a target progress (0 to 1) from the scroll position, eases a current value towards it, and positions the camera along a path. Easing with an exponential factor based on elapsed time keeps the motion consistent on 60 Hz and 120 Hz displays, which is what MANJARI's frame-rate-independent smoothing refers to.

scene.tsts
import * as THREE from 'three';

const canvas = document.querySelector<HTMLCanvasElement>('#scene')!;
const renderer = new THREE.WebGLRenderer({ canvas, antialias: true });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)); // cap the pixel ratio
renderer.setSize(window.innerWidth, window.innerHeight);

const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 0.1, 100);
const path = new THREE.CatmullRomCurve3([
  new THREE.Vector3(0, 3, 12),
  new THREE.Vector3(4, 2, 6),
  new THREE.Vector3(0, 1.2, 2.5),
]);

let target = 0;
let current = 0;
let last = 0;
export const setProgress = (p: number) => { target = p; }; // call from your scroll handler

renderer.setAnimationLoop((time) => {
  const dt = last ? (time - last) / 1000 : 0;
  last = time;
  current += (target - current) * (1 - Math.exp(-6 * dt)); // frame-rate independent
  camera.position.copy(path.getPointAt(current));
  camera.lookAt(0, 0.5, 0);
  renderer.render(scene, camera);
});

The WebGLRenderer docs advise defining the loop with setAnimationLoop() rather than calling requestAnimationFrame() yourself. Because the camera only reads progress, scrolling back puts it exactly where it was, which is how both MANJARI and Zelvo rewind their stories.

SC.03

Keeping real-time 3D fast

Real-time scenes cost GPU time on every frame, so the templates share a set of habits:

HabitWhyIn the templates
Cap the pixel ratioA 3x phone screen renders nine times the pixels of 1xAll four
Render only while on screenOff-screen canvases still burn GPU timeAll four
Compile shaders before revealFirst-use compilation causes a hitch mid-scrollMANJARI; Zelvo builds every scene in its preloader
Scale effects to the deviceParticles are cheap on a desktop GPU, not on a budget phoneMANJARI uses fewer particles and leaves on low-power devices
Clean upGPU memory is not garbage-collected for youOrbitly and Kestra clean up their 3D scenes

three.js gives you the tools for each: renderer.compileAsync(scene, camera) precompiles materials, renderer.dispose() frees GPU resources, and passing null to setAnimationLoop stops the loop, which pairs well with an IntersectionObserver.

SC.04

Making code-built 3D look expensive

Primitive geometry under flat light looks like a tech demo. Zelvo's realism kit is a useful checklist: studio HDRI lighting, ambient occlusion, bloom, SMAA anti-aliasing and neutral tone mapping, with the postprocessing library in its stack, plus material detail such as reeded coin edges, clearcoat and brushed metal. MANJARI goes the other way and starts from AI images, using Depth Anything V2 depth maps to turn flat AI images into parallax layers before swapping a photographed mango for a real 3D one.

For the full build, see the guide to a three.js scroll scene in Next.js, and the reasons AI 3D sites often fail in why AI 3D websites look cheap.

When to use it

Right for the job, or not.

Visitors should interact with the scene

Pointer parallax, tap-to-fire effects, drag-to-spin floor plans and physics only work when the scene is live. Footage cannot respond.

You need sharpness at any screen size

A real-time scene renders at the display resolution, so there is no frame tier to choose and no frame payload to download.

The brand will change colours and objects often

When objects are built in code, a colour change is a config edit, not a re-render of footage.

Not when you need photoreal camera flights

A drone over a city or a fall from orbit is far easier to get as AI video turned into frames. Live 3D at that level of realism is expensive to build and to run.

Not for low-end-first audiences without a fallback

WebGL load varies widely between devices. Plan reduced quality tiers and a still fallback, as MANJARI and Zelvo do, or choose an image sequence.

FAQ

Questions, answered.

The questions people ask most about this topic.

01Do I need 3D modelling skills to edit these templates?

No 3D editor is needed for Zelvo, whose objects are all built in code with no model files. MANJARI builds its mango procedurally and includes the image prompts and asset pipeline used to make its textures.

02Will a three.js site work on phones?

Yes, with care. The templates cap the pixel ratio, render only on-screen canvases, and Zelvo uses portrait camera framing for phones. MANJARI reduces particles on lower-power devices.

03What happens if WebGL is not available?

MANJARI shows a static finale frame and Zelvo keeps the page working without its 3D scenes. Both also respect reduced-motion settings.

04Is three.js free for commercial projects?

three.js is open source under the MIT license, published on its GitHub repository, so it can be used in commercial work.

05Can three.js and an image sequence be combined?

Yes. Orbitly draws a three.js light layer over a 691-frame image sequence, so the footage stays photoreal while the stars, streaks and map pins respond live.

Start from a finished scroll story.