Skip to content

hydrogendeuteride/BlackHoleRayTracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlackHole Ray Tracer

Description

Simulation of Schwarzschild black hole using OpenGL ray marching.

How Realistic?

  • Gravitational light deflection
  • Gravitational redshift of accretion disk
  • Doppler effect and relativistic beaming of accretion disk
  • Realistic temperature distribution
  • Accretion disk(Innermost stable circular orbit, orbiting speed)

Possible future updates:

  • Doppler shift, redshift of background stars
  • Observer position, velocity
  • Orbiting star

Build

Prerequisites

  • C++17 compiler
  • cmake 3.25+
  • OpenGL 4.3+ (for compute shader)

Linux

  1. Install dependencies
sudo apt install libglfw3-dev libglfw3
sudo apt install libglm-dev
  1. Clone repository
git clone https://github.com/hydrogendeuteride/BlackHoleRayTracer.git
  1. Build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

Windows

  1. Install dependencies using vcpkg
vcpkg install glfw3 glm glew
vcpkg integrate install
  1. Clone repository
git clone https://github.com/hydrogendeuteride/BlackHoleRayTracer.git
  1. Build
mkdir build
cd build

cmake ..
cmake -G "Visual Studio 17 2022" ..
cmake --build . --config Release

Controls

  • Mouse right click&drag to rotate camera
  • H to disable HUD
  • C to change camera mode(orbit <-> free, default orbit)
  • WASD to move(free camera mode only)
  • Shift/Control to move up/down(free camera mode only)
  • Q/E to roll camera(free camera mode only)

Performance

Test Conditions:

  • Screen mode: full screen
  • OS: Windows 11
  • Rendering resolution: 1920x1080
Processor GPU FPS
AMD Ryzen 6800HS NVIDIA RTX 3050 Mobile 40~42FPS
AMD Ryzen 6800HS Radeon 680M 26~29FPS

References

License

MIT License

About

blackhole ray marching

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages