SkyDome.module
This package holds more than this page lists. See all of its files in its world.
README.md
SkyDome
The island's clouds, each layer drawn as one unlit see-through dome around the camera, so a whole sky costs one draw call. The engine's procedural sky has no clouds, and its volumetric cloud layer ray-marches every frame, which is too costly for a browser.
cumulus: fair-weather trade-wind cumulus, thick toward the horizon and scattered overhead. Atmos tints it for the time of day: peach morning, white noon, gold sunset, dim at night.squall: the passing shower's sky. A heavy dark cloud base over a paler grey rain-cloud deck, grey rain curtains hanging toward the sea, and a sunlit break low on one side. It crossfades in as the fair cumulus fades out, so the shower sky is one layer.
Each layer ships as a texture: textures/cumulus_dome and textures/squall_dome. SkyDome.bake({ squall?, seed?, coverage? }) paints a layer again from deterministic noise and runs the importer on it. The noise is laid on a flat deck seen from below, so clouds foreshorten toward the horizon and wrap around with no seam.
SkyDome.apply(tint, alpha, yaw, scale?, layer?), SkyDome.hide(layer?), SkyDome.showing(layer), SkyDome.destroy(); SkyDome.encodePng(w, h, rgba) and SkyDome.paint(opts) are the pieces underneath.
The engine sorts see-through surfaces by their bounds, not by the material's queue. Two overlapping see-through sky domes therefore cannot be ordered reliably, which is why the shower deck is painted into the squall texture rather than drawn as a second dome.