--- name: procedural-sky description: > Graded Preetham dome, ray-marched cumulus and a night sky in one Three.js WebGPU file. Use when changing the sky demo. The reference file is sky.html beside this skill. If they disagree, the HTML wins. --- # Procedural sky One HTML file. No bundler. Three.js 0.186.1. `three` and `three/webgpu` both point at `three.webgpu.js`. `three/tsl` at `three.tsl.js`. `three/addons/` is there for `SkyMesh`. `WebGPURenderer` only. `renderer._getFallback = null` before `init()`. If `navigator.gpu` is missing, or the backend is not WebGPU after `init()`, stop. Open it through a server. `file://` will not load the ES modules. ## Invariants - One dome. `SkyMesh`, scale 1700, camera far 1800. `depthTest` and `depthWrite` stay false. `renderOrder` stays -1. `material.fog` stays false. Stock `cloudCoverage` stays 0. - Capture `colorNode` before replacing it. The knee is 0.75 / 0.15. - `scene.background` and `scene.fog.color` are the same `Color` object. The haze uniform wraps that object. - Shell intersection uses `2Rh + h^2`. Planet radius stays 4e6. - Lacunarity stays exactly 2. Wind wrap stays 100 km. Weather, shape and detail frequencies stay 0.00004, 0.00032 and 0.0021. - The march stays in the dome pass. It does not run below the horizon, and it stops when cover is under 0.02. Primary steps 20, light steps 4, path cap 22 km, empty-air stride 1.6. - Stars are not stamped into the equirect. The band is the canvas, baked at 1024 by 512 so the iframe stays light. Dots are analytic. The note describes the 2048 by 1024 bake used in the game. - This page does not bake a PMREM and does not cast shadows. There is no ground mesh and no cloud shadows. Pixel ratio stays 1. The loop stops when the frame is off screen. - The cover slider writes cloud cover, with a short ease. It does not use the game's 30 second storm blend or the 0.22 floor. The time slider sets the time of day. The clock does not run. - Drag right turns the view with the cursor, the same way `OrbitControls` does. A later note will cover photographed skies. This demo stays the procedural dome.