Procedural sky renderer for xeokit V3.

Integrated into RenderManager and drawn once per frame via render(viewRenderState) when enabled is true.

Features:

  • Three-band gradient: zenith sky → horizon → ground
  • Optional sun disc and radial glow
  • Horizon haze brightened toward the sun
  • Coordinate-system-aware via worldUp
  • No textures needed — all procedural in GLSL

The sky is drawn as a fullscreen quad before any scene geometry, so it always appears as the background regardless of scene content.

const sky = renderManager.sky;
sky.enabled = true;
sky.skyColor = [0.28, 0.52, 0.93];
sky.sunDirection = [0.6, 0.4, 0.7];

Constructors

Properties

destroyed: boolean = false

True once destroy() has been called.

enabled: boolean = false

When true, RenderManager will render this sky each frame before scene geometry.

groundColor: [number, number, number]

Below-horizon ground color.

horizonBlend: number

Angular width of the horizon blend band (elevation units, ~0–1). Default 0.15.

horizonColor: [number, number, number]

Horizon color.

initialized: boolean = false

True once init() has successfully allocated resources.

skyColor: [number, number, number]

Sky zenith color.

sunAngularSize: number

Angular diameter of the sun disc in degrees.

sunColor: [number, number, number]

Sun disc and corona color.

sunDirection: [number, number, number]

World-space direction toward the sun (need not be normalized).

sunEnabled: boolean

Whether to render a sun disc and glow.

sunGlowIntensity: number

Peak intensity of the sun glow.

sunGlowSize: number

Glow falloff exponent. Higher = tighter glow around the sun disc.

worldUp: [number, number, number]

World-space "up" direction. Matches the Scene's CoordinateSystem.worldUp. Default is [0,0,1] (Z-up), matching the Scene default.

Methods