atmosphere
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
atmosphere
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe 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/v2game.fx.atmosphere — ambient life, light shafts and time of day for the HD-2D dioramas of Amelia. local Atmosphere = require("game.fx.atmosphere") Atmosphere.build(entity.find("Emberbrook"), "autumn_town") Atmosphere.setTimeOfDay("night") -- or "golden"; tweens over ~2 s Particles run on the engine's GPU particle module with `autoUpdate`, so they simulate in edit mode as well as in play. Everything a build makes is owned by the key OWNER and swept on the next build, and a watchdog task destroys the emitters once the anchor entity is gone (scene rebuilt / unloaded).
lerp(a: number, b: number, t: number) → number
| arg | type | description |
|---|---|---|
| a | number | |
| b | number | |
| t | number |
norm(x: number, y: number, z: number) → void
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| z | number |
cross(ax: number, ay: number, az: number, bx: number, by: number, bz: number) → void
| arg | type | description |
|---|---|---|
| ax | number | |
| ay | number | |
| az | number | |
| bx | number | |
| by | number | |
| bz | number |
comp(name: string, kind: string) → any
| arg | type | description |
|---|---|---|
| name | string | |
| kind | string |
rgb(c: any) → void
| arg | type | description |
|---|---|---|
| c | any |
lerpColor(a: { number }, b: { number }, t: number) → void
| arg | type | description |
|---|---|---|
| a | { number } | |
| b | { number } | |
| t | number |
alive(e: any) → boolean
| arg | type | description |
|---|---|---|
| e | any |
seq(kps: { { number } }) → any
| arg | type | description |
|---|---|---|
| kps | { { number } } |
cseq(kps: { any }) → any
| arg | type | description |
|---|---|---|
| kps | { any } |
emitter(group: string, origin: { number }, spec: { [string]: any }) → any
| arg | type | description |
|---|---|---|
| group | string | |
| origin | { number } | |
| spec | { [string]: any } |
dustMotes(group: string, base: { number }, size: { number }, color: { number }, rate: number) → void
golden dust motes floating in the sunlit air
| arg | type | description |
|---|---|---|
| group | string | |
| base | { number } | |
| size | { number } | |
| color | { number } | |
| rate | number |
fallingLeaves(group: string, base: { number }, size: { number }, rate: number) → void
| arg | type | description |
|---|---|---|
| group | string | |
| base | { number } | |
| size | { number } | |
| rate | number |
chimneySmoke(group: string, parent: any) → void
| arg | type | description |
|---|---|---|
| group | string | |
| parent | any |
lanternEmbers(group: string, parent: any) → void
| arg | type | description |
|---|---|---|
| group | string | |
| parent | any |
fireflies(group: string, base: { number }, size: { number }, rate: number, color: { number }) → void
| arg | type | description |
|---|---|---|
| group | string | |
| base | { number } | |
| size | { number } | |
| rate | number | |
| color | { number } |
snowfall(group: string, base: { number }, size: { number }, rate: number) → void
| arg | type | description |
|---|---|---|
| group | string | |
| base | { number } | |
| size | { number } | |
| rate | number |
sunDirection( ) → void
cameraPos( ) → void
shaft(root: any, i: number, gx: number, gy: number, gz: number, len: number, width: number) → void
One shaft: lands at (gx, gy, gz), `len` long, `width` wide.
| arg | type | description |
|---|---|---|
| root | any | |
| i | number | |
| gx | number | |
| gy | number | |
| gz | number | |
| len | number | |
| width | number |
shaftField(root: any, base: { number }, spots: { { number } }) → void
| arg | type | description |
|---|---|---|
| root | any | |
| base | { number } | |
| spots | { { number } } |
cloudShadows(root: any, base: { number }, size: number) → void
| arg | type | description |
|---|---|---|
| root | any | |
| base | { number } | |
| size | number |
startLoop(root: any) → void
| arg | type | description |
|---|---|---|
| root | any |
sweep( ) → void
autumn_town(base: ?, opts: ?) → void
| arg | type | description |
|---|---|---|
| base | ? | |
| opts | ? |
night_town(base: ?, opts: ?) → void
| arg | type | description |
|---|---|---|
| base | ? | |
| opts | ? |
forest(base: ?, opts: ?) → void
| arg | type | description |
|---|---|---|
| base | ? | |
| opts | ? |
snow(base: ?, opts: ?) → void
| arg | type | description |
|---|---|---|
| base | ? | |
| opts | ? |
build(parent: any, preset: string?, opts: any?) → void
Spawn the ambient life of a preset under `parent`.
| arg | type | description |
|---|---|---|
| parent | any | Entity to anchor to (its world position is the preset's centre). |
| preset | string? | "autumn_town" | "night_town" | "forest" | "snow" |
| opts | any? |
matEmissive(identity: string) → number
| arg | type | description |
|---|---|---|
| identity | string |
postEffects( ) → void
lightComps( ) → void
The scene's warm point lights, in a stable order.
snapshot( ) → any
Read every value setTimeOfDay drives, as it stands in the scene now.
nightOf(g: any) → any
The night look, derived from the golden snapshot.
| arg | type | description |
|---|---|---|
| g | any |
goldenOf(g: any) → any
| arg | type | description |
|---|---|---|
| g | any |
apply(a: any, b: any, t: number) → void
Write the blend of two looks at t into the scene.
| arg | type | description |
|---|---|---|
| a | any | |
| b | any | |
| t | number |
setGroups(mode: string) → void
| arg | type | description |
|---|---|---|
| mode | string |
stash( ) → any
Where the golden look and the current mode are remembered: on the Sun, so they live exactly as long as the scene that was snapshotted.
setTimeOfDay(mode: string, seconds: number?) → void
Retune sun, ambient, sky, fog, lamps, windows, bloom and the ambient particles for "golden" (late afternoon, the scene as authored) or "night".
| arg | type | description |
|---|---|---|
| mode | string | "golden" | "night" |
| seconds | number? | Blend time; default 2, 0 snaps. |
getTimeOfDay( ) → string
clear( ) → void
Remove everything build made (particles, shafts, cloud shadows, air).
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.