black_hole

Project Overview

Introduction

The Black Hole Simulation project aims to visualize the visual distortion caused by extreme gravity, a phenomenon known as gravitational lensing. By solving the geodesic equations for light rays passing near a black hole, we can generate physically accurate images of what a black hole might look like to an observer.

Goals

  1. Ray-tracing: Implement ray tracing to simulate gravitational lensing mechanics.
  2. Accretion Disk: Simulate a glowing disk of matter orbiting the black hole.
  3. Spacetime Curvature: Provide a visual representation of how mass curves spacetime using a distorted grid.
  4. Real-time Performance: Optimize calculations to run at interactive frame rates (60FPS+).

Technical Approach

The simulation is built using C++ and OpenGL. It employs a hybrid approach:

Simulating Sagittarius A*

The default configuration simulates Sagittarius A*, the supermassive black hole at the center of the Milky Way galaxy.

Visualizations

2D Lensing (CPU)

A simpler 2D implementation (2D_lensing.cpp) demonstrates the path of individual light rays as they are deflected by the black hole’s gravity.

3D Simulation (GPU)

The full 3D simulation (black_hole.cpp + geodesic.comp) renders a complete scene with: