Log inGet started
Package

cumulus_default.preset

Newest version

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

README.md

cumulus_default

Default weather preset for VolumetricSky.component: fair-weather cumulus over the whole sky, warm-afternoon sun, a little under half the sky covered, the coverage varying from place to place.

Use

local sky = entity.spawn("sky")
sky.component.add("VolumetricSky", {})
preset.apply("cumulus_default", { entity = sky.id, component = "VolumetricSky" })

The values set the component's preset Field.table as a unit — one Sync replication carries every shaping/lighting parameter to peers. Tweak by reading the values and changing them before the component is added:

local values = preset.values("cumulus_default")
values.preset.coverage = 0.7       -- more of the sky covered
values.preset.cloudType = 1.0      -- towering cumulonimbus
sky.component.add("VolumetricSky", values)

Authoring more presets

Capture a sky you have tuned with preset.capture({ entity = sky.id, component = "VolumetricSky" }, "<name>"), or drop another <name>.preset/ folder next to this one (or anywhere under /zero/source/); the asset indexer registers it and preset.values("<name>") resolves it. Common alternatives:

  • overcast.preset — a broad grey sheet (coverage ~= 0.9, cloudType ~= 0.1).
  • clear.preset — barely any cloud (coverage ~= 0.1).
  • storm.preset — towering dark cells (coverage ~= 0.75, cloudType = 1, densityGain ~= 0.08, sunColor ~= [0.6, 0.55, 0.5]).

Weather that differs from place to place (a storm over one valley, clear sky over the next) is the sky's weatherRegions field rather than a preset.

preset is one Field.table: applying a preset replaces it whole, so provide every field.