New: Earn 20% as an AgentAlley affiliate. Share your link and earn on every sale you refer. Join now New: Earn 20% as an affiliate. Join now

Build rich, scroll-controlled real-time Three.js experiences

Build Three.js Scroll Worlds

by MengTo · MIT license · ★ 6,243 on GitHub · updated Sep 23

Build Three.js Scroll Worlds cover

Build rich, scroll-controlled real-time Three.js experiences as one persistent 3D world whose camera, lighting, atmosphere, materials, objects, DOM story, and interactions evolve across authored chapters. Use for 3D scrollytelling,…

---
name: build-threejs-scroll-worlds
description: Build rich, scroll-controlled real-time Three.js experiences as one persistent 3D world whose camera, lighting, atmosphere, materials, objects, DOM story, and interactions evolve across authored chapters. Use for 3D scrollytelling, scroll-driven WebGL worlds, camera journeys, interactive portfolios, product stories, exhibitions, explainers, game or film microsites, spatial narratives, and multi-scene websites where native scroll should travel through one continuous place. Not limited to landing pages.
---

# Build Three.js Scroll Worlds

Build one detailed real-time world and use native document scroll as its deterministic conductor. Keep the renderer, scene graph, and spatial continuity alive while camera composition, light, fog, animation, copy, and interaction focus move through authored chapters.

The mechanism is **one persistent Three.js world + one normalized reversible scroll state**. If removing either makes the experience collapse into stacked sections, this skill applies.

The exact [Kage demo](demo/index.html) proves the quality bar; it is staging, not a mandatory subject or layout. Use its detailed anatomy only when the requested direction benefits from it: [references/kage-anatomy.md](references/kage-anatomy.md).

## Route the request correctly

- Use `threejs` for a single interactive scene with no scroll-authored journey.
- Use `scroll-world-storytelling` when deciding between real-time 3D, pre-rendered video, and DOM-first storytelling.
- Use `scroll-scrubbed-visual-sequence` for a video or image sequence whose time is scrubbed by scroll.

Overview

Build one detailed real-time world and use native document scroll as its deterministic conductor. Keep the renderer, scene graph, and spatial continuity alive while camera composition, light, fog, animation, copy, and interaction focus move through authored chapters.

Manual install (npx, ZIP)
Claude Codenpx skills add MengTo/Skills --skill build-threejs-scroll-worlds -g -a claude-code
Claude Code (manual)mkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/MengTo/Skills/tar.gz/a965851e27dc \ | tar -xz -C ~/.claude/skills --strip-components=3 Skills-a965851e27dc/agent-skills/web-design/build-threejs-scroll-worlds
Windows (PowerShell)New-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/2ece4234628ecfd53f18/build-threejs-scroll-worlds.zip" -OutFile "$env:TEMP\build-threejs-scroll-worlds.zip"; Expand-Archive "$env:TEMP\build-threejs-scroll-worlds.zip" -DestinationPath "$HOME\.claude\skills" -Force
Claude.ai / desktopDownload the ZIP and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md18.2 KB
  • agents/1 file · 294 B
  • demo/19 files · 3.5 MB
  • references/5 files · 54.0 KB
Read the files here
MengTo/a96585126 files
SKILL.md
Show the full text310 lines

Build Three.js Scroll Worlds

Build one detailed real-time world and use native document scroll as its deterministic conductor. Keep the renderer, scene graph, and spatial continuity alive while camera composition, light, fog, animation, copy, and interaction focus move through authored chapters.

The mechanism is one persistent Three.js world + one normalized reversible scroll state. If removing either makes the experience collapse into stacked sections, this skill applies.

The exact Kage demo proves the quality bar; it is staging, not a mandatory subject or layout. Use its detailed anatomy only when the requested direction benefits from it: references/kage-anatomy.md.

Route the request correctly

  • Use threejs for a single interactive scene with no scroll-authored journey.
  • Use scroll-world-storytelling when deciding between real-time 3D, pre-rendered video, and DOM-first storytelling.
  • Use scroll-scrubbed-visual-sequence for a video or image sequence whose time is scrubbed by scroll.
  • Use cinematic-scroll-storytelling for DOM-first GSAP/Lenis choreography.
  • Use this skill when objects must remain truly spatial and interactive while scroll moves through several compositions in one live WebGL world.

Do not disguise a video as Three.js. The public oso95/scroll-world project, reviewed at commit 71cc36d, is a strong reference for intake, scene ledgers, budget gates, mobile-specific composition, config-driven playback, and seam QA, but its renderer is a pre-generated video chain. This skill adopts those structural strengths while retaining real geometry, materials, lighting, raycasting, and camera control.

Read the build references

Before implementing a new world, read:

Copy references/scroll-conductor.js when a project needs a portable native-scroll conductor rather than a framework-specific implementation.

Start with the output, not the template

Determine what the world is for: a landing page, portfolio, museum chapter, product explanation, game teaser, editorial essay, data story, or another spatial experience. Do not force every request into a hero-plus-CTA layout.

Discover only what is unknown:

  • the subject, audience, and ordered story beats;
  • the art direction and emotional arc;
  • whether the world is continuous, portal-connected, or composed as adjacent sets;
  • the target devices and minimum acceptable hardware;
  • how interactive the world should be beyond scrolling;
  • available models, textures, brand assets, audio, and copy;
  • the initial-load and total-download budget.

