# Procedural Volumetric Sun

A real-time procedural star in a single `index.html`. It uses raw WebGL2 and needs no libraries, assets or build step. Open the file directly, or serve the folder with something like `python3 -m http.server`.

## What's rendered
- **Photosphere:** animated granulation from domain-warped 3D cellular noise plus fBm. Includes differential rotation, sunspots with umbra and penumbra in latitude belts, faculae, and quadratic limb darkening with reddening toward the limb.
- **Corona:** volumetric raymarch through a shell around the star, with noise-driven streamers flowing outward.
- **Prominences and flares:** magnetic loops raymarched as noisy emissive or absorbing tubes. Eruptive loops swell and lift off as arches, and produce white-hot flare flashes at their footpoints.
- **Post-processing:** HDR render target, 5-level bloom pyramid, ACES tonemapping, vignette. Render resolution adapts automatically to keep the frame rate up, which matters on software WebGL.

## Controls
| Input | Action |
|---|---|
| Drag (mouse / one finger) | Orbit the camera |
| Mouse wheel / pinch | Zoom |
| **Temperature** slider | Star colour: red dwarf (2500 K) to blue O-type (16000 K) |
| **Turbulence** slider | Convection warp, granule churn and streamer strength |
| **Flare intensity** slider | Prominence brightness, eruption size and flare flashes |
| **Corona** / **Bloom** sliders | Corona density and glow strength |
| Auto orbit checkbox | Camera drifts and orbits by itself; resumes 4 s after you stop interacting |
| Demo presets checkbox | Cycles through star presets every 13 s (turns off when you move Temperature, Turbulence or Flare) |
| `Space` | Toggle the whole demo (auto orbit + presets) |
| `R` / New seed | New sunspot and prominence layout |
| `C` / Reset view | Reset the camera |
| `H` | Hide or show the UI |

## Idle auto-play
With no input, the page starts animating immediately: the camera orbits, the presets cycle, and the plasma, corona and eruptions keep running.
