Atmos
The tundra's time of day, northern lights and weather for every player, and the look of the sky, light and air on each machine. It runs on worldClockKit's shared clock and weather.
Atmos
The tundra's time of day, northern lights and weather for every player, and the look of the sky, light and air on each machine. It runs on worldClockKit's shared clock and weather.
local Atmos = require("arcticKit.Atmos")
Atmos.setTime("morning") -- morning | noon | dusk | night (opts.hold = true pauses the clock there)
Atmos.setAurora("curtains") -- curtains | storm | crown | quietArc | off (opts.fade seconds)
Atmos.setWeather("blizzard") -- clear | groundBlow | whiteout | diamondDust | iceFog | blizzard (opts.fade seconds)
Atmos.getTime(), Atmos.getAurora(), Atmos.getWeather()
Atmos.report() -- what this machine shows: time, weather, aurora, sun elevation, layers, ambience, sky
An unknown name is refused with an error naming the real ones. The sun keeps a polar path (74 degrees north, late winter): about 4 degrees up in the pink morning, about 14 at noon, a few below at the long blue dusk, 18 below at midnight. The four presets (Atmos.PRESETS) each carry the sky colours, sun and fill light, ambient, fog, colour grade and ambience levels, and blend by the clock's solar hour (Atmos.KEYS): night, blue hour, pink morning, pale noon, pink evening, blue hour, night.
It lights the scene through worldClockKit's director (a hook on Director.evaluate, chained like alpineKit's), draws the sky with its own shader (sky/arcticSky, bound on a temporary entity; the WorldClock is set to skyMode = "off"), grades with sky/arcticGrade, shapes the engine's height fog (ice fog hugs the ground, blizzard and white-out close in), and runs the weather layers (Weather), the ambience (Ambience) and footsteps (Footsteps). The ArcticAtmosphere component starts it; Atmos.ensureClock() makes a WorldClock when the scene has none.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2The tundra's sky, light and air on worldClockKit's shared clock. Four polar times of day (a low pink morning, a pale low noon, a long blue dusk, a starry night) on a polar sun path that never climbs above about 14 degrees; four kinds of northern lights; six arctic weathers. Every player sees the same hour, aurora and weather. On each machine it draws the polar sky (its own sky shader), lights the scene through worldClockKit's director, grades the picture, lays the fog (ice fog hugging the ground, blizzard and white-out closing in), draws the weather layers round the camera and runs the ambience and footsteps.
rgb(r: number, g: number, b: number) → void
| arg | type | description |
|---|---|---|
| r | number | |
| g | number | |
| b | number |
lerp(a: number, b: number, t: number) → number return a
| arg | type | description |
|---|---|---|
| a | number | |
| b | number | |
| t | number |
lerp3(a: { number }, b: { number }, t: number) → void
| arg | type | description |
|---|---|---|
| a | { number } | |
| b | { number } | |
| t | number |
smooth(e0: number, e1: number, x: number) → number
| arg | type | description |
|---|---|---|
| e0 | number | |
| e1 | number | |
| x | number |
luma(c: { number }) → number return 0
| arg | type | description |
|---|---|---|
| c | { number } |
sunDirAt(solar: number) → void
Unit vector toward the sun at a solar hour on the polar path: east in the morning (+X), low in the south at noon (-Z), west in the evening, under the northern horizon at midnight.
| arg | type | description |
|---|---|---|
| solar | number |
sunElevation(solar: number) → number
The sun's elevation in degrees at a solar hour.
| arg | type | description |
|---|---|---|
| solar | number |
weightsAt(solar: number) → void
Weight of each preset at solar hour `solar` (sums to 1).
| arg | type | description |
|---|---|---|
| solar | number |
solarNow( ) → number
weights( ) → void
time( ) → string
The preset nearest the clock now: "morning", "noon", "dusk" or "night".
hourForSolar(solar: number) → number
| arg | type | description |
|---|---|---|
| solar | number |
setTime(name: string, opts: { hold: boolean? }?) → void
Set the shared clock to a preset for every player: "morning", "noon", "dusk", "night". `opts.hold = true` pauses the clock there, false lets it run.
| arg | type | description |
|---|---|---|
| name | string | |
| opts | { hold: boolean? }? |
setAurora(name: string, opts: { fade: number? }?) → void
Set the northern lights for every player: "curtains", "storm", "crown", "quietArc" or "off". They show at dusk and night.
| arg | type | description |
|---|---|---|
| name | string | |
| opts | { fade: number? }? |
aurora( ) → string
The northern lights kind showing (or fading in).
setWeather(name: string, opts: { fade: number? }?) → void
Set the shared weather for every player: "clear", "groundBlow", "whiteout", "diamondDust", "iceFog", "blizzard". Fades over `opts.fade` seconds.
| arg | type | description |
|---|---|---|
| name | string | |
| opts | { fade: number? }? |
weather( ) → string
The shared weather now (or fading in). A worldClockKit weather that is not arctic is returned as it is.
getTime( ) → string
The time preset nearest the shared clock now: "morning", "noon", "dusk" or "night".
getAurora( ) → string
The northern lights kind showing (or fading in): "curtains", "storm", "crown", "quietArc" or "off".
getWeather( ) → string
The shared weather now (or fading in): "clear", "groundBlow", "whiteout", "diamondDust", "iceFog", "blizzard" (or another worldClockKit weather set outside arcticKit).
configure(opts: any) → void
| arg | type | description |
|---|---|---|
| opts | any |
config( ) → any
mixTable(a: any, b: any, t: number) → any
| arg | type | description |
|---|---|---|
| a | any | |
| b | any | |
| t | number |
lookFor(w: { [string]: number }) → any
The look for preset weights `w`: `{ sky, light, fog, grade, ambience }`, each blended. Pure.
| arg | type | description |
|---|---|---|
| w | { [string]: number } |
environment(solar: number, x: any, kw: any) → any
Everything this machine shows at solar hour `solar` with weather extras `x` and kit params `kw`: sun and moon directions, light, ambient, fog, sky, grade, aurora visibility. Pure.
| arg | type | description |
|---|---|---|
| solar | number | |
| x | any | |
| kw | any |
shapeEnv(env: any) → void
| arg | type | description |
|---|---|---|
| env | any |
installHook( ) → void
skyShader( ) → any
skyCompiled( ) → boolean
ensureSkyMaterial( ) → void
ensureSkyReflection( ) → void
the reflection environment holds no sky until one is captured: without it the black ice, wet rock and hut reflect black instead of the polar sky and the aurora. Once taken, the engine recaptures it as the sky changes, so this only acts when no capture of ours stands.
bindSky( ) → void
skySet(prop: string, v: any) → void
| arg | type | description |
|---|---|---|
| prop | string | |
| v | any |
rgba(c: { number }, a: number?) → void
| arg | type | description |
|---|---|---|
| c | { number } | |
| a | number? |
pushSky(e: any, kw: any, au: any, flash: number) → void
| arg | type | description |
|---|---|---|
| e | any | |
| kw | any | |
| au | any | |
| flash | number |
weathered(c: { number }, k: number) → void
| arg | type | description |
|---|---|---|
| c | { number } | |
| k | number |
effectLive(name: string) → boolean
| arg | type | description |
|---|---|---|
| name | string |
ensureGrade( ) → void
writeGrade(g: any) → void
| arg | type | description |
|---|---|---|
| g | any |
gradeFor(e: any, kw: any) → any
The grade for an environment (Atmos.environment): the time of day's, flattened and greyed by the weather. Pure.
| arg | type | description |
|---|---|---|
| e | any | |
| kw | any |
groundUnder(cam: { number }) → number
| arg | type | description |
|---|---|---|
| cam | { number } |
applyFog(e: any, cam: { number }, ground: number) → void
| arg | type | description |
|---|---|---|
| e | any | |
| cam | { number } | |
| ground | number |
alive(e: any) → boolean
| arg | type | description |
|---|---|---|
| e | any |
findClock( ) → void
clockEntityStanding( ) → boolean
a clock entity is already standing (ours, or one the scene names WorldClock) even while its component cannot answer yet: worldClockKit compiles a moment after the scene loads, and until then `component.get` finds nothing. Creating another every second would stack clocks.
ensureClock(opts: any?) → any
Make sure the scene has a WorldClock that leaves the sky to arcticKit: one is created when there is none (synced, by the session's host, temporary), and an existing one is set to `skyMode = "off"` (arcticKit draws the polar sky). Returns the clock component or nil.
| arg | type | description |
|---|---|---|
| opts | any? |
attach(host: any) → void
The ArcticAtmosphere component registers itself: `{ canWrite(), writeField(key, value) }`.
| arg | type | description |
|---|---|---|
| host | any |
detach(host: any) → boolean
Withdraw a host. Answers true when it was the current one (the caller then stops the atmosphere).
| arg | type | description |
|---|---|---|
| host | any |
start(opts: any?) → void
Start the polar sky, light, fog, layers, ambience and footsteps on this machine (the ArcticAtmosphere component calls this).
| arg | type | description |
|---|---|---|
| opts | any? |
stop( ) → void
running( ) → boolean
camPos( ) → void
_followAt(p: { number }?) → void
Checks only: wrap the weather layers round this point instead of the camera that draws (nil goes back to the camera). For offscreen captures from a station of your own.
| arg | type | description |
|---|---|---|
| p | { number }? |
tick(dt: number) → void
One frame: the sky, the aurora, the grade, the fog shape, the weather layers, the ambience and footsteps.
| arg | type | description |
|---|---|---|
| dt | number |
report( ) → any
What this machine shows now: `{ time, weights, weather, aurora, sunElevation, clockHour, auroraVisibility, layers, ambience }`.
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
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.