THREE.JS / FOUNDATIONS 130

Design the sky. Bake the light.

A procedural sky is a backdrop mesh, not automatically an image-based light. Tune the analytic atmosphere, capture it as a cubemap, and compare the derived PMREM with direct sun lighting and explicit material ownership.

Initializing -

Creating the backend-specific Sky/SkyMesh, capture target, and lighting contracts.

backend
-
sky model
-
lighting
-
background
-
Tune the atmospheremodel -> capture -> derive -> shade
Procedural atmospherewaiting
model
-
material
-
scale
-
sun vector
-
sun disc
-
clouds
-

Sky/SkyMesh renders an analytic skydome; it is not scene.environment by itself.

Cube capturewaiting
target
-
size
-
format
-
GPU type
-
mapping
-
disc policy
-

The cube camera captures the sky with the sample objects hidden; hiding the solar disc avoids PMREM hot pixels.

Derived environmentwaiting
target
-
size
-
mapping
-
owner
-
textures
-
state
-

PMREM stores roughness-aware radiance; choose Scene.environment or material.envMap to consume it.

Backdrop onlybackground is not light

The skydome remains visible while the physical object receives no derived environment.

Scene.environmentscene-wide PMREM

Physical materials inherit the filtered sky map unless they own an explicit envMap.

material.envMapexplicit PMREM

The object owns the filtered sky map and bypasses Scene.environment ownership.

Direct sunDirectionalLight

Analytic sky appearance and direct illumination are separate contracts.

Scene + suncombined lighting

Use PMREM for image-based fill and a directional light for a crisp key.

Capture and render timingwaiting
sky update ms
-
cube ms
-
PMREM ms
-
CPU avg
-
CPU p95
-
capture faces
-

Rebuild the PMREM, choose a lighting contract, then sample post-conversion shading.

atmosphere paramsSky / SkyMeshCubeCameraPMREM CubeUVPBR contract

The visible Sky/SkyMesh can be tuned continuously, but changing the atmosphere does not change the already-baked PMREM until capture + rebuild runs again. The capture policy demonstrates why a solar disc is usually hidden during environment-map generation.

Sources: Sky · Scene · PMREMGenerator · GroundedSkybox · official WebGPU Sky example · official WebGL Sky example