🌞 Solar Wind & Earth's Magnetosphere — Bow Shock, Magnetopause, Aurora
Simulate the interaction between the solar wind and Earth's magnetic dipole. Watch particles deflect at the bow shock and magnetopause, observe magnetic reconnection when IMF Bz is southward, and see aurora precipitation zones light up at the poles.
About the Solar Wind & Magnetosphere Shader
This simulation renders Earth's magnetosphere as a single real-time GLSL fragment shader — there is no particle system, only closed-form geometry evaluated per pixel. Each frame, a magnetopause standoff distance r0 is derived from the solar wind's dynamic pressure (density × (speed/400)²) and Earth's dipole strength, then swept into a Shue (1997)-style boundary r = r0·(2/(1+cosφ))0.58, with the bow shock traced at 1.32×r0. Fractal Brownian motion (fBm) noise advects the plasma stream and bends it around the dayside boundary, while a wedge-shaped magnetotail stretches away from the Sun. A synthetic Kp index, driven by wind speed and storm/CME activity, brightens two auroral ovals near the poles.
What You're Looking At
What it shows
Bow shock, magnetopause, magnetosheath, and a stretched magnetotail — all traced from closed-form boundary equations rather than simulated particles. Two auroral ovals brighten near the poles when the synthetic Kp index climbs.
How to use it
Drag wind speed, Earth field strength, wind density, and storm/CME activity to reshape the magnetosphere in real time. Hit Solar storm! to spike activity to maximum and watch it decay back to baseline over the following seconds.
Did you know?
During severe geomagnetic storms the real magnetopause can compress inside geostationary orbit (~6.6 Earth radii), briefly exposing communications satellites to unshielded solar wind plasma — exactly the compression this shader's standoff formula models.
Frequently Asked Questions
What is the Shue magnetopause model used here?
The shader's magnetopause(phi, r0) function implements a Shue (1997)-style boundary, r = r0·(2/(1+cosφ))α with α = 0.58, where φ is the angle from the Sun–Earth line and r0 is the subsolar standoff distance. A guard clamps the denominator max(1+cosφ, 0.18) near the tail to avoid a singularity as φ approaches π. The bow shock reuses the same formula with r0 scaled by 1.32, since the shock stands further upstream than the magnetopause itself.
Why does the magnetopause shrink when I increase wind speed or density?
The standoff() function computes a dynamic pressure term press = density × (speed/400)², then sets r0 = 0.42 × (fieldStrength / (press × storm))1/6, clamped between 0.16 and 0.62 screen units. Because press sits in the denominator under a sixth root, faster or denser wind raises the pressure and shrinks r0 — a soft echo of the real pressure-balance relation that sets Earth's actual magnetopause distance.
How is the synthetic aurora Kp value calculated?
Two related formulas run in parallel: the on-screen readout uses kpLevel() = storm×7 + ((speed−300)/500)×2, clamped to 0–9 to mimic the real geomagnetic Kp scale, while the shader itself computes kp = 0.3 + storm×0.9 + ((speed−300)/500)×0.4 to set how strongly the two polar auroral ovals brighten. Both rise with storm/CME activity and solar wind speed, so pushing either slider — or hitting Solar storm! — lights the poles up faster.
Is this a real particle simulation of the solar wind?
No — the entire scene, including the Sun's glow, the plasma stream, the bow shock and magnetopause arcs, the magnetotail, Earth, and the aurora, is painted analytically inside one GLSL fragment shader running on a full-screen quad. Fractal Brownian motion (fbm) noise gives the plasma its turbulent, flowing look, but there are no individual charged particles being integrated through a magnetic field — the boundaries and glow are closed-form functions of position and time.
What shapes the magnetotail on the night side?
The tail half-width is tailHalf = r0 × (0.95 + 0.25×fieldStrength), and a night-side mask restricts the tail to the side of Earth away from the Sun (where d.x is negative). Within that wedge, a brighter "plasma sheet" glow is drawn at the tail's centreline, its intensity modulated by the same fbm noise function used for the upstream solar wind, so the tail shimmers rather than appearing as a flat triangle.
Particle simulation of the solar wind interacting with Earth's magnetic dipole. Bow shock, magnetopause (Shue model), magnetosheath, and aurora when IMF Bz turns southward.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install