Skip to content

Presets

A preset is a serializable SkyParams object containing all visual parameters. Sky Pro includes eight presets: partlyCloudy, stunningSunset, thunderstorm, stormyEvening, moonlitNight, fluffy, hazy, and pixar.

Presets do not provide textures. moonlitNight adjusts star brightness when SkySystem was created with a nightSky panorama; otherwise, stars remain disabled.

You can also create a preset directly or export one from the demo.

typescript
import { PRESETS } from "threejs-sky-pro";

await sky.applyPreset(PRESETS["stunningSunset"]);

A preset specifies every field and replaces the current visual state. To create a variation, copy a bundled preset and override selected fields:

typescript
import { PRESETS, type SkyParams } from "threejs-sky-pro";

const lowSun: SkyParams = {
  ...PRESETS["partlyCloudy"],
  sun: { ...PRESETS["partlyCloudy"].sun, elevation: 5 },
};

await sky.applyPreset(lowSun);

Await applyPreset before rendering or reading the new state.

Presets do not include the quality tier, environment-map settings, or god-ray step count. Configure performance separately with setQualityLevel.

The demo's Export Settings button writes the current sky as SkyParams JSON. Use it to tune a look visually and save the result.

Reading The Sky Back

sky.toParams() returns the current visual state as SkyParams. Use it to create a preset at runtime or to save and restore settings:

typescript
const saved = sky.toParams();

await sky.applyPreset(PRESETS["thunderstorm"]);
await sky.applyPreset(saved); // back to where it was

// It is plain data, so it serializes.
localStorage.setItem("my-sky", JSON.stringify(saved));

The result contains copies of colors and the weather profile. JSON serialization converts THREE.Color values to hexadecimal numbers; reconstruct those colors before applying parsed JSON.

See Also

Commercial License - All Rights Reserved.