Sun model
Running
A computed Sun: temperature, colour and structure from physics, not from a texture.
- effective temperature
- 5,772 K
- lines of JavaScript
- 1,074no dependencies
- GPU frame
- 1.4 msvs ~40 ms on the CPU path
- max surface texture
- 2048 px
Sun model in short
One dependency-free module renders the photosphere and corona. Temperature per pixel follows the Eddington–Barbier relation, intensity follows Stefan–Boltzmann, and colour comes from integrating the Planck spectrum against the CIE 1931 curves. It is a model of the physics, not a picture of the Sun as it is today.
What works, and what does not
- Limb darkening from the Eddington–Barbier relation at an effective temperature of 5,772 K
- Colour from the Planck spectrum integrated against CIE 1931, converted to sRGB
- Differential rotation (Snodgrass–Ulrich) and bipolar sunspot groups following Joy's and Hale's laws
- Corona from dipole field lines: closed lines make streamers, open ones plumes and coronal holes
- Key A: sunlight as filtered through Earth's atmosphere; key C: coronagraph
- It is a physical model of a typical Sun, not a view of today's Sun and not a forecast.
- If WebGL is emulated or slow, it falls back to a CPU renderer.
What had to be got right
Physics, not paint
Every pixel's colour comes from a temperature and a spectrum, so zooming in shows more detail rather than a bigger blur.
Self-protecting performance
The shader frees its WebGL context on destroy, and a frame-time check drops to the CPU renderer on machines where WebGL exists but is slow.
Legibility measured
When used as a page background, text contrast was measured pixel by pixel against WCAG thresholds, not judged by eye.
Related projects
Terra
A civilization simulation in continuous time on a real sphere — no turns, no visible hex grid.
Open →Music Atlas
41 musical styles generated live in the browser, from tuning data rather than samples.
Open →Epoch Ascendant: Civilizations
A turn-based 4X strategy game on a hexagonal globe, from a Paleolithic camp to the Information Age.
Open →Figures describe this project's own build at the time of writing, not a promise of anything else. All projects and statuses.