agentleFS
linegellinegel/threejs-complete-set-of-skill/skills/threejs-image-pipeline/SKILL.md

threejs-image-pipeline

Skill8 starsChanged 4 months agoISCView on GitHub

Coordinate Three.js WebGPU/TSL final-image graphs. Use when effects share scene-pass signals or output ownership, when choosing MRT versus reconstruction or narrow passes, when admitting temporal history, or when whole-graph budgets and lifetimes decide the design.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 9 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the atomic owner for each admitted effect:

    line 12
  2. Distinctive:

    Treat depth as the pass depth texture rather than an MRT color output.

    line 43
  3. Very specific:

    Keep the attachment when paired evidence shows costMRT(a) < costAlt(a) among the correct candidates and the peak resident budget still …

    line 61
  4. Very specific:

    When implementing pass(), MRT, compact formats, or depth branches, read Graph construction and signal formats.

    line 72
  5. Distinctive:

    When temporal reconstruction is present, read Temporal admission and resets before creating velocity or history nodes.

    line 102
  6. Very specific:

    When stock TRAANode is rebuilt for a supported reset, read the minimal rebuild example for its public-API validated replacement, …

    line 106
  7. Distinctive:

    Use this default order:

    line 115
  8. Distinctive:

    Keep history in stable pre-exposure scene radiance by default.

    line 132
  9. Distinctive:

    When choosing a LUT/output ending or handling transparent alpha, read Color, alpha, and legal endings.

    line 143
  10. Distinctive:

    Add adaptive DPR only after the fixed-DPR graph has sustained timings.

    line 156
  11. Distinctive:

    When estimating traffic, private target residency, marginal cost, or adaptive DPR, read Memory, timing, and adaptive resolution.

    line 164
  12. Distinctive:

    When a capture, timing scope, reset, output-isolation, or lifecycle control fails, read Diagnostics and failure signatures.

    line 178

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Image Pipeline

Build one causal image graph: one HDR scene pass with depth, selected shared signals, and one final output conversion. Add a scene traversal or attachment only when its measured alternative is worse.

Use the atomic owner for each admitted effect:

  • $threejs-ambient-contact-shading for GTAO and indirect-light composition;
  • $threejs-bloom for glare source selection and BloomNode controls;
  • $threejs-exposure-color-grading for metering, adaptation, tone mapping, and LUT domains;
  • $threejs-dynamic-surface-effects for feature-local screen history;
  • $threejs-visual-validation for capture, timing, and lifecycle evidence.

1. Fix the baseline

Declare physical canvas pixels, target browser/GPU, frame budget, primary visual contract, and a readable no-post view. Initialize one WebGPURenderer, confirm renderer.backend.isWebGPUBackend, create one RenderPipeline, and make one pass(scene, camera) own scene-linear HDR plus its depth texture. Set trackTimestamp before renderer.init() when GPU timing is requested.

This step is complete when the baseline renders without optional post, the HDR and depth producers are named, and exactly one component owns presentation.

2. Inventory signals

For every candidate signal—HDR color, depth, normal, emissive, velocity, diffuse/base color, IDs, histories, exposure, and UI—record:

writer | readers | mathematical/color domain | physical format and extent
first write -> last read | history/reset owner | disable path

Treat depth as the pass depth texture rather than an MRT color output. Request only signals with a real reader.

This step is complete when every graph edge has one writer, all consumers agree on domain and extent, and every optional signal has a working disable path.

3. Admit attachments

First reject any reconstruction, attachment, or narrow-rerender candidate that cannot meet the signal's declared domain, precision/error bound, spatial coverage, temporal stability, or discard semantics. Compare the remaining correct candidates on the target graph:

costMRT(a) = export + store/resolve + all later reads
costAlt(a) = reconstruction or narrow rerender + its traffic

Keep the attachment when paired evidence shows costMRT(a) < costAlt(a) among the correct candidates and the peak resident budget still passes. Inspect compiled physical formats: r185 named PassNode attachments clone the pass output by default, so compact normal or velocity storage exists only after explicit configuration and verification.

This step is complete when every retained attachment has a named reader, verified domain and physical format, declared error/coverage contract, measured winning correct alternative, and accounted peak bytes.

When implementing pass(), MRT, compact formats, or depth branches, read Graph construction and signal formats.

4. Admit temporal history

