$npx -y skills add scottstts/Threejs-Awesome-Graphics-Agent-Skills --skill threejs-atmosphere-aerial-perspectiveImplement physically motivated sky and aerial-perspective systems in Three.js. Use for planetary atmospheres, ground-to-space transitions, Rayleigh/Mie scattering, precomputed LUTs, depth-based transmittance and inscattering, sun/moon discs, and atmosphere-aware lighting.
| 1 | # Atmosphere and Aerial Perspective |
| 2 | |
| 3 | Treat sky rendering and aerial perspective as two views of the same scattering model. They must share radii, density profiles, coefficients, sun direction, exposure scale, and coordinate transforms. |
| 4 | |
| 5 | ## Choose the implementation tier |
| 6 | |
| 7 | - Small scene with no orbital camera: analytic height/distance approximation. |
| 8 | - Planetary ground-to-space camera: ray integration or precomputed LUTs. |
| 9 | - Large geospatial world: LUTs plus world-to-planet transform, altitude correction, and depth-aware aerial perspective. |
| 10 | |
| 11 | Read [references/atmosphere-system-contract.md](references/atmosphere-system-contract.md) |
| 12 | before implementation. It separates the LUT/ellipsoid architecture from |
| 13 | dynamic integration and the shell/post handoff. |
| 14 | |
| 15 | Read the [LUT sky and aerial-perspective entry](examples/lut-aerial-perspective/atmosphere-effect.js) |
| 16 | and its `source/` modules for the SkyMaterial, SkyLightProbe, |
| 17 | SunDirectionalLight, AerialPerspectiveEffect, precomputed-texture loader, |
| 18 | sun/moon direction, lens flare, tone mapping, and dithering path used by the |
| 19 | LUT example. |
| 20 | |
| 21 | ## Required outputs |
| 22 | |
| 23 | - sky radiance; |
| 24 | - sun transmittance/color; |
| 25 | - segment transmittance from camera to visible surface; |
| 26 | - segment inscattering; |
| 27 | - optional sky irradiance for materials; |
| 28 | - explicit scale conversion between world units and atmosphere units. |
| 29 | |
| 30 | ## Failure conditions |
| 31 | |
| 32 | - sky and terrain haze use different sun directions or coefficients; |
| 33 | - the atmosphere is a uniformly transparent sphere; |
| 34 | - camera altitude is measured in a local flat frame during orbital motion; |
| 35 | - scene depth is treated as linear when it is not; |
| 36 | - exposure is used to hide incorrect radiance scale; |
| 37 | - atmosphere fades abruptly at shell entry. |
| 38 | |
| 39 | ## Routing boundary |
| 40 | |
| 41 | This skill owns molecular/aerosol sky scattering and surface-segment aerial |
| 42 | perspective. Use `$threejs-volumetric-clouds` for weather-shaped cloud density, |
| 43 | temporal cloud reconstruction, and cloud shadows. |