Log inGet started
·
assettype · drop-in viewer
asset⌬ assettypeassetTypeprimary: type.yaml·part ofpackage effects.package·originates fromworld 07158574-5…●9problems

effect.assetType

A set of visuals packaged as one thing: every impact a weapon makes, every stage of an explosion, the muzzle flash, impact and tracer of a gun. Each visual is an entry the effect plays by name. The graphs, the parts they are built from, and the shaders, materials, compute shaders…

by◐lumi·posted 3mo ago
What it does

effect

A set of visuals packaged as one thing: every impact a weapon makes, every stage of an explosion, the muzzle flash, impact and tracer of a gun. Each visual is an entry the effect plays by name. The graphs, the parts they are built from, and the shaders, materials, compute shaders and textures they use all live inside the effect.

The shape on disk

<name>.effect/
  effect.yaml   what it plays: entry name -> one graph, or a list of graphs played together
  graphs/       the graphs its entries play
  parts/        graphs those graphs use as nodes, each one whole piece of the look
  shaders/      shaders and shader modules its materials draw with
  materials/
  compute/      compute shaders its graphs run
  textures/
  README.md     what this effect shows, what each entry plays, what each input changes
  .metadata
  settings.yaml its values for the settings below

effect.yaml, graphs/, README.md and .metadata are required.

plays:
  flare: "~.graphs.flare"
  impact:
    - "~.graphs.impactFlash"
    - "~.graphs.impactDebris"
default: flare

Inside an effect ~.x names the effect's own x: ~.graphs.flare, ~.parts.crack, ~.shaders.lava, wherever the effect sits.

Post-processing it carries

post is the post-processing the effect brings with it: bloom on a fireball, a flash of exposure, a vignette. While an entry plays, it stands as a PostProcess region around the effect, and goes when the play stops or finishes:

post:
  radius: 30        # the region, a sphere around the effect unless `shape` says box or global
  falloff: 5        # the distance outside it over which the stack fades out
  effects:
    - { shader: "@builtin::shaders.post.bloom", priority: 10, values: { threshold: 1.2, intensity: 0.6 } }
    - { shader: "@builtin::shaders.post.vignette", priority: 20, values: { intensity: 0.4 } }

effects is the region's stack and the rest its fields, as the PostProcess component takes them (shape, radius, extents, falloff, priority, display, setsDisplay). The region applies while the camera is in it, so a picture of the effect on the preview stage shows it without; effects.capture of the effect placed (entity) shows it with.

Graphs and parts

A graph under graphs/ composes what one entry shows. A piece worth building and looking at on its own (the crack of a fissure, the spray, the smoke) is a graph under parts/, called as a node:

local crack = g["~/parts/crack"]({ length = length })

A part is a whole graph, so it previews and plays alone: the crack without the smoke in front of it. An operation several effects use (a streak look, a smoke puff) is a .procNode outside the effect, used the way a module is required.

Playing one

local beacons = asset.resolve("beacons", "effect")
local shown = beacons:play("flare", { root = mast, offset = { 0, 0.9, 0 }, inputs = { size = 0.4 } })
shown:set("size", 0.6)
shown:onFinished(function() print("done") end)

root is the entity it plays on and follows; inputs go to every graph of the entry that declares them; the handle answers set, pause, resume, seek, getTime, stop, isFinished and onFinished. A play finishes when every graph of its entry reaches the end of its timeline; a graph that states realTime alone has no end, so a play of it runs until stop(), and a simulation that runs once states its frames (g:timeline({ realTime = true, frames = 120 })). Plays of an entry no program holds are kept ready, built ahead of time: beacons:warm("flare", 6) keeps six ready for a burst. An Effect component, or a drop into the viewport, places an entry in a scene.

Entries played by a program

An entry whose graphs end on their own, take no plain input and carry no post is played by a program: its graphs are cooked once, when the entry is first asked for (entries() on the effect, warm, or the first play), and captured as one program over many copies. A play takes a slot of the program (effectRef:play is a write into a row of data, and the shot draws on the frame after it), so a burst of plays costs the frame no more than the program's one present: how many slots there are is the count warm or the pool setting states, 8 when neither does, and the program doubles ahead of the plays when a quarter of its slots or fewer are free. A play asked for with no slot free takes the oldest shot's, and that shot's handle reads finished.

entries().entries[name].program states where the program stands: state ("preparing", "ready" or "refused"), the reason an entry is refused, and, once ready, its copies, how many are live and free, the evictions and the doublings (grown). pool of such an entry is its slots, ready its free ones and playing its live ones. While the program is preparing, and for an entry it refused, a play is built as an entry plays without a program, one play at a time.

A play on a program takes numbers and vectors for its inputs and stands where offset and rotation put it. Its handle answers set (the copy begins its simulation again under the new value), pause (the copy stands at its age), resume, seek (the copy begins again at the step that puts it at that age), stop, getTime, isFinished, onFinished and playback; it carries no entity. A play that asks for a root, keep, an ending other than "graph", a speed other than 1, or an input that is neither a number nor a vector (and is not the default) is a play of its own: one made for the call that goes when it finishes.

