threejs-screen-space-ambient-occlusion
Skill1.1k starsChanged 6 days agoMITView on GitHub
Implement a production GTAO path in Three.js. Use for native WebGPU/TSL GTAONode wired through builtinAOContext, half-resolution horizon sampling, reversed-depth reconstruction, bent-normal encoding, full-resolution bilateral reconstruction, masking sky and water to prevent horizon barcodes, contact grounding, and halo diagnosis.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- jorgeasaurus/agent-skillsedited, first seen May 11, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- jorgeasaurus/agent-skills★ 1432% 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-shadow-systemsSkill
- 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
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Verify in AO-only, horizon-grazing, and moving-camera views for zero halos, zero grain, and zero horizon barcodes.
- Very specific: line 20
Read references/tsl-gtao-and-horizon-safety.md for the native WebGPU/TSL GTAONode + builtinAOContext setup, horizon-barcode prevention, …
- Distinctive: line 22
Read references/gtao-bent-normal-pipeline.md for the custom half-resolution horizon-sampling math, bent-normal heuristic validation, …
≈ “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
Screen-Space Ambient Occlusion
AO estimates local ambient contact visibility. It must modulate indirect lighting only — never direct sun, practical lights, sky, water, or emissive surfaces.
Workflow
- Enable reversed depth (
reversedDepthBuffer: trueonWebGPURenderer) and verify linear depth and view-space normals. - Exclude sky, water, and emissive surfaces from AO from day one, and fade AO smoothly to
1.0before far depth quantizes. - Choose the integration tier:
- Native WebGPU/TSL (preferred): opaque depth +
normalViewpre-pass →GTAONode(ao()) →scenePass.contextNode = builtinAOContext(...)modulating indirect/ambient light directly. - Custom half-res + bent normals: custom horizon gather, bent-normal encoding, 8-neighbour bilateral upsample, and indirect-only composite.
- Native WebGPU/TSL (preferred): opaque depth +
- Size
radiusandthicknessin world metres to actual contact features (0.4–2.5 m) — never crank radius to fake room-scale GI. - Verify in AO-only, horizon-grazing, and moving-camera views for zero halos, zero grain, and zero horizon barcodes.
Read references/tsl-gtao-and-horizon-safety.md for the native WebGPU/TSL GTAONode + builtinAOContext setup, horizon-barcode prevention, world-scale sizing, and AO-vs-GI boundaries.
Read references/gtao-bent-normal-pipeline.md for the custom half-resolution horizon-sampling math, bent-normal heuristic validation, bilateral upsample kernel, and indirect-reconstruction composite.
Failure conditions
- direct light, sky, water, or emissive surfaces are darkened by AO;
- vertical dark "barcode" stripes appear near the horizon from unmasked or unfaded far depth;
- radius is specified only in pixels, or inflated to multi-metre values to fake missing GI;
- foreground silhouettes cast thick screen-space halos across depth discontinuities;
- half-resolution gather is grainy during camera motion because it lacks bilateral spatial denoising;
- bent normals are treated as ordinary geometric normals without verifying hemisphere sign;
- the implementation claims temporal accumulation even though the path has none.
Routing boundary
This skill owns small-scale contact GTAO, bent normals, bilateral denoising, horizon-safe distance fading, and indirect-only AO application. Use $threejs-lighting-and-gi for room/alcove-scale occluded indirect light (LightProbeGrid) and reflections; $threejs-spectral-ocean for water-side horizon barcode checks; $threejs-temporal-stability for motion-grain audits; and $threejs-image-pipeline only when depth/normal buffers or pass order must be coordinated across multiple image-space systems.
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.

