QuasiPITech Contact
Physical simulation

Sun model

Running

A computed Sun: temperature, colour and structure from physics, not from a texture.

WebGL2GLSLJavaScriptAstrophysics
Illustration for Sun model
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
What it is

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.

Status

What works, and what does not

Works today
  • 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
Not ready yet
  • 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.
Under the hood

What had to be got right

01

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.

02

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.

03

Legibility measured

When used as a page background, text contrast was measured pixel by pixel against WCAG thresholds, not judged by eye.