I built a black hole desktop overlay in Rust: per-pixel Schwarzschild geodesics over a live desktop capture (wgpu + winit)

125 points GreenScreen410 25 comments

https://i.redd.it/6yebpcbqwydh1.gif

It sits on top of your desktop as a fullscreen click-through overlay, captures the screen, and lenses it through a real geodesic integrator in a WGSL shader. Windows bend, stretch and wrap around the event horizon, and a tilted Keplerian accretion disk arcs over and under the shadow.

Inspired by ghostty-blackhole, which does this inside a terminal.

Bits that might interest Rust folks:

- The physics runs in the fragment shader: each pixel near the hole integrates u'' = -u + 1.5u^2 with a leapfrog scheme, ~48 steps. Far pixels use an analytic weak-field formula with a seamless handoff.

- There is a macOS port using the objc2 ScreenCaptureKit bindings. It is fully type-checked from Linux (the bindings are pure Rust declarations) but has never run on real hardware, because I do not own a Mac. If you have one, I would love a test report.

Happy to answer anything about the shader or the capture pipeline.

GreenScreen410/singularity