entries() and entry(name) read what it plays; setEntry, removeEntry, renameEntry, setDefault and newGraph change it, keeping every line of effect.yaml they do not touch.

Settings

pool: how many plays of each entry there are, counting the ones playing (default 1). Each costs a whole play's memory, so a burst asks for more with warm where it is expected. An entry played while more of its plays are playing than it keeps builds the play, and keeps that many from then on, up to its most: the plays of a burst go back ready when they finish, and the next burst of the same size builds none. A play still being built for a call of an earlier frame counts as playing once its clock moves. A warm with a smaller count than the one before lets go of those too.

Of the plays of an entry that end on their own, at most its pool size play at once, and never fewer than 16 (entries() reports it as most, and those plays out now as playing). Such a play asked for while that many play takes over the oldest of them: it plays again from its start where the new play stands, and the handle of the play it was reads finished. A scene that plays one entry faster than its plays finish therefore holds a bounded number of them. A play that runs until stop() (ending = "loop", or an entry with a graph that has no end) and one that stays once finished (keep) play on where they were asked for, as many as the caller plays, until the caller stops them.

In search

Each asset inside an effect is found on its own and names the effect it belongs to. The effect itself is found by its preview, its README and its entries.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/asset-type/v1
⌬ Spec
suffix.effectcontainernorequired fileseffect.yaml, README.md, .metadata, graphsoptional filesparts, shaders, materials, compute, textures, preview.png, settings.yaml
Exposed API
⌬ Instance methods

isDescribed(self: ?) → boolean

Whether the effect's entries are described already, so that `entry` answers without reading its graphs.

argtypedescription
self?

examples

if effectRef:isDescribed() then bind() end

entry(self: ?, name: string?, cooperative: boolean?) →

One of this effect's entries: the graphs it plays together, each with the inputs it declares. timeline has a last frame; `loops`: it plays round again from there; `names`: the graphs as effect.yaml states them; `post`: the effect's `post`, the `PostProcess` region it carries while it plays, nil for none), or nil and why.

argtypedescription
self?
namestring?The entry's name, as `effect.yaml` lists it under `plays`; nil for the default.
cooperativeboolean?True from a task: describing the effect hands the frame back between its graphs.

examples

local burst = effectRef:entry("burst")

entries(self: ?) →

What this effect plays: each entry's name, the graphs it plays together and the inputs it takes, and the entry played when none is named.

argtypedescription
self?

examples

for name, e in effectRef:entries().entries do print(name, #e.graphs) end

play(self: ?, entryName: string?, opts: PlayOpts?, entry: ?) → any

Play one of this effect's entries. Every graph the entry holds plays together from the same moment, each given the inputs it declares, under the entity `root` names, so the effect moves with it (a sword, a torch, a character's hand); with no `root` it stands in the world. A finished play is kept and played again by the next call for the same entry. A play asked for while more of the entry's plays are playing than it keeps is built, and the entry keeps as many from then on, up to its `most`: each finished play of a burst goes back ready, and the next burst builds none. A play still being built for a call of an earlier frame is not counted playing until its clock moves. Of the plays of an entry that end on their own, at most its pool size play at once, and never fewer than 16 (`entries()` reports it as `most`): such a play asked for while that many play takes over the oldest, whose handle then reads finished. `warm(entry, count)` raises it. A play that runs until `stop()` (a loop, or an entry with a graph that has no end) or that stays once finished (`keep`) plays on until its caller stops it. An entry a program holds (`entries()` states its `program`) is played by taking a slot of the program: its handle has no `entity`, takes numbers and vectors for `set`; a play that names a `root`, `keep`, an `ending` other than `"graph"` or a `speed` other than 1 is a play of its own.

argtypedescription
self?
entryNamestring?
optsPlayOpts?`{ root?, offset?, rotation?, inputs?, ending?, speed?, keep? }`. `root`: the entity it plays on (proxy or id). `offset`: where it stands (a vector or `{ x, y, z }`), from `root` or, with no root, in the world. `rotation`: its rotation there (pitch/yaw/roll degrees, or a quaternion). `inputs`: values for the entry's inputs by name; each goes to every graph of the entry that declares it. `ending`: `"graph"` (what the timeline declares), `"loop"` or `"hold"`. `speed`: 1 its own rate. `keep`: stay once finished instead of going.
entry?The entry's name, as `effect.yaml` lists it under `plays`; nil plays its `default`.

examples

local beacons = asset.resolve("beacons", "effect")
local shown = beacons:play("flare", { root = mast, offset = { 0, 0.9, 0 }, inputs = { size = 0.4 } })
shown:onFinished(function() print("done") end)

warm(self: ?, entryName: string?, count: number?, inputs: { [string]: any }?, entry: ?) → void

