Guide · Build

How to build a 3D website without video, using AI images and three.js

By Md Mahafuj Alam · Updated

Generate a small set of consistent AI images, turn each into a depth map, then render them in three.js as planes whose pixels shift by depth as the visitor scrolls. Scroll progress drives the camera and shader uniforms, so the story plays and rewinds exactly, and the page ships a few images instead of a video or hundreds of frames. This guide covers the pipeline, a working depth-parallax shader, the loading strategy and the fallbacks.

Why skip video at all

Many cinematic scroll sites start from an AI video clip, then either play it on scroll or cut it into an image sequence. Both work, and both carry the same costs. A no-video build trades those costs for more code. It is worth it when one of these four things matters to you.

  • File size. A scene made from one photo and one depth map is two image downloads. The same shot as an image sequence is often hundreds of frames, each a full image.
  • Customisation. Footage is baked. Changing the product colour or the light means generating and cutting the clip again. In a live scene, colour, timing and camera moves are numbers in a config file.
  • Real interactivity. A rendered scene can react to the pointer, the device and the visitor's input. A video can only play forwards or backwards.
  • Scrubbing in both directions without frames. When every value is a function of scroll progress, scrolling back rewinds the story exactly, at any speed, with no frames to fetch or decode.

The price is GPU work on the visitor's device and more engineering time. If the story needs a real camera flying through a complex space, footage is still the easier route. The trade-offs are laid out in image sequence vs video vs three.js.

A worked example: MANJARI

MANJARI, a mango juice template, is built this way. Its four-chapter, scroll-driven WebGL hero is rendered live in three.js from AI images made with GPT Image 2, with no video files. The backdrops are depth-parallax scenes made from Depth Anything V2 depth maps. A photographed mango swaps into a procedural 3D mango whose skin and flesh textures are baked from AI images. It scores 92 on mobile.

Its performance choices are the ones this guide recommends: small images load first and full-resolution images stream in afterwards, shaders are compiled before the loader fades, section canvases render only while on screen with a capped pixel ratio, lower-power devices get fewer particles, and there is a reduced-motion and no-WebGL fallback with a static final frame. You can see the result on the MANJARI template page, and the story of the build in the MANJARI build log.

Zelvo, the fintech template, is the other no-video approach: every object is built in code, with no 3D model files. Both are in the three.js templates collection. The rest of this guide explains the image-plus-depth technique in general terms, so you can apply it to your own product.

The pipeline, step by step

  1. Plan the scenes. Write the story as four or five chapters, each with one camera move: push in, drift sideways, rise. Depth parallax suits slow, short moves. It cannot orbit an object.
  2. Generate five or six consistent images. One wide backdrop per chapter, plus clean product shots. Keep one light direction, one lens and one colour palette across the set.
  3. Make a depth map for each backdrop. Run every image through a depth model and save a greyscale map at the same aspect ratio.
  4. Build the scene from planes. Either one plane per image with a parallax shader, or several cut-out layers at different distances, or both.
  5. Drive everything from scroll. Map scroll progress (0 to 1) to the camera position and to shader uniforms, with smoothing.
  6. Plan the loading. Small images first, shaders compiled behind the loader, full resolution later.
  7. Add the fallbacks. Reduced motion, no WebGL and low-power devices each get a defined, still-good result.

For the image prompts, the GPT Image product shot prompts cover the backdrop, product and texture images this method needs. The usual failure is drift: the second image has a different sun angle or lens from the first, and the cut between chapters looks like two different sites. Fix that at the prompt stage, not in code.

Compose backdrops with clear foreground, middle and background layers. Parallax only reads when the depth map has strong contrast between them. A flat wall photographed head-on gives a flat map and almost no motion.

Depth maps with Depth Anything V2, and its licenses

Depth Anything V2 estimates relative depth from a single image. Its repository includes a run.py script that writes depth maps for a file or a folder.

Terminal (inside the Depth-Anything-V2 repository)bash
python run.py --encoder vits --img-path backdrops --outdir depth --pred-only --grayscale

--encoder picks the model size, --pred-only saves the depth map without the side-by-side preview, and --grayscale saves it as a plain grey image instead of a colour-mapped one. The default input size is 518; --input-size raises it for finer detail. Follow the repository's README to install the requirements and download the checkpoint first.

Open each map before you use it. This output is relative depth, so check which way it runs: in the shader below, brighter must mean nearer. If your map is the other way round, invert it once in an image editor rather than in the shader. Blur hard edges slightly where a near object meets the sky. A sharp depth step stretches pixels into visible smears when the shift is large.

A depth-parallax plane driven by scroll

The cheapest way to get depth from one image is a fragment shader. Each pixel reads the depth map, then samples the photo slightly offset, by an amount proportional to its depth. Near pixels move more than far ones, which is what a camera move looks like. The plane needs only four vertices, because nothing is displaced in 3D.

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