If the user supplied an approved reference or working scene, inspect it first and carry its real geometry, materials, textures, light ratios, camera values, and motion constants into the ledger. Do not replace measured details with adjectives.

Write the world bible before code

Define one reusable visual grammar:

  • scale system and unit convention;
  • silhouette language and level of stylization;
  • palette and per-chapter accent progression;
  • material families and wear logic;
  • key, fill, rim, practical, and emissive light roles;
  • fog, haze, particles, weather, and post-processing;
  • typography, DOM composition, and near-plane foreground rules;
  • motion grammar for camera, ambient objects, and interactions.

Every visible detail must support the same world. Random noise, unrelated texture packs, arbitrary particle effects, and one-off materials create complexity without cohesion.

Author a scene ledger

Use 4–8 chapters for most experiences. Store the full contract as data rather than scattering thresholds through CSS and the render loop:

const chapters = [
  {
    id: "threshold",
    scrollWeight: 1.25,
    copy: {
      eyebrow: "Chapter 01",
      title: "Enter the archive",
      body: "A spatial collection revealed through motion."
    },
    camera: {
      position: [0, 3.8, 13.5],
      target: [0, 2.4, -8],
      fov: 38,
      mobile: { position: [0, 4.8, 18], fov: 46 }
    },
    world: {
      key: 1.0,
      practicals: 0.35,
      fog: 0.018,
      particles: 0.25,
      grade: "cold"
    },
    focus: ["gate", "lantern-left"],
    interactions: ["inspect-gate"],
    assets: ["gate-shell", "stone-1k", "mist-atlas"]
  }
];

For each chapter record the story beat, landmark, camera endpoint, occluders, light/fog state, active animation clips, interaction targets, DOM beat, foreground treatment, asset dependencies, and responsive override. Reject a chapter that differs only by copy.

Build one persistent spatial architecture

Create these systems once:

WebGL canvas
  worldRoot
    environment       sky, terrain, distant silhouettes
    architecture      persistent landmarks and paths
    chapterSets       local props grouped for culling and loading
    interactives      raycast targets and animation state
    atmosphere        fog volumes, particles, weather
    nearPlane3D       optional camera-relative depth accents

DOM above canvas
  semantic chapters  headings, copy, links, media, fallback order
  fixed interface    progress, chapter navigation, controls
  fixed cut-outs      optional alpha foregrounds at viewport edges

Use one renderer and normally one scene. Use layers or render passes when transparency, post-processing, or interaction isolation requires them. Do not instantiate one renderer per chapter or rebuild the world at seams.

Choose a topology deliberately:

  • Continuous geography: landmarks share one navigable space; strongest presence, highest world-building cost.
  • Connected sets: rooms or islands are joined by tunnels, gates, fog banks, terrain folds, or darkness; easiest to art-direct and stream.
  • Layered reveal: the same place changes through time, scale, or state; animate materials, visibility, and light instead of moving to unrelated coordinates.

Hide unavoidable discontinuities behind occlusion, darkness, dense atmosphere, an interior threshold, or a close foreground pass. Never let an object visibly teleport in open space.

Give the world real detail

Geometry
  • Establish the large silhouette first, then medium forms, then small accents. A dense scatter of tiny props cannot rescue a weak silhouette.
  • Give architectural edges believable thickness, bevels, joints, caps, reveals, and contact points. Paper-thin roofs and floating props expose the fake immediately.
  • Use modular kits, instancing, merged static meshes, and LODs instead of duplicating unique geometry.
  • Break repetition with authored clusters, scale/rotation ranges, decals, and material variation—not unbounded randomness.
  • Keep collision and raycast proxies simpler than render meshes.
Materials and textures

Use a coherent PBR surface stack where it improves the image:

map role common failure
base color material identity and broad variation baked highlights fight live lighting
normal small directional relief strength too high makes rubber or foil
roughness controls highlight breakup and age flat values make every object plastic
AO contact and crevice grounding multiplied too heavily makes dirty seams
metalness separates conductors from dielectrics gray values everywhere create implausible mud
emissive practical lights, screens, runes replaces light but does not illuminate nearby forms
alpha/transmission foliage, cloth, glass, mist sorting, overdraw, and depth artifacts
  • Set color textures to sRGB and keep normal, roughness, AO, metalness, and data textures linear.
  • Keep texel density consistent within a camera range. Reserve 2K–4K maps for surfaces that genuinely fill the frame; use 512–1K atlases for most props.
  • Prefer KTX2/Basis compression, Meshopt/Draco geometry compression, atlases, trim sheets, decals, and baked AO/light where appropriate.
  • Add anisotropy only to shallow-angle surfaces that need it. Setting every texture to the maximum wastes bandwidth.
  • Make wear causal: exposed edges polish, recesses collect grime, water leaves vertical or pooling traces, and paths compress vegetation. Uniform grunge reads as a filter.
  • For foliage, use alpha-tested cards or instanced low-poly clusters before transparent blended planes. Transparency overdraw is often more expensive than geometry.
Lighting and atmosphere
  • Start with one authored key direction, a restrained environment/fill, and practical emissive sources. Add lights only when they create a visible relationship.
  • Bake static bounce and contact where possible. Keep shadow-casting dynamic lights to roughly 1–2 on mobile and 2–4 on desktop unless profiling proves more.
  • Use fog and haze to separate depth planes, not merely darken the scene. Keep the focal landmark inside the contrast window.
  • Match emissive geometry, glow sprites, actual light intensity, and bloom threshold so lamps feel luminous without bleaching the frame.
  • Use post-processing after the unprocessed frame is composed. Bloom, vignette, grain, chromatic separation, and depth of field must not hide weak materials or framing.

