Feature Library

Physical sky

3.37 GPU · 0.36 CPU ms
A still of the Physical sky demo
Still
The live demo starts when it’s in view.Drag to look around · wheel or + − to zoom · Play a day

A sky worked out from the air itself on WebGPU (the same passes on WebGL2 where it is missing).

What it costs a frame

3.37 ms
0.36 ms
GPU
3.37 ms
CPU, median
0.36 ms
CPU, 95th pct
0.51 ms
Draw calls
0
Weight
Heavy

Measured 11 November 2026 on 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Plays the day on a loop (the view following the sun), so every frame rebuilds the sky-view table and the probe and draws the sky at the stage’s size; timed with its own timestamp queries. At rest it draws nothing. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
unknown GPU · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring tool3.370.360.51
apple · Apple A19 Proin a browser tab · 16 November 20269.570.600.80
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20261.510.600.86

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
WebGPU or WebGLWebGPU where there is one, WebGL2 where there is not.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages

What it’s for

  1. Outdoor scenes and games
  2. Time-of-day and weather systems
  3. Architectural and product renders
  4. Backdrops for hero sections
  5. Lighting a scene from its sky
  6. Flight and space views

Pitfalls, in brief

  1. Units are kilometres inside and the sun’s light above the air is 1: SkyLight values are relative to it, so scale your lights’ intensities to taste, not the sky.
  2. The tables are half floats stored × 1024: twilight’s light is a thousandth of noon’s, and without the scale its gradients band.
  3. Tone mapping writes display-ready values for an 8-bit, non-sRGB target (the canvas’s preferred format).
  4. draw() returns false while the last frame is still on the GPU and does not touch the canvas then: keep your dirty flag set and try next frame, or the canvas shows a blank frame.
  5. The light comes back a frame or two after the sun moves (a GPU read-back).
3 more in brief
  1. The ground is a sphere at the eye’s height minus its height: drawing your own terrain over it, keep depth and draw the sky first (or under everything with no depth).
  2. Without WebGPU, createPhysicalSkyGL draws the same sky on WebGL2 from sky-glsl.ts, a line-for-line twin of the WGSL: change one and change the other.
  3. Auto exposure holds a floor at night so night stays dark; turn it off and set exposure yourself for a fixed look (about 10 by day).
8 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From SpaciousPro. Fully custom code.

Sébastien Hillaire, A Scalable and Production Ready Sky and Atmosphere Rendering Technique (2020): The method: the transmittance, multiple-scattering and sky-view tables, the energy-conserving step, the sky-view table’s rows and Earth’s scattering values.

Eric Bruneton & Fabrice Neyret, Precomputed Atmospheric Scattering (2008): The transmittance table’s parametrisation (distance to the top against height), as in Bruneton’s 2017 revision; re-written here.

Krzysztof Narkowicz, ACES Filmic Tone Mapping Curve (2016): The tone curve’s fit, as the source has it.

Cornette & Shanks (1992): The Mie phase function.

Mark Jarzynski & Marc Olano, Hash Functions for GPU Rendering (2020): Their pcg3d places the stars and dithers the output.

skyatmospherescatteringtime of dayraw webgpuwgslglslwebgl2 fallbacktone mappinglighting

Near it in the frame