fx
A module script.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2preseed/fx.module — the demo's post-process stack, fade and letterbox control. The chain is priority-ordered: scene passes (motion_blur 30, bloom 40, fog 45, color_correction 50, colorGrade 52, vignette 70, chromatic_aberration 75) then the always-on `demo_fade` pass (200) that applies the letterbox bars and the fade to a solid color. A part writes one table — `Fx.grade { bloom = …, fog = …, tonemap = … }` — and this module turns each key into the thing the engine actually carries: * `bloom` the demo's own wide glow pass (see GLOW below), not the shipped tight-gather preset. * `tonemap` the exposure and tone curve of the always-on `__display__` pass. There is no `tonemap` effect to register: the display pass is where a frame's exposure and curve live, so a part's `{ mode = "ACES", exposure = 1.18 }` is written there. * everything else — a shipped post shader at `@builtin::shaders.post.<name>`, added once and then retuned. A grade key that cannot be applied is logged and skipped. One bad key must never take the rest of a part's `enter()` with it: the sky, the render stack, the light rig and the IBL capture all run after the grade.
registered(name: string) → boolean
Whether a pass is standing in the chain right now. `active` alone is a claim about the past, and the cut boundary evicts every pass that is not the film's own — so a part re-entered after another part ran would find the flag set, skip the add, and write its values at a pass that is no longer there. Asking the chain is what keeps the two in step.
| arg | type | description |
|---|---|---|
| name | string |
init( ) → void
setFade(v: ?, col: ?) → void
| arg | type | description |
|---|---|---|
| v | ? | |
| col | ? |
setBars(v: ?) → void
| arg | type | description |
|---|---|---|
| v | ? |
resetDisplay( ) → void
`__display__` is registered by the engine and cannot be added or removed, so a part's `tonemap` key is a pair of writes rather than a pass. `tonemap = false` restores what a scene carrying no opinion gets.
applyTonemap(opts: ?) → void
| arg | type | description |
|---|---|---|
| opts | ? |
ensureGlow(opts: ?) → void
| arg | type | description |
|---|---|---|
| opts | ? |
shippedShader(name: string) → any
Each identity is spelled as a literal, one branch per name: that is what pins the shader as a dependency of this module so it travels with the world, and it is also the list of shipped effects the demo's grade vocabulary reaches. `pp.presets` names the whole shipped set; these six are the ones a part asks for by name.
| arg | type | description |
|---|---|---|
| name | string |
gradeValues(name: string, postShader: any, given: { [string]: any }) → void
The values to write after the pass is registered, worked out exactly the way `pp.add` does it: the preset's own mapping first (it answers for the friendly spellings a shader's schema does not carry, such as fog's `color`), then every declared property the caller named itself. Unlike `pp.add`, a key the shader does not declare is dropped with a warning rather than raised. A part's grade is authored intent in the demo's own spelling, and one stale key must not cost the part its whole look.
| arg | type | description |
|---|---|---|
| name | string | |
| postShader | any | |
| given | { [string]: any } |
ensurePreset(name: ?, opts: ?) → void
Add (or retune) one preset pass by name with override values.
| arg | type | description |
|---|---|---|
| name | ? | |
| opts | ? |
removePreset(name: ?) → void
| arg | type | description |
|---|---|---|
| name | ? |
setProperty(name: ?, prop: ?, value: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| prop | ? | |
| value | ? |
grade(spec: ?) → void
Apply a whole per-part grade: { bloom = {…} | false, tonemap = {…} | false, … }. Passes named `false` are removed; absent passes are left untouched. Each key is isolated. A part's grade runs first in its `enter()`, so a key that raises used to cost that part its sky, its lights and its render stack; now it costs that key alone and says so.
| arg | type | description |
|---|---|---|
| spec | ? |
teardown( ) → void
Every pass this module registered, and the display pass back to its default. `demo_fade` goes with them: `M.init` re-adds it.
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.