Record the detailed surface and light plan in the ledgers from references/world-bible.md.

Map native scroll to deterministic state

Measure stable section anchors only after fonts and critical media settle. Convert scrollY into a fractional chapter value such as 2.35.

Keep separate values:

rig.target = progressFromScroll(scrollY);       // exact reproducible story state
rig.smooth = reduceMotion
  ? rig.target
  : damp(rig.smooth, rig.target, 5.2, dt);      // cinematic render state

Use exact progress for navigation, URLs, accessibility, foreground ownership, and interaction gating. Use smoothed progress for camera and visual interpolation only. The same scroll position must recreate the same state forward, backward, after a fast jump, and after reload.

Use references/scroll-conductor.js as the baseline implementation. Keep native scroll as the source of truth; never integrate wheel delta into story position.

Author the camera as cinematography

Compose every chapter endpoint at desktop and mobile before interpolating.

  • Store position, target, FOV, optional roll, lens shift, and responsive overrides.
  • Use Catmull–Rom curves for broad continuous travel and segment interpolation for deliberate turns.
  • Inspect the curve for wall penetration, ground clipping, target flips, speed spikes, and accidental close passes.
  • Parameterize by chapter progress, not raw curve arc length, so story pacing remains intentional.
  • Use scrollWeight to give important views more dwell; do not distort the camera path just to slow a section.
  • Add restrained pointer parallax only after the base composition works. Clamp it and blend it out near precise transitions.
  • On tall viewports, author a pullback/FOV override instead of accepting an arbitrary center crop.

Camera motion must expose new spatial relationships: approach, reveal, passage, scale change, inspection, horizon, departure. Six dolly-ins aimed at the same center are not six scenes.

Interpolate world state from the same conductor

Resolve the adjacent chapters once per frame and interpolate their declared values:

const { a, b, t } = segmentState(rig.smooth);
moon.scale.setScalar(lerp(a.world.moon, b.world.moon, t));
key.intensity = lerp(a.world.key, b.world.key, t);
scene.fog.density = lerp(a.world.fog, b.world.fog, t);

Prefer continuous physical change: occlusion, material blend, animation mixer weight, light, fog, scale, and transform. When swapping assets, crossfade only within an occluded or atmospherically dense interval and keep both states loaded until the transition completes.

Add interactions without fighting scroll

Scroll owns macro movement. Pointer, touch, and keyboard interactions own local response.

  • Use raycasting against named proxy meshes, not every decorative triangle.
  • Define idle, hover, focused, active, and unavailable states for each interactive object.
  • Let hover warm light, shift material response, reveal a label, or trigger a short animation; do not move the scroll camera away from its path.
  • Pause or soften pointer parallax while the user drags a control or activates a hotspot.
  • Gate interactions by exact chapter visibility and depth; hidden objects must not capture events.
  • Mirror every essential hotspot with a DOM button or link in document order. Give it a visible focus state and synchronize its state with the 3D object.
  • On touch, use tap-to-focus then tap-to-activate when accidental activation would be costly. Keep hit targets at least 44 CSS px in the DOM proxy.
  • Make decorative particle trails and cursor effects optional, camera-relative where appropriate, and disabled for coarse pointers or reduced motion.

Write the interaction matrix before implementation; use the pattern in references/world-bible.md.

Keep the DOM story semantic

Keep headings, body copy, links, controls, and the footer in real HTML above or beside the canvas. The 3D world creates place; the DOM carries meaning and fallback order.

  • Reveal display headings by word only when it supports the rhythm; preserve the complete accessible label.
  • Reveal eyebrow, heading, body, media, proof, and CTA as independent beats.
  • Keep the reading block stable while the camera makes its largest move.
  • Use optional fixed alpha cut-outs as near-plane scenery, not as a requirement of every design. When used, keep them fully opaque while active and fade/blur them out after ownership changes.

Load progressively

Make the first authored frame complete before loading the entire journey.

  1. Inline or preload the critical shell, camera, first-scene geometry, smallest environment, and fallback poster.
  2. Load the next chapter before it can enter; prefetch one or two chapters ahead.
  3. Decode textures off the main interaction path and reveal a chapter only when its required assets are ready.
  4. Keep a designed poster and semantic DOM visible if WebGL, a model, or a texture fails.
  5. Report meaningful progress by required asset weight or completed groups, not an arbitrary timer.

Do not hide a 40 MB world behind a decorative percentage. Record the load plan in the asset ledger.

Hold a measurable performance budget

Start with these budgets, then profile on the actual target device:

budget mobile target desktop target
DPR cap 1.25–1.5 1.5–2
visible triangles 150k–300k 500k–1.2m
draw calls 50–90 90–160
shadowed lights 1–2 2–4
simultaneously blended full-screen layers 2 3
critical initial transfer 3–6 MB 5–10 MB
steady frame time ≤16.7 ms ideal, ≤25 ms fallback ≤16.7 ms

