$npx -y skills add scottstts/Threejs-Awesome-Graphics-Agent-Skills --skill threejs-screen-space-ambient-occlusionImplement a production GTAO path in Three.js. Use for half-resolution horizon sampling, reversed-depth reconstruction, bent-normal encoding, full-resolution bilateral reconstruction, environment-light application, contact grounding, and halo diagnosis.
| 1 | # Screen-Space Ambient Occlusion |
| 2 | |
| 3 | AO estimates missing ambient visibility. It must modulate indirect lighting, not repaint all scene color with a dark multiply. |
| 4 | |
| 5 | ## Workflow |
| 6 | |
| 7 | 1. Verify linear depth and view-space normals. |
| 8 | 2. Reconstruct view position consistently. |
| 9 | 3. Sample horizon visibility in a controlled radius. |
| 10 | 4. Estimate AO and optional bent normal. |
| 11 | 5. Denoise with depth/normal-aware filters. |
| 12 | 6. Apply to indirect diffuse and environment response. |
| 13 | |
| 14 | Read [references/gtao-bent-normal-pipeline.md](references/gtao-bent-normal-pipeline.md). |
| 15 | |
| 16 | ## Failure conditions |
| 17 | |
| 18 | - direct light and emission are darkened; |
| 19 | - radius is specified only in pixels; |
| 20 | - foreground silhouettes cast thick screen-space halos; |
| 21 | - depth discontinuities are blurred together; |
| 22 | - AO remains strong at distances where its world radius is subpixel; |
| 23 | - bent normals are treated as ordinary geometric normals; |
| 24 | - the implementation claims temporal accumulation even though this path has none. |
| 25 | |
| 26 | ## Routing boundary |
| 27 | |
| 28 | This skill owns GTAO gathering, bent normals, denoising, and AO application. |
| 29 | Use `$threejs-image-pipeline` only when its depth/normal buffers or pass order |
| 30 | must be coordinated with other image-space systems. |