threejs-shadow-systems
Skill1.1k starsChanged 4 days agoMITView on GitHub
Implement stable, scalable directional-shadow systems for Three.js. Use for large procedural worlds, city scenes, terrain, moving cameras, WebGPU/TSL shadow nodes, CSMShadowNode cascades, cached clipmaps, texel stabilization, tight depth-range bias and peter-panning fixes, static versus dynamic update budgets, matte test-plane isolation, and targeted invalidation.
2 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- iberi22/skillsedited, first seen Oct 15, 2026
- jorgeasaurus/agent-skillsedited, first seen May 11, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- jorgeasaurus/agent-skills★ 1442% same
- iberi22/skills★ 044% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- .codex/AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- threejs-atmosphere-aerial-perspectiveSkill
- threejs-bloomSkill
- threejs-camera-directionSkill
- threejs-exposure-color-gradingSkill
- threejs-image-pipelineSkill
- threejs-lighting-and-giSkill
- threejs-parallax-occlusion-mappingSkill
- threejs-precipitation-surfacesSkill
- threejs-procedural-animationSkill
- threejs-procedural-architectureSkill
- threejs-procedural-fieldsSkill
- threejs-procedural-geometrySkill
- threejs-procedural-materialsSkill
- threejs-procedural-planetsSkill
- threejs-procedural-vegetationSkill
- threejs-procedural-vfxSkill
- threejs-raymarched-space-effectsSkill
- threejs-reference-readingSkill
- threejs-screen-space-ambient-occlusionSkill
- threejs-skill-routerSkill
- threejs-spectral-oceanSkill
- threejs-temporal-stabilitySkill
- threejs-temporal-surfacesSkill
- threejs-terrain-and-landscapesSkill
- threejs-visual-validationSkill
- threejs-volumetric-cloudsSkill
- threejs-water-opticsSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use a single tightly fitted shadow map only when its receiver region is genuinely bounded.
- Very specific: line 15
Start bias at 0, raise normalBias scaled by world texel width to clear grazing acne, and confirm thin-post contacts and small-relief …
- Distinctive: line 17
Verify with a matte test plane, grazing stick shadows, slow pans, and near-to-far camera dollies.
- Very specific: line 19
Read references/shadow-cascades-bias-and-updates.md for tier selection, WebGPU CSMShadowNode setup, depth-range bias calibration, …
- Distinctive: line 21
Read references/cached-clipmap-shadows.md for custom concentric light-space cached clipmaps, committed-center state, update budgets, and …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Shadow Systems
Use a single tightly fitted shadow map only when its receiver region is genuinely bounded. For open scenes and large moving views, choose an explicit cascade or cached-clipmap hierarchy with tight depth ranges, world-texel-scaled bias, and per-frame dynamic caster updates.
Coverage and build workflow
- Choose the coverage tier: single tightly fitted map (compact bounded scene), built-in
CSMShadowNode(3–4cascades for open worlds), or custom cached clipmaps + long-range/baked terrain shadows (multi-kilometre streamed worlds). - Fit shadow-camera near/far tightly to actual casters so normalized depth bias never produces decimetres of peter-panning.
- Snap cascade/clipmap centers to each level's world-space texel grid and cross-fade adjacent levels cleanly.
- Start bias at
0, raisenormalBiasscaled by world texel width to clear grazing acne, and confirm thin-post contacts and small-relief casting (reliefDepth > texelWidth + bias). - Separate update policies: bake static architecture/terrain (
autoUpdate = false), update moving casters (wind-blown vegetation, characters, vehicles) every frame, and invalidate cached coarse levels spatially. - Verify with a matte test plane, grazing stick shadows, slow pans, and near-to-far camera dollies.
Read references/shadow-cascades-bias-and-updates.md for tier selection, WebGPU CSMShadowNode setup, depth-range bias calibration, small-relief casting thresholds, static vs dynamic update policies, and matte test-plane isolation.
Read references/cached-clipmap-shadows.md for custom concentric light-space cached clipmaps, committed-center state, update budgets, and targeted invalidation.
Read the cached shadow clipmaps for three light-space square levels, per-level texel snapping, containment cross-fades, cached coarse updates, scaled bias, and unshadowed outside weight.
Failure conditions
- projection centers move by fractions of a texel, causing swimming edges;
- shadow-camera depth range is left overly wide, turning small depth bias into peter-panning;
- small architectural or rock relief casts nothing because texel width plus bias exceeds relief depth;
- shader containment does not match the map's committed center;
- moving foliage, characters, or vehicles cast stepped every-N-frame or static proxy shadows;
- coarse levels freeze moving casters indefinitely without invalidation;
- depth texture samples occur in divergent fragment control flow;
- the same normal bias is used across radically different texel sizes;
- level boundaries become visible or shadows clip abruptly at mid-distance under camera motion;
- a fill light casts conflicting shadows alongside the primary sun.
Routing boundary
This skill owns light-space directional shadow coverage, cascades, clipmaps, bias, and caster update policies. Use $threejs-lighting-and-gi for sun direction coherence, sun-to-sky ratios, irradiance-probe GI, and reflections; $threejs-screen-space-ambient-occlusion for view-dependent contact AO (AO never replaces cast shadows); and $threejs-temporal-stability for general frame-to-frame motion audits.
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.