These are starting envelopes, not success claims. Measure CPU, GPU, texture memory, shader compilation, long tasks, and first-interactive frame.

  • Cap dt near 1/30 second after stalls.
  • Pause on document.hidden and when the experience is not visible.
  • Use a quality governor that lowers DPR and optional effects before deleting authored landmarks.
  • Render secondary cameras, reflections, cloth simulations, and expensive particles only while relevant.
  • Dispose geometries, materials, textures, render targets, observers, events, animation mixers, and RAF during teardown.

Respect motion, access, and failure

  • Preserve native reversible scroll; do not trap the wheel or force a custom scrollbar.
  • For reduced motion, snap camera/state to the nearest composed chapter, stop ambient loops and stagger/blur, and retain the complete ordered DOM story.
  • Keep a real heading hierarchy, landmarks, links, form controls, visible focus, and reachable footer.
  • Provide a composed poster or chapter stills when WebGL is unavailable.
  • Maintain contrast when the world changes behind copy; use authored scrims or local contrast management, not an opaque blanket over the whole scene.

Verify the whole journey

Follow references/quality-and-qa.md. At minimum verify:

  • every camera endpoint at 1440×900, 768×1024, and 390×844;
  • slow, fast, reverse, scrollbar-drag, anchor navigation, reload-at-depth, and resize between chapters;
  • material scale, UVs, texture color space, roughness response, contact grounding, shadow stability, fog depth, and post-processing;
  • hover, focus, tap, activation, chapter gating, and interaction recovery after scrolling away and back;
  • first-load poster, progressive chapter loading, failed asset, context loss, hidden-tab resume, and teardown;
  • reduced motion, WebGL fallback, keyboard order, readable DOM, reachable footer, and a clean console;
  • target-device frame time, draw calls, triangles, texture memory, transfer size, and shader compilation.

Use the Codex browser for visual and interaction verification. Build/DOM checks are not visual proof.

Deliver

Return:

  • the world bible and art-direction constants;
  • chapter, camera, material/texture, interaction, asset, and performance ledgers;
  • a layer and scene-graph map;
  • the working experience and local runtime assets;
  • desktop, tablet, and mobile evidence from representative chapters;
  • measured performance and loading results;
  • fallback/reduced-motion evidence;
  • remaining visual, interaction, or device gaps stated plainly.

Keep the bundled Kage demo unchanged unless the user explicitly asks to revise the reference itself.

