Real-time, interactive black hole visualization written in Rust
This project simulates an accretion disk, particle heating, and stylized spacetime curvature (grid warping) around the black hole, complete with camera controls.
- Accretion Disk Animation: Particles orbit around the black hole with relativistic time dilation effects.
- Doppler Shift Rendering: Colors shift based on relative motion using simplified relativistic formula.
- Temperature-Driven Emission: Particles emit light based on dynamic heating models (gravitational, magnetic, and tidal).
- Spacetime Warping Grid: A visible mesh is distorted according to Schwarzschild radius curvature.
- Configurable Black Hole Parameters: Mass, spin, and scale are adjustable in code.
- Camera Controls: Zoom, rotate, tilt, and toggle auto-rotation in real time.
- Background stars: Static star field for reference.
W
: Zoom inS
: Zoom outA
: Rotate leftD
: Rotate rightQ
: Tilt downE
: Tilt upSpace
: Toggle auto-rotation
- Clone the Repository:
git clone https://github.com/ecnivs/blackhole.git
cd blackhole
- Run the simulation:
cargo run --release
- The black hole's Schwarzschild radius is computed from its mass.
- Accretion particles orbit the hole, with thier orbital radius decreasing over time.
- Relativistic Doppler effect alters their emission color depending on motion relative to camera.
- The grid mesh is dynamically warped to show spacetime curvature.
- A simple star field provides background reference.
- Add photon ring and lensing visuals via ray marching
- Implement Kerr metric spin-based light bending
- Better color grading for cinematic presentation
- UI silders for real-time parameter changes
We appreciate any feedback or code reviews! Feel free to:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Submit a pull request