const vertexShader = /* glsl */ `
  varying vec2 vUv;
  void main() {
    vUv = uv;
    gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
  }
`;

const fragmentShader = /* glsl */ `
  uniform sampler2D uColor;
  uniform sampler2D uDepth;
  uniform vec2 uShift;   // how far the "camera" has moved, in UV units
  uniform float uZoom;   // < 1.0 crops in, so shifted edges stay hidden
  uniform float uFocus;  // depth value that stays still (0 = far, 1 = near)
  varying vec2 vUv;

  void main() {
    vec2 uv = (vUv - 0.5) * uZoom + 0.5;
    float depth = texture2D(uDepth, uv).r;
    uv += uShift * (depth - uFocus);
    gl_FragColor = texture2D(uColor, clamp(uv, 0.0, 1.0));
    #include <colorspace_fragment>
  }
`;

export async function mountDepthParallax(
  canvas: HTMLCanvasElement,
  section: HTMLElement,
  colorUrl: string,
  depthUrl: string,
): Promise<(() => void) | null> {
  let renderer: THREE.WebGLRenderer;
  try {
    renderer = new THREE.WebGLRenderer({ canvas, antialias: false });
  } catch {
    return null; // no WebGL: keep the static image the canvas sits on
  }
  renderer.setPixelRatio(Math.min(window.devicePixelRatio, 1.5));

  const scene = new THREE.Scene();
  const camera = new THREE.OrthographicCamera(-0.5, 0.5, 0.5, -0.5, 0, 1);

  const loader = new THREE.TextureLoader();
  const [color, depth] = await Promise.all([
    loader.loadAsync(colorUrl),
    loader.loadAsync(depthUrl),
  ]);
  color.colorSpace = THREE.SRGBColorSpace; // photo: sRGB
  // depth map stays linear data (NoColorSpace is the default)

  const uniforms = {
    uColor: { value: color },
    uDepth: { value: depth },
    uShift: { value: new THREE.Vector2() },
    uZoom: { value: 0.9 },
    uFocus: { value: 0.3 },
  };
  const material = new THREE.ShaderMaterial({ uniforms, vertexShader, fragmentShader });
  scene.add(new THREE.Mesh(new THREE.PlaneGeometry(1, 1), material));

  const resize = () => {
    renderer.setSize(canvas.clientWidth, canvas.clientHeight, false);
  };
  resize();
  window.addEventListener('resize', resize);

  // Compile the shader now, behind the loader, not on the first scroll.
  await renderer.compileAsync(scene, camera);

  const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;

  // 0 at the top of the section, 1 when its end reaches the bottom of the viewport.
  const scrollProgress = () => {
    const rect = section.getBoundingClientRect();
    const travel = rect.height - window.innerHeight;
    return travel > 0 ? THREE.MathUtils.clamp(-rect.top / travel, 0, 1) : 0;
  };

  let smoothed = scrollProgress();
  let last = performance.now();

  const tick = (now: number) => {
    const dt = Math.min((now - last) / 1000, 0.1); // seconds, capped after a stall
    last = now;
    const target = reduceMotion ? 0 : scrollProgress();
    // Frame-rate-independent easing: same feel at 60 Hz and 120 Hz.
    smoothed = THREE.MathUtils.damp(smoothed, target, 6, dt);

    uniforms.uShift.value.set(smoothed * 0.06, smoothed * -0.03);
    uniforms.uZoom.value = 0.9 - smoothed * 0.08; // slow push-in
    renderer.render(scene, camera);
  };

  // Only run the loop while the section is on screen.
  const observer = new IntersectionObserver(([entry]) => {
    if (entry.isIntersecting) {
      last = performance.now();
      renderer.setAnimationLoop(tick);
    } else {
      renderer.setAnimationLoop(null);
    }
  });
  observer.observe(section);

  return () => {
    observer.disconnect();
    window.removeEventListener('resize', resize);
    renderer.setAnimationLoop(null);
    material.dispose();
    color.dispose();
    depth.dispose();
    renderer.dispose();
  };
}

How it works:

  • uShift is the camera move in UV units. A value of 0.06 at full scroll is a gentle drift; past about 0.1, smearing at depth edges becomes obvious.
  • uFocus is the depth that stays still. Pixels nearer than it move one way and pixels further away move the other, which reads as the camera orbiting slightly around that depth.
  • uZoom crops in so the shifted image never shows its edges, and shrinking it with scroll adds a slow push-in.
  • THREE.MathUtils.damp eases the value towards the scroll position using the frame time, so the motion feels the same on a 60 Hz and a 120 Hz screen. Because the target is always the scroll position, scrolling back rewinds exactly.
  • The photo is tagged SRGBColorSpace and the depth map is left as plain data, and colorspace_fragment converts the output, so the colours match the source image.

