Prefer Sky.create, which also initialises the renderer. Call Sky.update every frame.
The atmosphere as used for the home planet (altitudes scaled to its radius when scaleWithRadius).
Camera the observer follows. Can be swapped at any time.
ReadonlyclockSimulation clock.
ReadonlycloudsSparse Gaussian clouds.
ReadonlydayLights, environment, fog and exposure.
ReadonlydomeThe atmosphere dome.
Point the lights centre their shadows on; null = the camera position.
Lighting derived from the last update.
ReadonlyobjectRoot of the dome, stars, meteors and lights. Added to scene for you when one is given.
ReadonlyshellsLabelled altitude shells around the home planet.
ReadonlyshootingMeteors.
ReadonlystarsStars and Milky Way.
ReadonlystateEverything about the current instant (sun/moon directions, phase, night…). Refreshed by Sky.update.
The star system model. Rebuilt when system settings change.
ReadonlyuniformsShared TSL uniforms (night, sunDirection, …) for use in your own materials.
Faint night-sky glow (linear RGB radiance).
Airglow shell brightness.
Airglow shell colour (linear).
Airglow shell bottom and top altitudes, metres (mesopause … Kármán line).
Atmosphere thickness, metres.
Render → home planet body frame.
Camera position minus planet centre, render space, metres.
Render → star frame (fixed stars; turns with sidereal time).
Density multiplier (0 = no atmosphere).
Earthshine radiance factor on the moon's dark side.
Ground albedo seen through the atmosphere where no terrain is drawn (linear RGB).
Mie scattering per metre.
Mie absorption per metre.
Mie anisotropy.
Mie scale height, metres.
Multiplier on the moon's albedo map.
Apparent moon radius, radians (0 = no moon).
Multiplier on the moon disc's sunlit radiance.
Towards the moon (render space).
Lit fraction of the moon.
Render → moon body frame.
How strongly moonlight lights the sky, relative to the sun.
0 by day … 1 at night. Bind it in your own materials (e.g. lit windows).
Minimum light on the night side of the planet seen from altitude (fraction of sunIntensity).
City lights on the night side.
Light colour (linear).
Procedural coverage.
Radiance of fully lit areas (0 = off).
Lights texture (equirectangular).
Planet radius, metres (sets the size of the sparkle).
Procedural feature scale.
Sun-elevation sines where lights switch on (start, full).
1 = use the texture, 0 = procedural.
Ozone absorption per metre (RGB).
Ozone peak altitude, metres.
Ozone layer half-width, metres.
Planet radius, metres.
Rayleigh scattering per metre (RGB).
Rayleigh scale height, metres.
Apparent sun radius, radians.
Sun disc colour from the star's temperature (linear RGB).
Towards the sun (render space).
Sun disc radiance (HDR; drives bloom).
Sun radiance scale.
Local up at the camera (render space).
Suggested renderer.toneMappingExposure (smoothed); applied for you with lighting.autoExposure.
Altitudes of the atmosphere's layers for the home planet (scaled with its radius when scaleWithRadius).
The moonlight DirectionalLight.
0 by day … 1 at night, as a number (the TSL version is uniforms.night).
Lights. The sun DirectionalLight (size its shadow.camera to taste).
Near and far planes for the camera right now (see clipPlanes): pass the camera's height above the ground under it. With shells on, far reaches the outermost shell.
Cloud cover 0..1 at a render-space position right now (the same field the clouds are placed from).
Removes everything from the scene and frees GPU resources.
Centres the lights' shadow cameras on target (e.g. your orbit-controls target); null follows the camera.
Which atmosphere layer an altitude (metres; default: the camera's) is in.
Replaces all settings: anything not in input goes back to DEFAULT_SKY.
Merges settings (nested objects merge; arrays replace). The clock only jumps if clock.date changes.
Sets the city-lights field: a (latitude, longitude) => 0..1 callback (baked at
nightLights.resolution), an equirectangular texture (longitude 0 at the centre, south at the bottom),
or null for the procedural field.
Jumps to a local apparent solar time (hours, 12 = noon) on the current day, at the observer.
Next sunrise and sunset after now at the observer, as Dates (null in polar day/night).
Advances time and refreshes everything. Call once per frame, before rendering.
Optionaldt: number
Real seconds since the last frame. Omit to measure it.
StaticcreateCreates a sky and computes the first frame (lights and environment included).
A complete, physically based sky from the ground to orbit: Keplerian sun and moon, single-scattering atmosphere, moon phases, stars and Milky Way turning with sidereal time, shooting stars, and the lights, environment and fog that go with them.
Example