Singularity

Singularity

A real-time, physically accurate black-hole renderer. Each pixel of each frame integrates a null geodesic backwards through curved spacetime: a photon launched from the camera, traced through the Schwarzschild or Kerr metric, until it falls through the event horizon, intersects the accretion disc, or escapes to the celestial sphere. The full geodesic equation runs in the compute kernel. No precomputed lensing tables, no screen-space approximations.

Four GPU backends share a single C++ physics core: Metal on macOS, Vulkan on Windows and Linux, WebGPU in the browser, CUDA for offline supersampled stills.

Kerr black hole at a/M = 0.94 rendered offline by the CUDA backend at 4K, 256 samples per pixel via Halton(2,3) subpixel jitter, downsampled for the docs hero. Asymmetric photon ring from frame dragging; Doppler-bright on the approaching side; gravitationally redshifted on the receding side.

Live demo

The demo runs the same Hamiltonian Kerr integrator as the desktop backends, compiled to WebAssembly via Emscripten and dispatched against the browser’s WebGPU device. Drag the canvas to orbit; scroll to zoom; use the panel on the right to switch metric, change spin, and tune disc and cinematics parameters live.

Requires a WebGPU-capable browser: Chrome or Edge 113+, Safari 17.4+, or Firefox Nightly with dom.webgpu.enabled.

Documentation

Source: github.com/mal0ware/Singularity.