1---
2name: build-threejs-scroll-worlds
3description: Build rich, scroll-controlled real-time Three.js experiences as one persistent 3D world whose camera, lighting, atmosphere, materials, objects, DOM story, and interactions evolve across authored chapters. Use for 3D scrollytelling, scroll-driven WebGL worlds, camera journeys, interactive portfolios, product stories, exhibitions, explainers, game or film microsites, spatial narratives, and multi-scene websites where native scroll should travel through one continuous place. Not limited to landing pages.
4---
5 
6# Build Three.js Scroll Worlds
7 
8Build one detailed real-time world and use native document scroll as its deterministic conductor. Keep the renderer, scene graph, and spatial continuity alive while camera composition, light, fog, animation, copy, and interaction focus move through authored chapters.
9 
10The mechanism is **one persistent Three.js world + one normalized reversible scroll state**. If removing either makes the experience collapse into stacked sections, this skill applies.
11 
12The exact [Kage demo](demo/index.html) proves the quality bar; it is staging, not a mandatory subject or layout. Use its detailed anatomy only when the requested direction benefits from it: [references/kage-anatomy.md](references/kage-anatomy.md).
13 
14## Route the request correctly
15 
16- Use `threejs` for a single interactive scene with no scroll-authored journey.
17- Use `scroll-world-storytelling` when deciding between real-time 3D, pre-rendered video, and DOM-first storytelling.
18- Use `scroll-scrubbed-visual-sequence` for a video or image sequence whose time is scrubbed by scroll.
19- Use `cinematic-scroll-storytelling` for DOM-first GSAP/Lenis choreography.
20- Use this skill when objects must remain truly spatial and interactive while scroll moves through several compositions in one live WebGL world.
21 
22Do not disguise a video as Three.js. The public [oso95/scroll-world](https://github.com/oso95/scroll-world) project, reviewed at commit `71cc36d`, is a strong reference for intake, scene ledgers, budget gates, mobile-specific composition, config-driven playback, and seam QA, but its renderer is a pre-generated video chain. This skill adopts those structural strengths while retaining real geometry, materials, lighting, raycasting, and camera control.
23 
24## Read the build references
25 
26Before implementing a new world, read:
27 
28- [references/world-bible.md](references/world-bible.md) for intake, art direction, scene, material, texture, and interaction ledgers;
29- [references/realtime-architecture.md](references/realtime-architecture.md) for the scene graph, conductor, camera, loading, interaction, and lifecycle patterns;
30- [references/quality-and-qa.md](references/quality-and-qa.md) before optimization and final verification.
31 
32Copy [references/scroll-conductor.js](references/scroll-conductor.js) when a project needs a portable native-scroll conductor rather than a framework-specific implementation.
33 
34## Start with the output, not the template
35 
36Determine what the world is for: a landing page, portfolio, museum chapter, product explanation, game teaser, editorial essay, data story, or another spatial experience. Do not force every request into a hero-plus-CTA layout.
37 
38Discover only what is unknown:
39 
40- the subject, audience, and ordered story beats;
41- the art direction and emotional arc;
42- whether the world is continuous, portal-connected, or composed as adjacent sets;
43- the target devices and minimum acceptable hardware;
44- how interactive the world should be beyond scrolling;
45- available models, textures, brand assets, audio, and copy;
46- the initial-load and total-download budget.
47 
48If the user supplied an approved reference or working scene, inspect it first and carry its real geometry, materials, textures, light ratios, camera values, and motion constants into the ledger. Do not replace measured details with adjectives.
49 
50## Write the world bible before code
51 
52Define one reusable visual grammar:
53 
54- scale system and unit convention;
55- silhouette language and level of stylization;
56- palette and per-chapter accent progression;
57- material families and wear logic;
58- key, fill, rim, practical, and emissive light roles;
59- fog, haze, particles, weather, and post-processing;
60- typography, DOM composition, and near-plane foreground rules;
61- motion grammar for camera, ambient objects, and interactions.
62 
63Every visible detail must support the same world. Random noise, unrelated texture packs, arbitrary particle effects, and one-off materials create complexity without cohesion.
64 
65## Author a scene ledger
66 
67Use 4–8 chapters for most experiences. Store the full contract as data rather than scattering thresholds through CSS and the render loop:
68 
69```js
70const chapters = [
71 {
72 id: "threshold",
73 scrollWeight: 1.25,
74 copy: {
75 eyebrow: "Chapter 01",
76 title: "Enter the archive",
77 body: "A spatial collection revealed through motion."
78 },
79 camera: {
80 position: [0, 3.8, 13.5],
81 target: [0, 2.4, -8],
82 fov: 38,
83 mobile: { position: [0, 4.8, 18], fov: 46 }
84 },
85 world: {
86 key: 1.0,
87 practicals: 0.35,
88 fog: 0.018,
89 particles: 0.25,
90 grade: "cold"
91 },
92 focus: ["gate", "lantern-left"],
93 interactions: ["inspect-gate"],
94 assets: ["gate-shell", "stone-1k", "mist-atlas"]
95 }
96];
97```
98 
99For each chapter record the story beat, landmark, camera endpoint, occluders, light/fog state, active animation clips, interaction targets, DOM beat, foreground treatment, asset dependencies, and responsive override. Reject a chapter that differs only by copy.
100 
101## Build one persistent spatial architecture
102 
103Create these systems once:
104 
105```text
106WebGL canvas
107 worldRoot
108 environment sky, terrain, distant silhouettes
109 architecture persistent landmarks and paths
110 chapterSets local props grouped for culling and loading
111 interactives raycast targets and animation state
112 atmosphere fog volumes, particles, weather
113 nearPlane3D optional camera-relative depth accents
114 
115DOM above canvas
116 semantic chapters headings, copy, links, media, fallback order
117 fixed interface progress, chapter navigation, controls
118 fixed cut-outs optional alpha foregrounds at viewport edges
119```
120 
121Use one renderer and normally one scene. Use layers or render passes when transparency, post-processing, or interaction isolation requires them. Do not instantiate one renderer per chapter or rebuild the world at seams.
122 
123Choose a topology deliberately:
124 
125- **Continuous geography:** landmarks share one navigable space; strongest presence, highest world-building cost.
126- **Connected sets:** rooms or islands are joined by tunnels, gates, fog banks, terrain folds, or darkness; easiest to art-direct and stream.
127- **Layered reveal:** the same place changes through time, scale, or state; animate materials, visibility, and light instead of moving to unrelated coordinates.
128 
129Hide unavoidable discontinuities behind occlusion, darkness, dense atmosphere, an interior threshold, or a close foreground pass. Never let an object visibly teleport in open space.
130 
131## Give the world real detail
132 
133### Geometry
134 
135- Establish the large silhouette first, then medium forms, then small accents. A dense scatter of tiny props cannot rescue a weak silhouette.
136- Give architectural edges believable thickness, bevels, joints, caps, reveals, and contact points. Paper-thin roofs and floating props expose the fake immediately.
137- Use modular kits, instancing, merged static meshes, and LODs instead of duplicating unique geometry.
138- Break repetition with authored clusters, scale/rotation ranges, decals, and material variation—not unbounded randomness.
139- Keep collision and raycast proxies simpler than render meshes.
140 
141### Materials and textures
142 
143Use a coherent PBR surface stack where it improves the image:
144 
145| map | role | common failure |
146| --- | --- | --- |
147| base color | material identity and broad variation | baked highlights fight live lighting |
148| normal | small directional relief | strength too high makes rubber or foil |
149| roughness | controls highlight breakup and age | flat values make every object plastic |
150| AO | contact and crevice grounding | multiplied too heavily makes dirty seams |
151| metalness | separates conductors from dielectrics | gray values everywhere create implausible mud |
152| emissive | practical lights, screens, runes | replaces light but does not illuminate nearby forms |
153| alpha/transmission | foliage, cloth, glass, mist | sorting, overdraw, and depth artifacts |
154 
155- Set color textures to sRGB and keep normal, roughness, AO, metalness, and data textures linear.
156- Keep texel density consistent within a camera range. Reserve 2K–4K maps for surfaces that genuinely fill the frame; use 512–1K atlases for most props.
157- Prefer KTX2/Basis compression, Meshopt/Draco geometry compression, atlases, trim sheets, decals, and baked AO/light where appropriate.
158- Add anisotropy only to shallow-angle surfaces that need it. Setting every texture to the maximum wastes bandwidth.
159- Make wear causal: exposed edges polish, recesses collect grime, water leaves vertical or pooling traces, and paths compress vegetation. Uniform grunge reads as a filter.
160- For foliage, use alpha-tested cards or instanced low-poly clusters before transparent blended planes. Transparency overdraw is often more expensive than geometry.
161 
162### Lighting and atmosphere
163 
164- Start with one authored key direction, a restrained environment/fill, and practical emissive sources. Add lights only when they create a visible relationship.
165- Bake static bounce and contact where possible. Keep shadow-casting dynamic lights to roughly 1–2 on mobile and 2–4 on desktop unless profiling proves more.
166- Use fog and haze to separate depth planes, not merely darken the scene. Keep the focal landmark inside the contrast window.
167- Match emissive geometry, glow sprites, actual light intensity, and bloom threshold so lamps feel luminous without bleaching the frame.
168- Use post-processing after the unprocessed frame is composed. Bloom, vignette, grain, chromatic separation, and depth of field must not hide weak materials or framing.
169 
170Record the detailed surface and light plan in the ledgers from [references/world-bible.md](references/world-bible.md).
171 
172## Map native scroll to deterministic state
173 
174Measure stable section anchors only after fonts and critical media settle. Convert `scrollY` into a fractional chapter value such as `2.35`.
175 
176Keep separate values:
177 
178```js
179rig.target = progressFromScroll(scrollY); // exact reproducible story state
180rig.smooth = reduceMotion
181 ? rig.target
182 : damp(rig.smooth, rig.target, 5.2, dt); // cinematic render state
183```
184 
185Use exact progress for navigation, URLs, accessibility, foreground ownership, and interaction gating. Use smoothed progress for camera and visual interpolation only. The same scroll position must recreate the same state forward, backward, after a fast jump, and after reload.
186 
187Use [references/scroll-conductor.js](references/scroll-conductor.js) as the baseline implementation. Keep native scroll as the source of truth; never integrate wheel delta into story position.
188 
189## Author the camera as cinematography
190 
191Compose every chapter endpoint at desktop and mobile before interpolating.
192 
193- Store position, target, FOV, optional roll, lens shift, and responsive overrides.
194- Use Catmull–Rom curves for broad continuous travel and segment interpolation for deliberate turns.
195- Inspect the curve for wall penetration, ground clipping, target flips, speed spikes, and accidental close passes.
196- Parameterize by chapter progress, not raw curve arc length, so story pacing remains intentional.
197- Use `scrollWeight` to give important views more dwell; do not distort the camera path just to slow a section.
198- Add restrained pointer parallax only after the base composition works. Clamp it and blend it out near precise transitions.
199- On tall viewports, author a pullback/FOV override instead of accepting an arbitrary center crop.
200 
201Camera motion must expose new spatial relationships: approach, reveal, passage, scale change, inspection, horizon, departure. Six dolly-ins aimed at the same center are not six scenes.
202 
203## Interpolate world state from the same conductor
204 
205Resolve the adjacent chapters once per frame and interpolate their declared values:
206 
207```js
208const { a, b, t } = segmentState(rig.smooth);
209moon.scale.setScalar(lerp(a.world.moon, b.world.moon, t));
210key.intensity = lerp(a.world.key, b.world.key, t);
211scene.fog.density = lerp(a.world.fog, b.world.fog, t);
212```
213 
214Prefer continuous physical change: occlusion, material blend, animation mixer weight, light, fog, scale, and transform. When swapping assets, crossfade only within an occluded or atmospherically dense interval and keep both states loaded until the transition completes.
215 
216## Add interactions without fighting scroll
217 
218Scroll owns macro movement. Pointer, touch, and keyboard interactions own local response.
219 
220- Use raycasting against named proxy meshes, not every decorative triangle.
221- Define `idle`, `hover`, `focused`, `active`, and `unavailable` states for each interactive object.
222- Let hover warm light, shift material response, reveal a label, or trigger a short animation; do not move the scroll camera away from its path.
223- Pause or soften pointer parallax while the user drags a control or activates a hotspot.
224- Gate interactions by exact chapter visibility and depth; hidden objects must not capture events.
225- Mirror every essential hotspot with a DOM button or link in document order. Give it a visible focus state and synchronize its state with the 3D object.
226- On touch, use tap-to-focus then tap-to-activate when accidental activation would be costly. Keep hit targets at least 44 CSS px in the DOM proxy.
227- Make decorative particle trails and cursor effects optional, camera-relative where appropriate, and disabled for coarse pointers or reduced motion.
228 
229Write the interaction matrix before implementation; use the pattern in [references/world-bible.md](references/world-bible.md).
230 
231## Keep the DOM story semantic
232 
233Keep headings, body copy, links, controls, and the footer in real HTML above or beside the canvas. The 3D world creates place; the DOM carries meaning and fallback order.
234 
235- Reveal display headings by word only when it supports the rhythm; preserve the complete accessible label.
236- Reveal eyebrow, heading, body, media, proof, and CTA as independent beats.
237- Keep the reading block stable while the camera makes its largest move.
238- Use optional fixed alpha cut-outs as near-plane scenery, not as a requirement of every design. When used, keep them fully opaque while active and fade/blur them out after ownership changes.
239 
240## Load progressively
241 
242Make the first authored frame complete before loading the entire journey.
243 
2441. Inline or preload the critical shell, camera, first-scene geometry, smallest environment, and fallback poster.
2452. Load the next chapter before it can enter; prefetch one or two chapters ahead.
2463. Decode textures off the main interaction path and reveal a chapter only when its required assets are ready.
2474. Keep a designed poster and semantic DOM visible if WebGL, a model, or a texture fails.
2485. Report meaningful progress by required asset weight or completed groups, not an arbitrary timer.
249 
250Do not hide a 40 MB world behind a decorative percentage. Record the load plan in the asset ledger.
251 
252## Hold a measurable performance budget
253 
254Start with these budgets, then profile on the actual target device:
255 
256| budget | mobile target | desktop target |
257| --- | ---: | ---: |
258| DPR cap | 1.25–1.5 | 1.5–2 |
259| visible triangles | 150k–300k | 500k–1.2m |
260| draw calls | 50–90 | 90–160 |
261| shadowed lights | 1–2 | 2–4 |
262| simultaneously blended full-screen layers | 2 | 3 |
263| critical initial transfer | 3–6 MB | 5–10 MB |
264| steady frame time | ≤16.7 ms ideal, ≤25 ms fallback | ≤16.7 ms |
265 
266These are starting envelopes, not success claims. Measure CPU, GPU, texture memory, shader compilation, long tasks, and first-interactive frame.
267 
268- Cap `dt` near `1/30` second after stalls.
269- Pause on `document.hidden` and when the experience is not visible.
270- Use a quality governor that lowers DPR and optional effects before deleting authored landmarks.
271- Render secondary cameras, reflections, cloth simulations, and expensive particles only while relevant.
272- Dispose geometries, materials, textures, render targets, observers, events, animation mixers, and RAF during teardown.
273 
274## Respect motion, access, and failure
275 
276- Preserve native reversible scroll; do not trap the wheel or force a custom scrollbar.
277- For reduced motion, snap camera/state to the nearest composed chapter, stop ambient loops and stagger/blur, and retain the complete ordered DOM story.
278- Keep a real heading hierarchy, landmarks, links, form controls, visible focus, and reachable footer.
279- Provide a composed poster or chapter stills when WebGL is unavailable.
280- Maintain contrast when the world changes behind copy; use authored scrims or local contrast management, not an opaque blanket over the whole scene.
281 
282## Verify the whole journey
283 
284Follow [references/quality-and-qa.md](references/quality-and-qa.md). At minimum verify:
285 
286- every camera endpoint at 1440×900, 768×1024, and 390×844;
287- slow, fast, reverse, scrollbar-drag, anchor navigation, reload-at-depth, and resize between chapters;
288- material scale, UVs, texture color space, roughness response, contact grounding, shadow stability, fog depth, and post-processing;
289- hover, focus, tap, activation, chapter gating, and interaction recovery after scrolling away and back;
290- first-load poster, progressive chapter loading, failed asset, context loss, hidden-tab resume, and teardown;
291- reduced motion, WebGL fallback, keyboard order, readable DOM, reachable footer, and a clean console;
292- target-device frame time, draw calls, triangles, texture memory, transfer size, and shader compilation.
293 
294Use the Codex browser for visual and interaction verification. Build/DOM checks are not visual proof.
295 
296## Deliver
297 
298Return:
299 
300- the world bible and art-direction constants;
301- chapter, camera, material/texture, interaction, asset, and performance ledgers;
302- a layer and scene-graph map;
303- the working experience and local runtime assets;
304- desktop, tablet, and mobile evidence from representative chapters;
305- measured performance and loading results;
306- fallback/reduced-motion evidence;
307- remaining visual, interaction, or device gaps stated plainly.
308 
309Keep the bundled Kage demo unchanged unless the user explicitly asks to revise the reference itself.
310 
View all files on GitHub →

Details

Updated
Sep 23, 2026
License
MIT
Stars on the repo
★ 6,243
Checked
Source
MengTo/Skills ↗
Creator
MengTo · 6 listings
View creator

Similar skills

See all →
PromptCreate a clear, 45° top-down isometric miniature 3D“How It Works” Educational Dioramasf/prompts.chat · by Huss-AlamodiCreate a clear, 45° top-down isometric miniature 3D educational diorama explaining [PROCESS / CONCEPT].New listingSkill3D game development principles3D gamesdavila7/claude-code-templates · by davila73D game development principles. Rendering, shaders, physics, cameras.★ 32.3k GitHub starsSkillExpert in building 3D experiences for the web3D web experiencedavila7/claude-code-templates · by davila7Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences. Use when: 3D website, three.js, WebGL, react three fiber, 3D experience.★ 32.3k GitHub starsSkillConnect to Pascal and use its MCP tools to create, inspectPascal 3Dpascalorg/editor · by pascalorgConnect to Pascal and use its MCP tools to create, inspect, edit, validate, save, or hand off editable 3D building scenes. Use this skill whenever a user asks an agent to work in Pascal, make a room or building model, inspect a Pascal project, perform spatial edits, connect Pascal MCP, or return a verified Pascal editor link. It also governs safe local, existing-account, and explicitly authorized autonomous setup.★ 24.6k GitHub starsSkillBuild crafted, highly detailedAnatomywheresryan22/anatomy · by wheresryan22Build crafted, highly detailed, interactive isometric SVG figures that explain a technical idea as a real physical object (a test rig, a dial gauge, a cabinet of drawers, a plotter, a lock), with many small precise solid parts, four-tone shading, correct painter's order, a framed card with title, hint and live readout, and calm eased motion. Use this whenever someone wants an isometric illustration, an explanatory diagram or figure for docs, a blog post, a landing page or an article, a "Linear-style" or "premium" technical drawing, an interactive explainer, or an SVG that shows how a system, algorithm or component works, even if they never say "isometric". Works framework-free (TypeScript/JS that writes SVG and HTML) and in React/Next.js, and can add realistic WebGL shaders (fire, exhaust, water, caustics, lamp light) that live inside the drawing in the same isometric perspective. Also prints a figure as an A4 PDF (poster, drawing or handout) and publishes it to the Anatomy community gallery when asked.★ 16k GitHub starsSkillBuild an immersive scroll-scrubbed fly through the worldScroll worldoso95/scroll-world · by oso95Build an immersive scroll-scrubbed "fly through the world" landing page for any industry or brand using Higgsfield. As the visitor scrolls, a pre-rendered camera flies from outside each scene into its interior, then flows on to the next scene with NO cuts — one continuous connected flight (Emons-style isometric diorama world, or any art direction you pick). The skill interviews the user for the topic, the story beats/sections, and brand kit, then generates cohesive scenes + seamless camera clips with Higgsfield and wires a portable, framework-agnostic scroll-scrub engine. The video chain renders through Monid by default (Seedance 2.0, pay-per-clip USD — capability re-checked each build, see Step 4) with Higgsfield credits as the fallback biller. Use when the user wants a "3D world" / browse-through-the-industry" hero, a scroll cinematic, a diorama landing, or to turn a business into a scrollable world.★ 9.8k GitHub stars

More from MengTo

SkillApply subtle gradient-border treatments for premium webBorder GradientsMengTo/Skills · by MengToApply subtle gradient-border treatments for premium web surfaces. Use when cards, pricing panels, nav bars, modals, buttons, or hero surfaces need a refined edge highlight without a loud glow.★ 6.2k GitHub starsSkillBuild, fix and review character combat animations so theyGame dev: combat animationMengTo/Skills · by MengToBuild, fix and review character combat animations (melee strikes, bow shots, spell casts, skills, monster attacks, whole move sets) so they read like Diablo IV, Baldur's Gate 3 or Elden Ring and never stretch, lock, wring or break an arm, wrist or hand. A written standard with numbered rules, per-frame tests on the real skinned mesh, keys designed from upper-arm, forearm and blade intents, checks from every camera the player sees, two blind critics plus a blind A/B against the last release, and every critic claim verified against full-resolution frames and live-rig numbers. Use when creating or reworking any attack, skill or move set; when the user says arms, hands, wrists, elbows or weapons look stretched, weird, broken or wrong; when they ask for a standard, rules or tests for animations; or when they ask to score animations or get them to N out of 10.★ 6.2k GitHub starsSkillScore a game's combat skills and spells out of 10 with blindGame dev: combat skill polishMengTo/Skills · by MengToScore a game's combat skills and spells out of 10 with blind judges, then raise the weakest to a bar, for timing and readability (does a skill read as itself, does the blow land when it lands) and for art (detail, light, trails, impact, art direction, judged against a reference such as Diablo IV). Covers filming casts on a stopped, stepped clock, contact strips and close-ups, anonymised two-judge rounds, the levers that moved scores (hero props made from a painted concept with image-to-3D, own schedules and keyed moves, painted additive textures, camera-facing ribbons, light outside the body), the traps that cost points, asset and load budgets, and shipping each skill as its own version. Use when the user asks to score, review, improve, polish or rebuild combat skills, spells or attacks; says a skill "doesn't make sense", "looks bad" or should look like another game; names a target score; or starts a "next skill" thread. Project specifics (review hooks, harness settings, where each skill's code lives, scores so far) go in an optional local references/<project>.md next to this skill.★ 6.2k GitHub starsSkillBuild a cursor trail whose spacing stays constant at anyPointer trail emitterMengTo/Skills · by MengToBuild a cursor trail whose spacing stays constant at any hand speed, by emitting motes per unit of distance travelled rather than on a timer, so a flick draws the same continuous ribbon as a crawl instead of breaking into scattered dots. Covers sub-segment placement, the ring-buffer ordering trap, the idle breath a distance emitter needs, anchoring the trail to the screen in a 3-D scene, scaling scatter against the plane it hangs on, coasting instead of stopping dead, touch and reduced-motion fallbacks, and why moving the emitter to a DOM overlay to raise its z-index costs more than it buys. Use for cursor wisps, pointer sparks, embers, magic trails, comet tails, plankton, dust, or any mote trail that must stay legible however fast the hand moves.★ 6.2k GitHub starsSkillTurn an article, case study, brand narrativeScroll world storytellingMengTo/Skills · by MengToTurn an article, case study, brand narrative, product journey, or long-form story into a cinematic scroll-driven landing page using one of three renderers: scrubbed video, a real-time Three.js world, or semantic HTML/SVG data and typography. Use when the user asks for a scroll world, fly-through landing page, article-to-website transformation, animated planet, data scrollytelling, video-scrubbed page, connected visual journey, or story-led alternative to ordinary stacked sections.★ 6.2k GitHub stars