Enable temporal output only after all rendered motion has valid previous and current presentation state:

  • rigid transforms, instances, bones, and procedural deformation;
  • stable particle/slot identity where particles enter history;
  • unjittered previous/current camera transforms and one jitter owner;
  • depth, velocity, neighborhood, and out-of-bounds rejection;
  • resets for resize/DPR, cut, projection or origin change, scene load, spawn/despawn, teleport, reparent, LOD/topology change, and discontinuous deformation;
  • current, history, rejected-history, velocity, jitter, and reset diagnostics.

r185 velocity is currentNDC - previousNDC; TRAA converts it to UV with a negative Y scale. Stock TRAANode requires matching color/depth/velocity/input extents and MSAA off. Its ordinary branch cannot preserve an existing camera view offset or arbitrarily supplied texture owner. Admit first-frame and border behavior explicitly, rather than assuming resize logic proves both. A composite temporal input materializes another texture and fullscreen draw. Stock TRAA has no public general reset or reactive-mask input, so cuts and discontinuities require an evidenced rebuild or bypass/reseed policy.

This step is complete when horizontal and vertical motion reproject correctly, every rendered representation has a velocity policy, each discontinuity fires an executable reset, and every temporal allocation has an owner.

When temporal reconstruction is present, read Temporal admission and resets before creating velocity or history nodes.

When stock TRAANode is rebuilt for a supported reset, read the minimal rebuild example for its public-API validated replacement, public-setting retention, output rebind, guarded rollback, graph invalidation, and explicit old/new ownership. Retire the returned previous node only after the replacement graph has compiled/rendered successfully and the prior GPU generation has completed.

5. Compose once

Use this default order:

HDR scene pass + depth + admitted MRT
  -> effect-local lighting histories
  -> lighting/AO/atmosphere with valid temporal inputs
  -> temporal scene-radiance resolve, when admitted
  -> excluded transparent or refractive layers
  -> meter tap from resolved pre-bloom HDR, when admitted
  -> bloom and other scene-linear optical effects, when admitted
  -> fixed or adapted exposure, when admitted
  -> tone map, when admitted
  -> LUT in its declared domain, when admitted
  -> one output conversion
  -> display-domain AA, dither, diagnostics, and UI

Keep history in stable pre-exposure scene radiance by default. Apply the bloom owner's opaque, coverage-clipped, or halo-preserving alpha branch; unchanged source alpha does not preserve off-surface halos. If renderOutput() owns presentation, set renderPipeline.outputColorTransform = false; after any output-node change, set renderPipeline.needsUpdate = true.

This step is complete when every present meter, bloom, exposure, tone map, LUT, alpha operation, and output conversion has one owner, and every transparent/refractive layer has an explicit position.

When choosing a LUT/output ending or handling transparent alpha, read Color, alpha, and legal endings.

6. Own toggles, size, and lifetime

Count persistent private targets owned by built-in BloomNode, GTAONode, TRAANode, and PassNode. Rebuild the pass to reclaim an attachment previously requested with getTextureNode(); a logical MRT toggle does not reclaim it. On resize or DPR change, update every explicit extent and reseed all affected histories. Node/pipeline disposal is not recursive graph cleanup; retain explicit owned handles and restore borrowed state with try/finally on failed operations. Dispose removed nodes, passes, targets, materials, and storage after final GPU use.

Add adaptive DPR only after the fixed-DPR graph has sustained timings. Use asymmetric dwell and cooldown, distinguish fixed from pixel-scaled work, and remeasure every quality tier after a size change.

This step is complete when repeated cycles for every supported toggle, size, tier, and admitted resource stabilize resource counts, and every graph mutation marks the pipeline dirty.

When estimating traffic, private target residency, marginal cost, or adaptive DPR, read Memory, timing, and adaptive resolution.

7. Prove the graph

Capture the no-post baseline, each admitted signal, the diagnostics for each admitted temporal/meter/bloom/color branch, final output, and physical target inventory. Measure the complete warmed graph and paired marginal variants only for admitted alternatives at identical scene state. Exercise the applicable negative controls: disable each supported optional effect, force each reset class owned by an admitted history, resize admitted size-dependent resources, and destroy/recreate the graph.

When a capture, timing scope, reset, output-isolation, or lifecycle control fails, read Diagnostics and failure signatures.

The pipeline is complete when every supported shipping tier preserves the visual contract, the full graph and resident targets meet declared budgets, output isolation shows one output conversion and—when admitted—one tone map, diagnostics pass for every admitted temporal branch and axis, and lifecycle counts plateau after disposal.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.