SwiftUI interface
The app shell, helper menu, settings, background picker, clock overlay controls, and video export panel are written in SwiftUI.
Technology
Blackhole is a native macOS app built with SwiftUI and Metal. It combines per-pixel lensing, procedural accretion-disk emission, panoramic NASA sky maps, and adaptive quality controls to keep the scene responsive while preserving the recognizable black hole look.
The app is designed as a cinematic visual simulator. It uses physically inspired approximations rather than a full scientific general-relativity or radiative-transfer solver.
Render Loop
The app shell, helper menu, settings, background picker, clock overlay controls, and video export panel are written in SwiftUI.
The simulation view is backed by Metal, allowing the black hole scene to be rendered directly on the GPU at interactive frame rates.
Offline MP4 export renders frames with a fixed timestep, then writes them through AVFoundation using HEVC or H.264.
NASA images, custom folders, thumbnails, settings, and generated video exports stay on the user's Mac.
Rendering Model
Mouse-look, auto-hover, flyby, zoom, disk rotation, selected background, and computation mode are packed into a small uniform block for the GPU.
The fragment shader traces a ray from the camera through the black hole field. Near the center, the ray curves enough to reveal the far-side accretion disk and the lensed sky behind it.
The disk is rendered procedurally with density falloff, noise, Doppler-style brightness asymmetry, color ramps, and optional higher-detail turbulence for more chaotic structure.
Curated NASA images are stitched into panoramic sky maps. After a ray exits the black hole region, its final direction samples the background texture so the backdrop appears gravitationally bent.
Performance Strategy
Quality Modes
Optimized for interaction. The app balances image quality, latency, GPU time, and battery use while the user drags, zooms, opens menus, or changes backgrounds.
Optimized for smooth final output. Export can render frames one by one with a stable camera path, selected background queue, and higher quality settings before encoding the MP4.
Visual Honesty
Blackhole aims to make gravitational lensing and accretion disks feel vivid on a desktop Mac. It is inspired by black hole physics, but it is not a replacement for scientific simulation tools used in astrophysics research. The binary black hole mode is experimental and intentionally tuned for visual exploration.