The code compiles against three.js 0.186 and uses only APIs documented on threejs.org. To use it in Next.js, call it from a client component's useEffect and run the returned cleanup on unmount. The three.js scroll scene in Next.js guide shows that wiring in full.

Layers, displacement and swapping in real 3D

The single-plane shader is the base. Three extensions give more depth when a scene needs it.

  • Layered planes. Cut the foreground (leaves, a branch, a plinth) out as a separate transparent image and place it on its own plane closer to the camera. Real 3D distance between layers gives true parallax with no smearing, and you can fly objects between layers.
  • Displaced geometry. MeshStandardMaterial accepts a displacementMap that moves the mesh's vertices, so a subdivided plane (for example new THREE.PlaneGeometry(1, 1, 256, 256)) becomes a relief the camera can move around a little. The three.js docs note that the renderer cannot recompute normals from displaced vertices, so pair it with a matching normal map if the surface is lit.
  • Photo-to-model swap. For the hero product, show the AI photo first, then cross-fade to a simple 3D model at the same position and size once the story needs it to move. Bake the model's textures from the same image set so the colours match at the moment of the swap.

Keep particles, leaves and droplets as instanced meshes or points with a count you can set at start-up. That single number is your main lever for weaker devices.

Loading strategy: no hitches mid-scroll

A no-video page is light, but it can still stutter if work lands at the wrong time. Three moments matter: first paint, the first frame of WebGL and the first scroll.

  • Small images first. Ship a small version of every backdrop and depth map (around 1024 px wide) so the scene works quickly, then swap in full-resolution textures in the background. Depth maps can stay smaller than the photos; their detail matters less.
  • Compile shaders behind the loader. renderer.compileAsync(scene, camera) returns a promise that resolves when the scene can render without stalling on shader compilation. Await it before you fade the loader, so the first scroll does not freeze while the GPU compiles.
  • Render only what is visible. Stop each canvas's animation loop when its section leaves the viewport, as the snippet does with an IntersectionObserver.
  • Cap the pixel ratio. A phone at device pixel ratio 3 renders nine times the pixels of ratio 1. Capping at 1.5 to 2 is rarely visible in soft, photographic scenes.

More on keeping animated pages fast on phones is in the scroll animation mobile performance guide.

Fallbacks: reduced motion, no WebGL, low power

Every live scene needs a defined answer for visitors who cannot or do not want to see it move.

CaseHow to detect itWhat to show
Reduced motionprefers-reduced-motion: reduceA still scene at a good moment, with the copy laid out normally. No parallax, no smooth scrolling.
No WebGLThe WebGLRenderer constructor throwsThe static image behind the canvas, ideally the final frame of the story.
Low-power devicenavigator.hardwareConcurrency or a slow first few framesFewer particles, a lower pixel-ratio cap, half-resolution textures.

Put the static image in the HTML, under the canvas. Then it is also what search engines and slow connections see, and the canvas only adds motion on top. The reduced-motion guide covers the CSS and JavaScript sides.

When an image sequence is still the better choice

AI images + three.jsImage sequence from video
Download sizeA few images and depth mapsHundreds of frames
Camera freedomSmall moves; layers extend itAnything the video model can film
Changing colours or timingEdit config valuesRegenerate and re-cut footage
InteractivityPointer, device, inputScrub only
Device loadGPU shaders every frameImage decode and canvas draw
Engineering effortHigherLower

Choose the no-video route for product stories with short, controlled camera moves and a brand that will change colours or copy often. Choose footage for long flights through a space, such as a city or a building interior, where depth parallax would break. For the wider workflow, start with how to build a 3D website with Claude, or browse all templates to compare both approaches running.

FAQ

Questions, answered.

The questions people ask most about this topic.

01Can you make a 3D website without video files?

Yes. Generate a handful of AI images, make a depth map for each, and render them in three.js as planes whose pixels shift by depth as the visitor scrolls. Add simple 3D models where an object needs to move freely. The page ships images and code, not footage.

02Which Depth Anything V2 model can I use on a commercial site?

According to the official repository, the Small model is under Apache-2.0 and the Base, Large and Giant models are under CC-BY-NC-4.0, which is non-commercial. Use Small for client and commercial work unless you have confirmed the larger models allow your use.

03How many AI images does a no-video scroll story need?

Usually five or six: one wide backdrop per chapter plus clean product shots, all with the same light direction, lens and palette. Each backdrop also needs a depth map.

04Does depth parallax work on phones?

Yes, if you cap the pixel ratio, render only the canvas that is on screen, load small textures first and reduce particle counts on weaker devices. Always keep a static image fallback for reduced motion and missing WebGL.

05Is this better than an image sequence?

It is lighter to download and easier to restyle, and it can react to input. An image sequence handles long, complex camera moves that depth parallax cannot fake, with less engineering. Pick by the camera move your story needs.