Log inGet started
Package

Atmos.module

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

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.