threejs-ambient-contact-shading

threejs-ambient-contact-shading is a skill for Codex from linegel/threejs-complete-set-of-skill. It costs 52 tokens per session (1,808 once invoked), scanned A, original, ISC.

Technical guidance for adding ambient occlusion to Three.js r185 WebGPU scenes. Ambient occlusion is a shading effect that darkens areas where indirect light is blocked, making nearby surfaces appear grounded.

In plain words
What is it for?
Deciding between authored material data, dynamic screen-space ambient occlusion, depth and normal passes, temporal reconstruction, bent normals, and omitting the effect when its cost or quality is unsuitable.
Why use it?
It helps choose an appropriate way to represent contact shading while preserving direct light, emission, and the final tone-mapped image.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: $skill-name invocation.

Good fit Deciding between authored material data, dynamic screen-space ambient occlusion, depth and normal passes, temporal reconstruction, bent normals, and omitting the effect when its cost or quality is unsuitable.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/linegel/threejs-complete-set-of-skill/threejs-ambient-contact-shading
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add linegel/threejs-complete-set-of-skill --skill threejs-ambient-contact-shading
Clone the repo
git clone --depth 1 https://github.com/linegel/threejs-complete-set-of-skill

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for threejs-ambient-contact-shading

README.md
[![agentmods](https://agentmods.dev/badge/skills/linegel/threejs-complete-set-of-skill/threejs-ambient-contact-shading/github.svg)](https://agentmods.dev/skills/linegel/threejs-complete-set-of-skill/threejs-ambient-contact-shading)
Your own site
<a href="https://agentmods.dev/skills/linegel/threejs-complete-set-of-skill/threejs-ambient-contact-shading"><img src="https://agentmods.dev/badge/skills/linegel/threejs-complete-set-of-skill/threejs-ambient-contact-shading/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for threejs-ambient-contact-shading

Your own site · 80×15
<a href="https://agentmods.dev/skills/linegel/threejs-complete-set-of-skill/threejs-ambient-contact-shading"><img src="https://agentmods.dev/badge/skills/linegel/threejs-complete-set-of-skill/threejs-ambient-contact-shading.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,808 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.01808
Opus 5 $0.00026 $0.00904
Sonnet 5 $0.00010 $0.00362
Haiku 4.5 $0.00005 $0.00181

Measured 12d ago against content hash 3918c3ab890f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

threejs-ambient-contact-shading scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/threejs-ambient-contact-shading/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ambient Contact Shading

AO is visibility of indirect illumination. It may attenuate indirect diffuse and environment/specular response. Direct light, emission, UI, and the tone-mapped frame remain invariant.

$threejs-choose-skills is an optional multi-system coordinator. Use $threejs-image-pipeline when AO shares depth, normals, velocity, history, or final-output ownership.

1. Choose the ambient-visibility branch

Use the first branch whose gate passes:

Gate Branch Consequence
Required occlusion is static/local and can be authored in assets material aoMap / aoNode One forward render; no dynamic inter-object contact.
Dynamic screen contact is required and the renderer exposes indirect lighting separately apply GTAO visibility to that term One geometry pass can remain possible.
Stock forward NodeMaterial needs dynamic contact and the complete marginal cost passes depth/normal pass -> GTAO -> optional reconstruction -> second lit pass with builtinAOContext() Correct placement costs two scene traversals.
No previous branch meets its quality and cost gates omit screen AO Preserve materials, direct shadows, and silhouette readability.

r185 GTAONode needs current depth/normal before AO exists, while builtinAOContext() must be present during material lighting. Treat the first pass as a full material/deformation/alpha-tested scene pass unless a parity- proven depth/normal-only pass replaces it.

Complete when: the chosen branch names the indirect-light owner and either charges every added pass/attachment or records screen AO as omitted.

2. Fix the input contract

  • Initialize the renderer and require a WebGPU backend before graph creation. Stock r185 GTAO is gated to standard depth; a custom reversed-depth adapter must prove sky classification, reconstruction, and occluder ordering.
  • Define opaque occluders, opaque receivers, alpha coverage, and one transparent policy: no screen AO, authored material AO, or a validated custom lighting model. Stock builtinAOContext() skips transparent materials.
  • Bind AO to the active view's screenUV, drawing-buffer dimensions, and projection. Keep width and height independent for non-square/asymmetric views.
  • Choose depth-reconstructed normals for reduced raw AO only when edge fixtures and target timing pass. Choose an MRT normal when it is shared, reconstruction is materialized, smooth/thin geometry fails, or its measured attachment delta is cheaper.
  • Express physical contact radii in world units: radiusRender = radiusMeters * renderUnitsPerMeter, with the same conversion for dimensioned thickness and bias. An authored-look branch instead declares scene-unit-only controls and revalidates them after asset/world scaling.

Read the full file on GitHub · 162 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 162 lines · 52 tokens per session scan A 3918c3ab890f

Subscribe to this mod's changes

threejs-ambient-contact-shading is a skill published in the GitHub repository linegel/threejs-complete-set-of-skill (6 stars, last pushed 1mo ago), licensed ISC. It adds 52 tokens to every session and 1,808 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.