StyleRuntime
The per-machine half of styleKit, called by the styleStack render feature each frame: it keeps one post-process effect per stack entry, fills the shared inputs (clock, quality, surface data, ground, wobble, object mask) and enqueues the passes in slot order after antialiasing. Sc…
StyleRuntime (module)
The per-machine half of styleKit, called by the styleStack render feature each frame: it keeps one post-process effect per stack entry, fills the shared inputs (clock, quality, surface data, ground, wobble, object mask) and enqueues the passes in slot order after antialiasing. Scripts use StyleKit, not this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
listOf(kind: string) → void
Every lookup enumerates a literal asset type, which is what a published world records, rather than resolving a computed name.
| arg | type | description |
|---|---|---|
| kind | string |
findAsset(kind: string, suffix: string) → any
| arg | type | description |
|---|---|---|
| kind | string | |
| suffix | string |
shaderAt(path: string) → any
| arg | type | description |
|---|---|---|
| path | string |
setClock(fn: (() → void
Drive the stack's clock (seconds) from a function, or nil to return to the shared clock.
| arg | type | description |
|---|---|---|
| fn | (( |
sharedTime( ) → number
Wall-clock UTC in seconds with sub-second precision, the same on every machine whose clock is set right, or nil until it is known. `os.time()` gives whole UTC seconds; the moment it ticks over is caught against the engine's smooth real time, so from then on UTC is real time plus that offset, good to about a frame.
invalidateShaders( ) → void
Forget the shader index, so the next lookup reads the engine's list afresh (called when a block registers or is removed).
tier( ) → string
forceTier(tier: string?) → void
| arg | type | description |
|---|---|---|
| tier | string? |
start( ) → void
Feature lifecycle
noteCpu(ms: number) → void
| arg | type | description |
|---|---|---|
| ms | number |
shaderAt(path: string) → any
The shader asset at a VFS path, found by listing (no computed resolve).
| arg | type | description |
|---|---|---|
| path | string |
status( ) → void
timings( ) → void
freeTargets( ) → void
Targets and programs
targetsLost( ) → boolean
ensureTargets(ctx: any, tier: string) → void
| arg | type | description |
|---|---|---|
| ctx | any | |
| tier | string |
rt(name: string, fmt: string, space: string, scale: number) → any
| arg | type | description |
|---|---|---|
| name | string | |
| fmt | string | |
| space | string | |
| scale | number |
lazyTarget(name: string) → any
| arg | type | description |
|---|---|---|
| name | string |
ensurePrograms( ) → boolean
hexToRgb(s: string) → void
Effects: one per entry (and one per published field)
| arg | type | description |
|---|---|---|
| s | string |
toValue(v: any, kind: string?) → any
| arg | type | description |
|---|---|---|
| v | any | |
| kind | string? |
encode(v: any) → string
| arg | type | description |
|---|---|---|
| v | any |
bindShared(name: string, T: any, writes: string?) → void
A field pass must not read the target it writes (a texture cannot be a colour target and a sampled resource in one pass), so it reads a small dummy in place of its own field.
| arg | type | description |
|---|---|---|
| name | string | |
| T | any | |
| writes | string? |
ensureEffect(name: string, shaderPath: string) → boolean
| arg | type | description |
|---|---|---|
| name | string | |
| shaderPath | string |
resolvedSettings(block: any, entry: any, tier: string, schema: { any }) → void
| arg | type | description |
|---|---|---|
| block | any | |
| entry | any | |
| tier | string | |
| schema | { any } |
schemaOf(shaderPath: string) → void
| arg | type | description |
|---|---|---|
| shaderPath | string |
applySettings(name: string, values: { [string]: any }) → void
| arg | type | description |
|---|---|---|
| name | string | |
| values | { [string]: any } |
skyDistance( ) → number
Where the sky lies for a depth mask: the on-screen camera's far distance, read about once a second (a component read every frame would cost more than it is worth).
maskUniforms(mask: any, skyDist: number?) → void
| arg | type | description |
|---|---|---|
| mask | any | |
| skyDist | number? |
setFrameUniforms(name: string, entry: any, layerMode: number, F: any) → void
Each call into the engine costs CPU time, many times more on the web, so an effect's uniforms are written only when what they hold has changed: the frame key covers the stack's revision (any edit of an entry, here or on another machine), the tier and the shared frame inputs; the clock is written when the held step moves (8 times a second by default).
| arg | type | description |
|---|---|---|
| name | string | |
| entry | any | |
| layerMode | number | |
| F | any |
settingsFor(name: string, block: any, entry: any, tier: string, shaderPath: string, F: any) → void
A block's settings, resolved and written only when the frame key moves.
| arg | type | description |
|---|---|---|
| name | string | |
| block | any | |
| entry | any | |
| tier | string | |
| shaderPath | string | |
| F | any |
schemaHas(shaderPath: string, prop: string) → boolean
The scene's sun (direction toward it, w 1 when there is a sun with light) for a block whose shader declares `sk_sun`, written when it changes.
| arg | type | description |
|---|---|---|
| shaderPath | string | |
| prop | string |
sunFor(name: string, shaderPath: string, F: any) → void
| arg | type | description |
|---|---|---|
| name | string | |
| shaderPath | string | |
| F | any |
sceneSun(force: boolean) → void
Read every 4 frames (a sun crossing the sky moves a raking light by a hair between reads, where once a second stepped it visibly), at once when `force` (the stack changed: a new look, a new scene's stack), and every frame while someone drives the clock (the Lookbook, a recording), so a run never draws with the light of what came before it and repeats exactly.
| arg | type | description |
|---|---|---|
| force | boolean |
bindExtras(name: string, soft: boolean, pigments: boolean, rendered: boolean, paper: boolean?) → void
The extra inputs a block declares after the shared header: the soft field and the scene's pigment palette, bound once per effect (and again whenever the images behind them are made anew).
| arg | type | description |
|---|---|---|
| name | string | |
| soft | boolean | |
| pigments | boolean | |
| rendered | boolean | |
| paper | boolean? |
ensurePalette(opts: any) → void
The scene's pigment set as a 16 x 1 float image, rewritten only when the set (or the sets installed) change.
| arg | type | description |
|---|---|---|
| opts | any |
softField(src: string, T: any, F: any, opts: any, order: number, q: (any) → void
The soft field: one direction across, then down, at half the chain's resolution, weighted by depth so far surfaces never take colour from near ones in front of them. Returns the next free pass order.
| arg | type | description |
|---|---|---|
| src | string | |
| T | any | |
| F | any | |
| opts | any | |
| order | number | |
| q | (any |
retire(used: { [string]: boolean }) → void
| arg | type | description |
|---|---|---|
| used | { [string]: boolean } |
releaseAll( ) → void
With no live block the stack leaves nothing of its own behind: every block effect and internal effect is removed, the targets, buffer and mask materials are freed and the render feature itself is torn down. The next block registers them afresh.
holdsAnything( ) → boolean
Whether the runtime holds anything at all (effects, targets, programs or its render feature).
idle( ) → void
resolveEntry(v: any) → void
An exclude or group entry names entities by id or by name. A name is what a scene should store: an id written into a field's value is not carried over when the scene is saved and loaded again (the entity comes back under a new id), a name is. `{ id = ... }` and `{ name = ... }` tables work too.
| arg | type | description |
|---|---|---|
| v | any |
objectGroups(opts: any) → void
Returns the groups and whether some entry found nothing yet (an entity that arrives later, or a scene still loading), so the caller can look again.
| arg | type | description |
|---|---|---|
| opts | any |
add(ch: number, list: any) → void
| arg | type | description |
|---|---|---|
| ch | number | |
| list | any |
render(ctx: any, ordered: { any }, opts: any, registry: { [string]: any }, _revision: number) → void
| arg | type | description |
|---|---|---|
| ctx | any | |
| ordered | { any } | |
| opts | any | |
| registry | { [string]: any } | |
| _revision | number |
q(spec: any) → void
| arg | type | description |
|---|---|---|
| spec | any |
layeredField(passes: { any }, prop: string, final: any, second: string, neutral: string, writes: string) → boolean
Several passes into one shared field: each later one reads the one before as `prop` and mixes itself over it, ping-ponging between two images so the last lands in `final`.
| arg | type | description |
|---|---|---|
| passes | { any } | |
| prop | string | |
| final | any | |
| second | string | |
| neutral | string | |
| writes | string |
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.