Keep plays of this effect's entries ready, built ahead of time, so a play takes one and shows its first frame at once. Plays are made one after another on the frames after the call, and one counts as ready once every graph of it is planned and cooked, its timeline has run through once unseen (each step of its simulations recorded, the lists its frames run made) and its first frame is presented again (`entries()` reports `ready`): a play of a ready one builds nothing. A play made for `inputs` is ready for a play given the same inputs; one given others cooks for them as it starts, and shows nothing until that cook's first frame stands, its clock standing at its start meanwhile. A finished play goes back on its first frame, prepared again for the inputs it last played with, while its entry has fewer than this count. An entry nothing sized keeps the effect's `pool` setting ready, made the first time that entry plays; call this at a level's load, or before a burst, with the number of plays of an entry that run at once. An entry played while more of its plays are out than it keeps keeps that many from then on (`play`); a count below the one given before lets go of those too.

argtypedescription
self?
entryNamestring?
countnumber?How many to keep ready; nil keeps the effect's `pool` setting. 0 keeps none.
inputs{ [string]: any }?The values of the entry's inputs the plays are made for, as `play` takes them; nil makes them with the defaults.
entry?The entry; nil sizes every entry.

examples

beacons:warm()
beacons:warm("flare", 6)
beacons:warm("flare", 2, { size = 0.4 })

setEntry(self: ?, name: string, graphs: { any }) → void

Set what one entry plays: replaces the entry's graphs, or adds the entry after the others when the effect has none by that name. Other lines of effect.yaml, comments included, are kept. effect.yaml states them (`~.graphs.flash`).

argtypedescription
self?
namestringThe entry's name: letters, digits and _, starting with a letter.
graphs{ any }The graphs it plays together: procGraph refs, or names as

examples

beacons:setEntry("flare", { asset.resolve("~.graphs.flareCore", "procGraph"), "~.graphs.flareTrail" })

removeEntry(self: ?, name: string) → void

Remove an entry and the comment lines directly above it. The default moves to the first entry left; the last entry cannot be removed.

argtypedescription
self?
namestringThe entry's name.

examples

beacons:removeEntry("flare")

renameEntry(self: ?, old: string, new: string) → void

Rename an entry; the default follows it.

argtypedescription
self?
oldstringThe entry's name now.
newstringIts new name: letters, digits and _, starting with a letter.

examples

beacons:renameEntry("glow", "flare")

setDefault(self: ?, name: string) → void

Make an entry the one played when none is named.

argtypedescription
self?
namestringThe entry's name.

examples

beacons:setDefault("flare")

newGraph(self: ?, name: string, opts: { part: boolean? }?) → any

Make a new graph inside this effect: under `graphs/` for one it plays, under `parts/` for one its graphs use as a node.

argtypedescription
self?
namestringThe graph's name.
opts{ part: boolean? }?`{ part? }`: true makes it under `parts/`.

examples

local core = beacons:newGraph("flareCore")
local crack = beacons:newGraph("crack", { part = true })

instantiate(self: ?, target: any?, opts: { [string]: any }?) →

Place this effect in the scene: an entity with an Effect component that plays one of its entries there, the way a drop into the viewport or an `Asset` field places it. `temporary`), plus `entry` (the entry it plays; the effect's default when omitted) and `inputs` (values for the entry's inputs by name).

argtypedescription
self?
targetany?Optional owning entity ref; the effect's entity spawns under it.
opts{ [string]: any }?The base placement opts (`position`, `rotation`, `scale`, `name`,

examples

local root = effectRef:instantiate(nil, { position = { 0, 1, 0 }, entry = "flare" })

preview(self: ?, opts: { [string]: any }?) →

Render this effect to a still: its `default` entry played on the preview stage (`effects.stage`) from its first frame, over the dark backdrop and framed on the effect's body, and the picture taken at the effect's still moment: the latest of the moments its graphs name with `g:still` (halfway through its range, or two seconds into a timeline with no end, for a graph that names none). A timeline with an end is moved to that moment; one with no end is played to it. as `preview.fromEntities` takes them.

argtypedescription
self?
opts{ [string]: any }?`{ size? = { width, height }, angle? = { yaw, pitch }, backdrop?, fit? }`,

examples

local shot = effectRef:preview({ size = { width = 256, height = 256 } })

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

These counts cover only the parts this page shows. Problems on the parts it leaves out are not counted here.

9+problems

Inside

9 problems across 4 items
●
dep.unresolved · L604
could not resolve `Effect`
●
dep.unresolved · L903
could not resolve `Effect`
●
dep.unresolved · L905
could not resolve `Effect`
●
dep.unresolved · L1070
could not resolve `Effect`
●
dep.unresolved · L529
could not resolve `Effect`
●
dep.unresolved · L502
could not resolve `Effect`
●
dep.unresolved · L401
could not resolve `Effect`
●
dep.unresolved · L495
could not resolve `Effect`
●
dep.unresolved · L568
could not resolve `Effect`
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ 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".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.