webgl-scroll-site
Skill1 starsChanged 3 months agoMITView on GitHub
Build immersive scroll-driven 3D websites with three.js, Vite, and a post-processing chain - the award-site genre where scrolling drives a cinematic camera through chapters of procedural 3D scenes. Covers the architecture spine (virtual scroll, world stages, camera director), a headless screenshot verification loop with numeric QA, a catalogue of measured three.js/EffectComposer failure modes (black frames, rainbow banding, missing terrain), art direction for a coherent look, and how to parallelise the build across subagents. Use when asked to build, clone, study, or debug a WebGL/three.js scroll experience, a 3D landing page, a scrollytelling site, or when a three.js scene renders black, blown out, or saturated.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architecture-reviewSkill
- debugSkill
- domain-modelingSkill
- handoffSkill
- implementation-planSkill
- requirements-reviewSkill
- test-and-verifySkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 80
Clamp additive shader terms: Keep sums <= 1.0. This is the single most common cause of a ruined frame.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
WebGL Scroll Site
Build a scroll-driven 3D website: a fixed canvas where scrolling advances a cinematic camera through several chapters of procedural three.js scenes, graded by a post-processing chain.
Core discipline: verify numerically, not visually. These sites fail in ways that look plausible in a screenshot and are obvious in a measurement — black frames, blown highlights, hue banding, geometry erased by fog. Build the measurement loop before you build the art.
Setup
bash <skill-dir>/scripts/scaffold.sh ~/path/to/my-siteCreates the project, copies the proven spine into src/core/, installs three +
vite, and sets up a Python venv with Playwright and Pillow for verification.
The untouched scaffold passes its own QA: npm run build && npm run preview,
then capture.py + check_frames.py should report app booted: True,
errors: 0, and every frame passing. Any failure after that point is yours,
which is what makes bisecting fast.
Workflow
- Recon (only when recreating an existing site). Modern WebGL sites ship an
empty
<body>— scraping HTML yields nothing. Mine the JS bundle for the stack and palette, then drive a headless browser and screenshot at scroll increments. The frames are the real spec. -> references/reconnaissance.md - Write the contract before any 3D code. Copy
CONTRACT.mdand fill in the chapters, palette, and measured value ranges. Everything downstream targets these numbers. ->assets/CONTRACT.template.md - Own the spine yourself.
src/core/{state,scroll,director,post}.jsis ~300 lines and holds all the coupling. DefineCHAPTERSinstate.jsandSTAGES/SHOTSindirector.js. -> references/architecture.md - Build one module per chapter. Each module owns exactly one file, builds around its local origin, and gates its own visibility. Parallelise across subagents if you have them. -> references/delegation.md
- Measure every change.
-> references/verification.mdnpm run build && npm run preview & .venv/bin/python capture.py http://localhost:4173/ shots 14 .venv/bin/python check_frames.py shots - Grade the look last. Exposure against measured background values, then albedos and lights, then post. -> references/art-direction.md
When something renders black or wrong
Go straight to references/gotchas.md. It catalogues measured failures with symptom, cause, fix, and the diagnostic that proves it. The five that cost the most time:
| Symptom | Cause |
| Entire frame black | MeshPhysicalMaterial.transmission > 0 with an EffectComposer |
| Entire frame black | UnrealBloomPass.resolution mutated directly on resize |
| Entire frame black | Post constructed before the renderer was sized |
| Magenta/cyan/gold banding | An additive shader term exceeding 1.0 past the ACES shoulder |
| Distant geometry missing | FogExp2 density far too high for the scene scale |
Hard rules
- Clamp additive shader terms. Keep sums <= 1.0. This is the single most common cause of a ruined frame.
- Never use
transmissionwith a composer. Fake glass/ice with envMap + clearcoat + fresnel. - Size the renderer before constructing post-processing.
- Treat any console error as a build failure — shader link errors do not always change the picture, but they mean a material silently died.
- Test once with no GPU flags.
--use-angle/--enable-unsafe-swiftshadercan mask a failure that a real browser will hit. - Original work only. Procedural geometry, original copy, original forms. When studying an existing site, recreate the technique — never rehost its assets, reproduce its copy, or clone branded characters.
Files
| Path | What |
assets/spine/ | Working state/scroll/director/post/main + project config |
assets/CONTRACT.template.md | Module contract to fill in per project |
scripts/scaffold.sh | Create a new project from the spine |
scripts/capture.py | Deterministic scroll screenshots via window.__site |
scripts/check_frames.py | Numeric QA: saturation, black, flat detection |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

