HomeSpace & AstronomySolar Flare & CME

☀️ Solar Flare & CME

Interactive solar flare simulation: shear an active-region magnetic field, trigger reconnection to release a flare (A/B/C/M/X class) and a CME that hits Earth.

Space & Astronomy3DAdvanced60 FPS🌍 Earth⚡ Plasma
solar-flare ↗ Open standalone

About this simulation

This sandbox renders solar flares and CMEs entirely as a GPU fragment shader, with no grid-based magnetohydrodynamics solver underneath. Six-octave fractal value noise (fbm), domain-warped through itself twice (plasma), fakes seething photospheric granulation, coloured by a blackbody-style ramp biased by the Plasma temperature slider. A sunspot anchors several parabolic magnetic loop arcs — their count set by Loop complexity — each rendered by measuring per-pixel distance to the parabola and converting it into an exponential glow. Pressing Erupt! drives a single 4-second rise-hold-decay envelope that raises the loops, ignites a reconnection flash, and unmasks a radial CME plume streaking outward. Separately, a JavaScript power-law converts the Magnetic activity slider into a real NOAA A-through-X flare classification.

What it shows

A procedurally rendered active region: granulating plasma, a sunspot, several magnetic loop arcs, and — on trigger — a reconnection flash plus an outward-streaking CME plume, alongside a live A/B/C/M/X flare classification computed from the activity slider.

How to use it

Raise Magnetic activity to store more "energy" (and push the flare class toward X), adjust Loop complexity for more arcs and Plasma temperature for a cooler-to-white-hot colour ramp, then click Erupt! to fire the 4-second eruption envelope. Reset returns every slider to its default.

Did you know?

The flare-class letters (A, B, C, M, X) used here are the actual NOAA/GOES X-ray flux scale, where each letter is a ten-fold jump in peak flux — an X-class flare is 10,000× brighter in X-rays than an A-class one.

Frequently Asked Questions

What actually determines the flare class shown in the stats panel?

The Flare class and X-ray flux stats come from a single JavaScript formula, not from the shader: flux = 10^(-8 + 5·a), where a is the Magnetic activity slider (0-1), nudged up by 45% of the current eruption envelope while Erupt! is playing. That flux is then bucketed into the real NOAA scale — A (10⁻⁸ W/m²) through X (10⁻⁴ W/m²) — with each letter a ten-fold step, exactly like real GOES X-ray sensor classifications.

Does the CME actually travel through space with real orbital physics?

No — inside this sandbox the CME is a GLSL shader effect, not an orbital-mechanics calculation. Pressing Erupt! ramps a single uFlareTrigger uniform from 0 to 1 and back over 4 seconds; that value drives a bright plume rendered as a radial glow shooting away from the active region along the sunspot-to-sun-centre direction. The 1-3 day transit time and Kp-index storm strength described in the info panel are real space-weather facts used for context, but they are not computed by this particular simulation's code.

How are the magnetic loops in the visualization actually drawn?

Each loop is a parabolic arc between two footpoints straddling the sunspot, evaluated per-pixel by a loopArc() function in the fragment shader: it finds how far a screen point is from the parabola y = baseY + height·4t(1-t) and turns that distance into a glow via an exponential falloff. The Loop complexity slider sets how many of these arcs are drawn (1-9), each with slightly different height and pulsing brightness, and their height grows further while the eruption envelope is active.

Why does the sun's surface look like it's boiling?

That granulation is procedural value noise, not a fluid simulation: a fbm() function layers six octaves of a hashed value-noise field, and a plasma() function domain-warps that noise through itself twice to fake turbulent, curling flow. The result is scaled by a limb-darkening term (dimmer near the disc's edge, brighter toward its centre) and pushed through a blackbody-style colour ramp (hotRamp) whose bias is set by the Plasma temperature slider, which is why raising it shifts the surface from deep red toward white-hot.

What exactly happens when I click Erupt!?

Erupt! starts a 4-second envelope in JavaScript: the value rises linearly from 0 to 1 over the first 0.72s, holds at 1 until 1.8s, then decays linearly back to 0 by 4s, disabling the button meanwhile. That single number (uFlareTrigger) is fed to the shader, where it simultaneously raises the magnetic loops higher, brightens an exponential "reconnection flash" kernel centred on the active region, and unmasks a radial CME plume that streaks outward — all three effects switch on and off together because they share the same driving value.

⚙ Under the hood

Magnetic reconnection on the Sun releases stored energy as a flare (classed A-X by X-ray flux) and a coronal mass ejection that travels to Earth in 1-3 days, sparking geomagnetic storms and aurorae.

SpaceSolar FlareCMEMagnetic ReconnectionSpace Weather

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)