Sky and weather setup is stored as level objects, usually under a scene tree group such as sky_and_sun in main/items.level.json.
The usual outdoor setup is:
TimeOfDay for the level clock, seasonal sun position, observer location, date, UTC offset, and optional sky profile selection.ScatterSky for atmospheric sky rendering, sky ambient, night-sky rendering, and sky art controls.CloudLayer for cloud appearance and cloud transmittance.LevelInfo for level-wide fog density, visible distance, gravity, and environment map settings.core_celestial for runtime sun, moon, stars, meteors, and profile application.For the full lighting explanation, see Sky, Atmosphere, and Night Sky .
A typical level contains one TimeOfDay, one ScatterSky, one CloudLayer, and one LevelInfo:
{"name":"tod","class":"TimeOfDay","startTime":0,"time":0,"play":false,"axisTilt":23.44,"latitude":47,"longitude":8,"year":2026,"month":6,"day":20,"utcOffset":"2","celestialProfile":"earth"}
{"name":"theLevelInfo","class":"LevelInfo","fogDensity":0.0006,"fogAtmosphereHeight":800,"visibleDistance":4500}
{"name":"sunsky","class":"ScatterSky"}
{"name":"clouds","class":"CloudLayer","coverage":0.2,"windSpeed":0.03,"windDirection":[1,0],"altitudeKm":4}
The exact fields saved by the World Editor depend on the level and engine version. Use the editor as the source of truth for object serialization.
For a first setup, keep ScatterSky simple and put the main choices on TimeOfDay: local time, latitude, longitude, date, UTC offset, and optional profile. Add more ScatterSky fields only for custom atmosphere, celestial bodies, night-sky art tuning, or debug overlays.
TimeOfDay controls the day/night clock and provides the place/date data used by the sky. New levels should always set longitude together with latitude; longitude affects astronomical orientation and local civil time conversion.
Important fields for current sky setup:
| Field | Use |
|---|---|
startTime |
Initial normalized local day time. 0 is local noon, 0.25 is evening, 0.5 is midnight, and 0.75 is morning. |
time |
Current normalized local day time. |
play |
Whether time advances automatically. |
dayLength |
Real seconds per full virtual day. |
axisTilt |
Sun path tilt used by TimeOfDay’s engine sun calculation. With the current celestial runtime active, real sky placement is mainly driven by time, latitude, longitude, date, and UTC offset. |
latitude, longitude |
Observer location for the astronomical night sky. |
year, month, day |
Calendar date for moon, stars, and meteor showers. |
utcOffset |
Optional dynamic field for exact civil UTC offset in hours, including DST. |
dstRule |
Optional dynamic field: auto, eu, us, au, or none. |
celestialProfile |
Optional dynamic field selecting a sky profile by bare name or path. |
TimeOfDay does not render the sky by itself. It must be paired with a compatible sky object such as ScatterSky. The celestial runtime reads TimeOfDay and pushes the live sky state into ScatterSky.
ScatterSky is the main sky object for current levels. Starting with update 0.39, author against the modern atmosphere fields, celestial fields, debug overlays, and sky profiles. Older day-sky fields may still appear in saved level files, but they are not the current authoring model.
The current sky is simulated from atmosphere and celestial data, not just a flat sky color. Atmosphere controls define how sunlight scatters through air, haze, and absorption layers. TimeOfDay provides observer location, date, and clock; the celestial runtime then places the sun, moon, stars, meteors, and optional profile bodies before rendering.
The renderer builds sky lookup textures for transmittance, multiscattering, aerial perspective, and visible sky color. Multiscattering preserves sky brightness and color near the horizon, in haze, and around low sun angles.
Moon phases and solar eclipses come from the same sun/moon placement. The moon’s lit fraction changes with its position relative to the sun, and sunlight is dimmed when the moon disc overlaps the sun disc from the level’s observer position.
For normal levels, use the first few groups below. The script functions, runtime fields, and debug overlays are advanced controls.
Current author-facing controls include:
atmoRayleighScattering, atmoRayleighScaleHeight, atmoMieScattering, atmoMieExtinction, atmoMieScaleHeight, atmoMiePhaseG, atmoAbsorption, atmoGroundAlbedo, atmoSunIrradiance, atmoPlanetRadius, atmoThickness, atmoSunAngularSize, skyBrightness, exposure.bodies[], moonAlbedo, setCelestialBodies, brightnessEV, emissive, toSun, tint, albedo.moonAngularSize, moonBrightnessEV, moonEarthshine, moonShadowFloor, moonLimbDarkening, moonTerminatorSoftness, moonGlow, moonFlatten, moonLightColor, moonIllumination, moonOrbitNodeRad.starsEnabled, starCatalog, starBrightnessEV, starDensity, starNorthOffset, starAzimuthSign, starPulse, milkyWayEnabled, milkyWayBrightnessEV, milkyWayGalacticX/Y/Z, milkyWayDebug.constellationsEnabled, constellationLines, constellationNamesEnabled, constellationLabels.meteorsEnabled, meteorBrightnessEV, meteorTrailLength, meteorWidth, meteorSpeed, meteorRate, meteorShowerFraction, meteorRadiantRA, meteorRadiantDec, meteorInject.gridEnabled, gridBrightness, gridThickness, gridColor, equatorialGridEnabled, meridianEnabled, moonPathEnabled.setCelestialCurve(skyId, index, points).Some sky fields are runtime-driven by the astronomical system, including sun and moon position, moon illumination, star orientation, star visibility, meteor rate, meteor radiant, and meteor shower state. Do not author those as fixed values for normal levels.
azimuth and elevation are networked ScatterSky fields. For full updates to other fields, apply the object changes through the editor or reload/update the level object.The procedural astronomical night sky is the current default path for levels.
Set time, latitude, longitude, date, and UTC offset when the night-sky result matters.
Sky profiles are JSON presets loaded by core_celestial.
Use one of these setups:
TimeOfDay.celestialProfile to a bare name such as earth. Bare names resolve to /art/skies/profiles/<name>.json.TimeOfDay.celestialProfile to a direct JSON path.celestial.json next to the level’s mission file.Profiles can set atmosphere values, moonAlbedo, and optional extra bodies. The stock earth profile documents the default Earth-like atmosphere and is the recommended starting point for custom level profiles.
CloudLayer controls cloud appearance. In the current sky pipeline, clouds can also affect sun transmittance and ambient sky lighting.
The current path renders volumetric clouds by ray-marching through a cloud layer instead of drawing only a flat cloud dome. Cloud density comes from a generated weather map, 3D noise volumes, vertical height gradients, and wind-driven offsets. This gives clouds depth, soft edges, internal shadowing, and view-dependent opacity.
Cloud lighting is tied to the sky. Direct sunlight is reduced through cloud density, while sky ambient SH9 fills shadowed cloud areas. The cloud renderer also produces transmittance/shadow data for sun strength, ambient lighting, fog consistency, and flare occlusion.
Current volumetric cloud authoring fields include:
coverage - large-scale cloud amount. Higher values create more filled cloud regions and increase the thin cirrus contribution.windSpeed - scalar speed for cloud movement.windDirection - horizontal direction for cloud movement.altitudeKm - base altitude of the main volumetric cloud layer.Older CloudLayer fields can still appear in saved level files, but they are not useful controls for the current volumetric cloud path.
Cloud quality settings affect how clouds are sampled, reconstructed, and how often cloud shadow/transmittance data updates. Always check the level at the cloud quality presets you intend to support.
LevelInfo still controls fog density and visible distance:
fogDensityfogAtmosphereHeightvisibleDistanceThe current sky path derives sky and fog color from the atmosphere. Use LevelInfo for fog amount/range/visibility, and use the sky atmosphere or a sky profile for sky/fog color art direction.
TimeOfDay and one primary ScatterSky per outdoor level.celestialProfile or a level-local celestial.json for custom sky presets.Was this article helpful?