ALL RIGHTS RESERVED ® & COPYRIGHT © 2025 Kavan010
Documentation updated and repository maintained by: Kavicastelo
This is a fork of Kavan010's original repository.
This repository contains a simulation of black holes, originally developed by Kavan010. I (Kavicastelo) have updated the documentation, added additional features like GitHub Pages, and created a social preview banner. The goal is to simulate and visualize black hole phenomena using ray tracing, accretion disks, and spacetime curvature.
- Ray-tracing simulation
- Accretion disk visualization
- Spacetime curvature demonstration
- [Optional] Real-time simulation feature
For more details, check out the original project.
- Clone the repository:
git clone https://github.com/kavicastelo/black_hole.git(or the original repo if using that)
- CD into the newly cloned directory:
cd ./black_hole
- Install dependencies with Vcpkg:
vcpkg install
- Get the vcpkg cmake toolchain file path:
vcpkg integrate install- This will output something like:
CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake"
- Create a build directory:
mkdir build
- Configure the project with CMake:
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
- Build the project:
cmake --build build
- Run the program:
- The executables will be located in the
buildfolder
- The executables will be located in the
If you don't want to use vcpkg, or you just need a quick way to install the native development packages on Debian/Ubuntu, install these packages and then run the normal CMake steps above:
sudo apt update
sudo apt install build-essential cmake \
libglew-dev libglfw3-dev libglm-dev libgl1-mesa-devThis provides the GLEW, GLFW, GLM and OpenGL development files so find_package(...) calls in CMakeLists.txt can locate the libraries. After installing, run the cmake -B build -S . and cmake --build build commands as shown in the Build Instructions.
for 2D: simple, just run 2D_lensing.cpp with the nessesary dependencies installed.
for 3D: black_hole.cpp and geodesic.comp work together to run the simuation faster using GPU, essentially it sends over a UBO and geodesic.comp runs heavy calculations using that data.
It should work with the necessary dependencies installed; however, I have only run it on Windows with my GPU, so compatibility with other setups might vary.
Let me know if you'd like an in-depth explanation of how the code works!
- Original Code: Kavan010
- Fork and Documentation Updates: Kavicastelo
This repository does not currently have an official license. Please refer to the original project for usage and licensing details.