Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rossning92 committed Jan 30, 2022
1 parent 9e17bd3 commit ea49fd1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 37 deletions.
80 changes: 43 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,57 @@
# Real-time Black Hole Rendering in OpenGL

_(WIP: refactoring, cleaning up and documenting the code)_

![Screenshot](docs/screenshot.jpg)
![Screenshot](docs/blackhole-screenrecord.gif)

## Prerequisite

- cmake
- I used [vcpkg](https://github.com/microsoft/vcpkg) to install the following necessary C++ libraries for this project:
- glew
- glfw3
- glm
- imgui
- stb

### For windows setup only
- [cmake](https://cmake.org/)
- [conan](https://conan.io/) package manager [^1]

- Install `cmake-3.18.3-win64-x64.msi` from this page https://cmake.org/download/
- Install vcpkg:
- Clone vcpkg repo: `git clone https://github.com/Microsoft/vcpkg.git`
- Enter vcpkg folder: `cd vcpkg`
- Build vcpkg: `bootstrap-vcpkg && vcpkg integrate install`
- Install required C++ libs from vcpkg (I've only tested x64 build):
```
vcpkg install glew:x64-windows glfw3:x64-windows glm:x64-windows imgui:x64-windows stb:x64-windows
```
[^1]: You might need to configure [$HOME/.conan/conan.conf](https://docs.conan.io/en/latest/reference/config_files/conan.conf.html) and Conan [profiles](https://docs.conan.io/en/latest/reference/profiles.html) if the `default profile` is not generated due to different build environments on your distribution.

#### Build the code
## Build the code

```bash
# Configure the project and generate a native build system. Please replace <vcpkg_dir> with the actual path to your vcpkg folder.
cmake -DCMAKE_TOOLCHAIN_FILE=<vcpkg_dir>/scripts/buildsystems/vcpkg.cmake -S . -B build
# Configure the project and generate a native build system.
cmake -DCMAKE_BUILD_TYPE=Release -S . -B build

# Compile / build the project
# Compile / build the project.
cmake --build build
```

### Linux setup and build

- Install CMake and Conan using your distribution's package manager[^1]
- Clone this repo: `git clone https://github.com/rossning92/Blackhole.git`
- Enter this repo's directory `cd Blackhole`
- Make a build directory: `mkdir build`
- Enter the build directory: `cd build`
- Prepare CMake: `cmake .. -DCMAKE_BUILD_TYPE=Release`
- Build: `make`

[^1]: You might need to configure [$HOME/.conan/conan.conf](https://docs.conan.io/en/latest/reference/config_files/conan.conf.html) and Conan [profiles](https://docs.conan.io/en/latest/reference/profiles.html) if the `default profile` is not generated due to different build environments on your distribution.

## Acknowledgements

**Papers**

- Gravitational Lensing by Spinning Black Holes in Astrophysics, and in the Movie Interstellar
- Trajectory Around A Spherically Symmetric Non-Rotating Black Hole - Sumanta
- Approximating Light Rays In The Schwarzschild Field - O. Semerak
- Implementing a Rasterization Framework for a Black Hole Spacetime - Yoshiyuki Yamashita

<!-- https://arxiv.org/pdf/1502.03808.pdf -->
<!-- https://arxiv.org/pdf/1109.0676.pdf -->
<!-- https://arxiv.org/pdf/1412.5650.pdf -->
<!-- https://pdfs.semanticscholar.org/56ff/9c575c29ae8ed6042e23075ff0ca00031ccc.pdfhttps://pdfs.semanticscholar.org/56ff/9c575c29ae8ed6042e23075ff0ca00031ccc.pdf -->

**Articles**

- Physics of oseiskar.github.io/black-hole - https://oseiskar.github.io/black-hole/docs/physics.html
- Schwarzschild geodesics - https://en.wikipedia.org/wiki/Schwarzschild_geodesics
- Photons and black holes - https://flannelhead.github.io/posts/2016-03-06-photons-and-black-holes.html
- A real-time simulation of the visual appearance of a Schwarzschild Black Hole - http://spiro.fisica.unipd.it/~antonell/schwarzschild/
- Ray Tracing a Black Hole in C# by Mikolaj Barwicki - https://www.codeproject.com/Articles/994466/Ray-Tracing-a-Black-Hole-in-Csharp
- Ray Marching and Signed Distance Functions - http://jamie-wong.com/2016/07/15/ray-marching-signed-distance-functions/
- Einstein's Rings and the Fabric of Space - https://www.youtube.com/watch?v=Rl8H4XEs0hw)
- Opus 2, GLSL ray tracing tutorial - http://fhtr.blogspot.com/2013/12/opus-2-glsl-ray-tracing-tutorial.html
- Ray Tracing in One Weekend - https://raytracing.github.io/
- On ray casting, ray tracing, ray marching and the like - http://hugi.scene.org/online/hugi37/- hugi%2037%20-%20coding%20adok%20on%20ray%20casting,%20ray%20tracing,%20ray%20marching%20and%20the%20like.htm

**Other GitHub Projects**

- https://github.com/sirxemic/Interstellar
- https://github.com/ssloy/tinyraytracer
- https://github.com/RayTracing/raytracing.github.io
- https://awesomeopensource.com/projects/raytracing
- Ray-traced simulation of a black hole - https://github.com/oseiskar/black-hole
- Raytracing a blackhole - https://rantonels.github.io/starless/
- https://github.com/rantonels/schwarzschild
Binary file added docs/blackhole-screenrecord.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/screenshot.jpg
Binary file not shown.

0 comments on commit ea49fd1

Please sign in to comment.