A real-time simulation of a supermassive black hole with an accretion disk, relativistic jets, and gravitational lensing. Everything you see is computed using actual physics — General Relativity, Schwarzschild spacetime geometry, and blackbody radiation.
Every galaxy is believed to harbor a supermassive black hole at its center, ranging from millions to billions of solar masses. When gas, dust, or even whole stars fall close enough, they form a swirling accretion disk that heats to millions of degrees — making the black hole visible across the universe despite the hole itself emitting no light.
Built entirely in a single HTML file with Three.js and WebGL shaders. No external assets, no server — everything runs in your browser.
Accretion Disk
The glowing ring of material orbiting the black hole. In reality, this is superheated gas (mostly hydrogen and helium) spiraling inward, heated by friction and compression to millions of degrees.
90,000 particles placed using fractal noise density for realistic clumping and structure.
Keplerian Orbits — inner particles orbit faster than outer ones, following Kepler's third law: v ∝ 1/√r. This differential rotation is what generates the friction that heats the disk.
Temperature Gradient — white-hot inner edge (closest to the event horizon) through yellow and orange to dim red at the outer edge. This matches real accretion disk physics where temperature ∝ r−3/4.
Doppler Beaming — the side of the disk rotating toward you appears brighter and slightly blue-shifted; the receding side appears dimmer and red-shifted. This asymmetry was clearly visible in the Event Horizon Telescope's images of M87* and Sagittarius A*.
Gravitational Redshift — photons emitted near the event horizon lose energy climbing out of the gravity well. The formula z = 1/√(1 − rs/r) − 1 means particles at the inner disk edge appear noticeably redder than their true temperature. Blue light is affected most strongly.
Event Horizon & Gravitational Lensing
The event horizon is the boundary beyond which nothing — not even light — can escape. The black sphere you see is actually the black hole shadow, which appears larger than the event horizon because light passing nearby gets bent inward.
Photon Sphere (r = 1.5 rs) — at this radius, light can theoretically orbit the black hole in an unstable circular path. Light that grazes this radius gets deflected by enormous angles, creating a bright Einstein ring.
Geodesic Ray Tracing (default, press L to toggle) — each pixel traces a light ray through curved Schwarzschild spacetime using the exact null geodesic equation: a = -(M/r³) × r̂ × (1 + 3h²/r²), where h is the photon's angular momentum. This naturally produces the correct shadow, photon ring, primary and secondary Einstein rings, and multiple images of background stars. For spinning black holes, Kerr frame-dragging twists rays: adrag = 2Ma*/(r³) × (ẑ × r̂), creating the asymmetric photon ring observed by the Event Horizon Telescope. 64 integration steps per pixel with adaptive step size and velocity Verlet integration.
Classic Lensing (press L) — the 25,000 particle-based background stars are warped by a screen-space post-process with deflection ∝ 1/b². Faster but less physically accurate — no secondary images or proper photon ring asymmetry.
Multiple Images — in geodesic mode, a single star behind the black hole can appear as TWO images on opposite sides (primary + secondary Einstein ring), because light can pass on either side of the photon sphere. Very close to the shadow edge, light wraps further around, creating increasingly compressed image copies — the "photon ring".
This uses the same fundamental physics as the rendering of Gargantua in Interstellar (Thorne & James, 2015) and Eric Bruneton's real-time black hole shader, though simplified for 60fps browser performance.
Relativistic Jets
Twin beams of plasma ejected along the black hole's rotation axis at velocities approaching the speed of light. Not all accreting black holes produce jets — the mechanism involves magnetic field lines twisted by the spinning accretion disk (the Blandford–Znajek process) or by the spinning black hole itself.
Jets can extend millions of light-years into intergalactic space, making them the largest single structures in the universe.
The jets contain plasma heated to billions of degrees, making them bright in X-ray wavelengths.
Charged particles spiraling in the jet's magnetic fields emit synchrotron radiation, which is why jets dominate in radio observations — try switching to Radio mode to see this effect.
In the simulation: 5,000 particles per jet, helically twisted, with blue-white core coloring.
Matter Infall
12 clumps of gas continuously spiral inward from the outer disk, accelerating as they fall deeper into the gravity well. They leave bright trails that fade as they cross the event horizon.
In reality, matter doesn't fall smoothly — turbulence, magnetic reconnection events, and instabilities create clumps and flares. The inner accretion flow is chaotic and variable, which is why real black holes "flicker" in brightness on timescales of minutes to hours.
Hawking Radiation
The faint flickering particles at the event horizon represent Hawking radiation — one of the most profound predictions in theoretical physics, proposed by Stephen Hawking in 1974.
How it works: Quantum mechanics says that even "empty" vacuum is actually seething with virtual particle-antiparticle pairs that pop into existence and annihilate each other almost instantly. Near the event horizon, something extraordinary happens: one particle can fall into the black hole while the other escapes. The escaping particle carries away real energy, and the black hole loses a tiny amount of mass.
Temperature — a black hole radiates like a blackbody with temperature T = ℏc³/(8πGMkB). Smaller black holes are HOTTER. A stellar-mass black hole (~10 M☉) has a temperature of ~6 nanokelvin — far colder than the cosmic microwave background. Only microscopic black holes would glow visibly.
Evaporation — over astronomical timescales, Hawking radiation causes black holes to slowly shrink and eventually evaporate completely. A stellar-mass BH would take ~1067 years. A supermassive BH: ~10100 years. The universe is only 1.4 × 1010 years old.
Information Paradox — if a black hole evaporates completely, what happens to the information about everything that fell in? This remains one of the deepest unsolved problems in physics, sitting at the intersection of quantum mechanics and general relativity.
In the simulation: 200 particles spawn just outside the event horizon, drift outward (the escaping particle), and fade with quantum-like flickering. The spawn rate increases when the horizon is smaller (higher Hawking temperature). Color shifts bluer for smaller horizons (hotter radiation). The effect is deliberately subtle — in reality, Hawking radiation from astrophysical black holes is undetectably faint, dwarfed by the cosmic microwave background by a factor of trillions.
Hawking radiation has never been directly observed, but analog experiments using sonic black holes in Bose-Einstein condensates have confirmed the theoretical mechanism.
Tidal Disruption Event (TDE)
Press T or Double-click to trigger one.
A TDE is one of the most violent events in the universe. It occurs when a star wanders too close to a supermassive black hole — typically through gravitational interactions with other stars in the dense galactic core.
What happens physically:
Approach — the star falls toward the black hole on a nearly parabolic orbit, accelerating as it descends into the gravity well.
Tidal Radius — at ~2.8 rs, the differential gravitational force across the star (stronger on the near side, weaker on the far side) exceeds the star's own self-gravity. The star can no longer hold itself together.
Spaghettification — the star is stretched along the radial direction and compressed perpendicular to it. It elongates into a thin stream of hot gas — the famous "spaghettification" coined by Stephen Hawking.
Debris Stream — roughly half the stellar mass gains enough energy to escape entirely. The other half forms a long, thin stream that wraps around the black hole, eventually circularizing into a temporary accretion disk.
Flare — the infalling debris heats to extreme temperatures, producing a brilliant flare visible across billions of light-years. The flare typically peaks in UV/X-ray and fades over weeks to months.
Observational history:
First well-confirmed TDEs were detected in X-ray surveys by ROSAT in the 1990s — sudden brightening in the centers of otherwise quiet galaxies.
Modern surveys (ZTF, LSST, eROSITA) now detect several TDEs per year.
TDEs are invaluable for astronomers — they briefly "light up" dormant black holes that would otherwise be completely invisible, revealing their mass and spin.
The tidal radius depends on black hole mass: for black holes above ~108 solar masses, Sun-like stars are swallowed whole because the tidal radius falls inside the event horizon.
In the simulation: 2,500 particles start clustered as a compact star, fall on a trajectory with angular momentum, get tidally stretched at the tidal radius (force ∝ r−3.5), and form an orbiting debris stream. Color evolves from white-blue (intact star) through yellow-white (disruption) to orange-red (cooling debris). Particles that reach r < 0.5 rs are absorbed. Sound design includes a rising pitch during approach and a filtered noise burst at disruption.
Time Dilation (dτ/dt)
In General Relativity, time flows slower in stronger gravitational fields. This isn't an illusion — it's a real, measurable effect. The dτ/dt value (proper time / coordinate time) shows how fast a local clock ticks compared to a distant observer's clock.
The formula is: dτ/dt = √(1 − rs/r)
Event Horizon (r = rs) → 0.000 — time completely stops as seen from outside. A clock falling toward the event horizon would appear to slow down and freeze at the boundary — its last photons redshifted into oblivion. From the clock's own perspective, it crosses normally.
ISCO (r = 3rs) → 0.577 — the Innermost Stable Circular Orbit. Below this radius, no stable orbit exists — any perturbation causes matter to spiral inward. This is the inner edge of the accretion disk. Time flows at 58% normal speed.
Inner Disk (r = 2rs) → 0.707 — matter here is on unstable plunging orbits. Extremely hot and fast. Time at 71%.
Outer Disk (r = 7.5rs) → 0.926 — nearly normal time. Gravitational time dilation is measurable but small at this distance.
Camera → varies — this is YOU. Zoom in and watch your clock slow down. At minimum zoom distance (~2.5 rs), you'd experience significant time dilation.
Distant Observer → 1.000 — infinitely far from the black hole. Normal time. This is the reference frame.
The blinking dots (●/○) next to each row tick at rates proportional to their time dilation factor. The distant observer blinks steadily. The ISCO dot blinks noticeably slower. The event horizon dot is essentially frozen. Zoom in and watch your camera dot slow down.
This same effect operates on Earth, just far weaker. GPS satellites orbit at ~20,200 km altitude where gravity is weaker — their clocks tick ~38 microseconds faster per day than ground clocks. Without relativistic corrections, GPS would drift by ~10 km per day.
Wavelength Modes
Real astronomers observe black holes across the electromagnetic spectrum. Each wavelength reveals different physics:
Visible — what your eyes would see (if you could survive). Blackbody thermal radiation from hot gas. The accretion disk glows orange-white to red based on temperature. This is the hardest band to observe because dust in galaxies blocks visible light.
X-Ray — how space telescopes like Chandra and XMM-Newton see black holes. Gas at millions of degrees emits X-rays. The blue-white palette reflects the extreme temperatures. Jets glow bright because they contain ultra-hot plasma. Most known stellar-mass black holes were first discovered in X-ray. The corona — a mysterious hot region above the disk — is brightest in X-ray.
Radio — how radio telescopes (VLA, ALMA, EHT) observe them. False-color red/yellow (radio has no "real" color). Jets become dominant because they emit synchrotron radiation — charged particles spiraling in magnetic fields at relativistic speeds. The Event Horizon Telescope's famous images of M87* and Sgr A* were captured at 1.3mm radio wavelength. Stars virtually disappear because stars are faint radio emitters.
Gravitational Waves
Ripples in the fabric of spacetime itself, predicted by Einstein in 1916 and directly detected by LIGO in 2015 — one of the greatest experimental achievements in physics history.
What they are: When massive objects accelerate — black holes merging, neutron stars colliding, stars being tidally disrupted — they send out ripples that literally stretch and compress space as they pass. These waves travel at the speed of light and carry energy away from the source.
Detection — LIGO/Virgo measure spacetime distortions of ~10−21 meters — a thousand times smaller than a proton. The first detection (GW150914) came from two black holes merging 1.3 billion light-years away.
Quadrupole radiation — gravitational waves squeeze space in one direction while stretching it perpendicular, oscillating back and forth. This is visible in the simulation as a screen-space distortion ripple.
Energy loss — gravitational waves carry enormous energy. The first detected merger radiated ~3 solar masses of pure energy in gravitational waves in a fraction of a second — briefly outshining the entire observable universe.
In the simulation: Press Space or trigger a TDE to emit gravitational wave rings. You'll see expanding distortion ripples in the screen (the composite shader warps the image) and the accretion disk particles physically wobble as the wave passes through. The disk oscillation shows how gravitational waves stretch and compress the matter they pass through. Up to 4 simultaneous waves with sub-bass sound (12-25 Hz rumble).
Particle Collisions & Shockwaves
The accretion disk is not a calm, smooth flow — it's a violent, turbulent environment. When streams of matter collide with the disk, they produce shockwaves and hot spots that ripple outward.
Matter Infall Impacts — when infalling gas clumps cross the disk plane, they collide with orbiting material. The collision heats the gas and produces an expanding shockwave ring visible as a bright ripple propagating through the disk.
TDE Debris Impacts — tidal disruption debris plowing through the disk creates larger, brighter shockwaves. Trigger a TDE and watch for bright flares as the debris stream intersects the disk.
MRI Turbulence — the Magnetorotational Instability (MRI) is the main driver of turbulence in real accretion disks. Magnetic field lines threading the disk get stretched by differential rotation, creating turbulent eddies that heat the gas. The simulation generates random hot spots to approximate this effect.
Impact Sparks — bright white-yellow particles burst outward from collision sites, then fade as the shocked gas cools.
Shockwave Rings — expanding rings of brightened disk particles that propagate outward from each impact. Particles in the wavefront grow temporarily brighter and larger, mimicking the density and temperature jump across a real shock front.
In real accretion disks, shocks are responsible for much of the observed X-ray variability — the rapid flickering seen in X-ray binaries comes from turbulent hot spots orbiting and colliding in the inner disk.
Visual Effects
Anamorphic Streaks — cinematic horizontal light streaks from the brightest regions, simulating an anamorphic lens flare. These are an artistic effect (not physical), created by 4 passes of ultra-wide horizontal blur at quarter resolution.
Bloom — bright regions bleed light into neighboring pixels, simulating how real cameras and eyes respond to intense light sources. 3-pass Gaussian blur with threshold extraction.
Chromatic Aberration — slight red/blue fringing at the edges of the frame, simulating imperfect optics.
Film Grain — subtle noise overlay for cinematic texture.
Ambient Sound — deep space drone built from detuned oscillators, proximity-reactive rumble, radiation noise hiss. The pulse (spacebar) triggers a sub-bass impact with metallic shimmer. TDE events have their own rising-pitch approach sound with a tearing noise burst.
Controls
Drag Orbit the camera around the black hole
Scroll Zoom in/out (affects time dilation!)
Space Gravitational pulse — visual + sound burst
123 Switch wavelength (Visible / X-Ray / Radio)
T or Double-click Trigger a tidal disruption event
Spin slider (bottom-right) Adjust black hole angular momentum a*
B Add a companion black hole (max 4, 5 total)
L Toggle between geodesic ray-traced and classic screen-space lensing
I Toggle this info panel
The Physics — Key Equations
This simulation uses the Schwarzschild metric — the exact solution to Einstein's field equations for a non-rotating, uncharged black hole, published by Karl Schwarzschild in 1916, just months after Einstein published General Relativity.
Schwarzschild radius: rs = 2GM/c² — the event horizon radius. For our Sun, this would be ~3 km. For the M87* black hole (6.5 billion solar masses), it's ~19 billion km.
Orbital velocity: v = √(GM/r) — Kepler's law. Inner disk particles orbit faster.
Gravitational redshift: z = 1/√(1 − rs/r) − 1 — photon energy loss climbing out of the well.
Time dilation: dτ/dt = √(1 − rs/r) — proper time versus coordinate time.
Photon sphere: r = 1.5 rs — where light can orbit (unstably) around the black hole.
ISCO: r = 3 rs — innermost stable circular orbit (for Schwarzschild; spinning black holes differ).
Black holes have only three measurable properties: mass, spin (angular momentum), and electric charge (negligible in nature). This is the "no-hair theorem" — all other information about the matter that formed the black hole is lost.
Spin is measured by the dimensionless parameter a* = Jc/GM², where J is angular momentum. It ranges from 0 (non-rotating, "Schwarzschild" black hole) to a theoretical maximum of 1 (an "extremal Kerr" black hole, where the event horizon rotates at the speed of light).
Why do black holes spin? For the same reason an ice skater spins faster when pulling in their arms — conservation of angular momentum. When a massive star collapses, or when gas spirals inward from an accretion disk, the angular momentum gets concentrated into a smaller and smaller space. Almost all real black holes spin, and many spin very fast.
Real spin measurements:
M87* (6.5 billion M☉, imaged by the EHT) — a* ≈ 0.9
Spin is measured by observing the inner edge of the accretion disk (which depends on ISCO radius), the shape of X-ray reflection spectra (iron line profile), and gravitational wave signals from merging black holes.
Kerr Black Hole — What Changes with Spin
Use the spin slider (bottom-right) to change a*. The simulation updates everything in real-time.
Event Horizon Shrinks
r+ = M(1 + √(1−a*²)). A non-spinning black hole has its horizon at the full Schwarzschild radius. At a*≈1, the horizon shrinks to half that size. You can see the black sphere physically get smaller as you increase spin. This is because the spinning spacetime "supports" the horizon at a smaller radius — loosely analogous to how a spinning top is more stable.
a* = 0.0 → r+ = 1.00 rs
a* = 0.5 → r+ = 0.93 rs
a* = 0.7 → r+ = 0.86 rs (default)
a* = 0.9 → r+ = 0.72 rs
a* = 0.998 → r+ = 0.53 rs
The Ergosphere
The purple-blue glow between the horizon and r=1.0. Inside this region, spacetime itself rotates so fast that nothing can remain stationary — not matter, not light, not even spacetime itself. Everything is forced to co-rotate with the black hole. It's oblate: at the equator it always extends to r=1.0 regardless of spin, but at the poles it touches the horizon. The rotating streaks visualize the direction of frame-dragging.
The ergosphere is where the Penrose process operates: in principle, you can extract energy from a spinning black hole by sending matter into the ergosphere and splitting it so one piece falls in while the other escapes with MORE energy than the original particle had. This is not science fiction — it's a proven consequence of General Relativity and may power real astrophysical jets.
Frame Dragging (Lense-Thirring Effect)
The spinning black hole drags spacetime with it, like a ball spinning in honey. Everything near the black hole gains extra angular velocity — the inner disk spins faster than Kepler's law alone would predict. The formula: ωfd = 2Ma*/(r(r²+a²M²)+2a²M³). Inner particles are dragged most.
This effect is real and measurable: NASA's Gravity Probe B (2004-2011) measured frame-dragging from Earth's rotation — a shift of just 37 milliarcseconds per year. Near a spinning black hole, the effect is billions of times stronger.
ISCO Moves Inward
The most visually dramatic effect. The Innermost Stable Circular Orbit (ISCO) — the inner edge of the accretion disk — depends on spin:
a* = 0.0 → ISCO = 3.00 rs (big gap between disk and horizon)
This is how astronomers measure spin in real black holes — by observing how close the inner disk edge gets. A closer inner edge means more gravitational energy is radiated before matter falls in. A maximally spinning BH can convert ~42% of infalling mass to energy (vs. ~6% for non-spinning). For comparison, nuclear fusion converts only ~0.7%. Spinning black holes are the most efficient energy sources in the universe.
Try dragging the slider from 0 to 0.998 — watch the inner disk region empty out at low spin and fill in completely at high spin.
Time Dilation Changes
All dτ/dt values in the HUD (bottom-left) recalculate in real-time using the Kerr metric. At higher spin, the ISCO is closer to the horizon, so time there flows much slower. The blinking clock dots update accordingly.
Multiple Black Holes & Mergers
Press B to add a companion black hole (up to 4 companions + the primary = 5 total). Each companion orbits the primary under full N-body gravitational dynamics.
What happens:
N-body Gravity — every black hole feels gravitational attraction from every other. Companions orbit the primary and interact with each other, producing complex dynamics including three-body chaos.
Disk Perturbation — companion BHs gravitationally tug on disk particles as they pass through. You can see the disk warp near a passing companion — spiral arms and density waves form.
Gravitational Lensing — each companion produces its own Einstein ring and shadow in the starfield. Multiple overlapping lensing patterns create complex distortions.
Orbital Trails — each companion leaves a fading trail. Chaotic orbits produce spirograph-like patterns.
Inspiral — close-orbiting pairs emit gravitational waves, losing energy and spiraling inward with increasing orbital frequency (the LIGO "chirp").
Merger — when two BHs touch, they merge with a massive gravitational wave burst, spark shower, and characteristic chirp-then-ringdown sound.
Real multi-BH systems: OJ 287 is a confirmed binary SMBH (150M M☉ orbiting 18B M☉, 12-year period). The Milky Way–Andromeda merger in ~4.5 billion years will produce a binary SMBH. Three-body BH interactions are genuinely chaotic. LIGO has detected dozens of BH-BH mergers since 2015.
In the simulation: Companions have random mass (0.15–0.35× primary), spin, and orbital parameters. N-body gravity with GW energy loss drives inspiral. Void mask and lensing shaders support 4 companion shadows and Einstein rings simultaneously.
Simplifications & Known Limits
This simulation prioritizes visual accuracy and real-time performance over full GR ray-tracing. Notable simplifications:
Gravitational lensing in geodesic mode uses the Schwarzschild metric with first-order Kerr frame-dragging correction. Full Kerr null geodesics (Carter constant, separate prograde/retrograde critical curves) would produce more accurate asymmetric shadow shapes at extreme spin. The classic mode uses screen-space 1/b² distortion.
The accretion disk is geometrically thin. Real disks can be thick (ADAF/RIAF at low accretion rates) or slim (at super-Eddington rates).
TDE timescales are compressed — real events unfold over weeks to months, not seconds.
No magnetohydrodynamics (MHD) — magnetic fields play a crucial role in jet formation (Blandford-Znajek process), disk turbulence (MRI instability), and angular momentum transport.
The Penrose process and superradiance are not simulated — only the visual ergosphere is shown.
Retrograde orbits are not modeled — all disk particles orbit prograde.
drag to orbit · scroll to zoom · space to pulse · 1/2/3 wavelength · T disruption · B add black hole · L toggle lensing · I info