No description
Find a file
2025-08-06 18:41:48 -04:00
vs_code Add files via upload 2025-04-06 12:18:54 -04:00
2D_lensing.cpp Full Working 2D_lensing.cpp 2025-06-26 14:00:45 -04:00
black_hole.cpp added shading to objects 2025-07-30 20:35:22 -04:00
black_hole.exe Add files via upload 2025-04-06 12:41:02 -04:00
CPU-geodesic.cpp Rename CPU-geodesic to CPU-geodesic.cpp 2025-08-01 17:17:16 -04:00
geodesic.comp shading to objects 2025-07-30 20:35:39 -04:00
Gravity_Sim.zip Add files via upload 2025-04-05 11:13:45 -04:00
ray_tracing.cpp working ray_tracing.cpp 2025-03-16 11:37:50 -04:00
README.md Completed Black Hole README.md 2025-08-06 18:41:48 -04:00

black_hole

Black hole simulation project Here is the black hole raw code, everything will be inside a src bin incase you want to copy the files I'm writing this as I'm beginning this project (hopefully I complete it ;D) here is what I plan to do:

  1. Ray-tracing : add ray tracing to the gravity simulation to simulate gravitational lensing
  2. Accretion disk : simulate accreciate disk using the ray tracing + the halos
  3. Spacetime curvature : demonstrate visually the "trapdoor in spacetime" that is black holes using spacetime grid
  4. [optional] try to make it run realtime ;D

I hope it works :/

Edit: After completion of project -

Thank you everyone for checking out the video, if you haven't it explains code in detail: https://www.youtube.com/watch?v=8-B6ryuBkCM

Quickly to run the file you should install opengl (GLFW) and OpenGL wrangler GLEW: https://glew.sourceforge.net/ I'm on windows and used msys2 for installation though.

How the code works:

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. should work with nessesary dependencies installed, however I have only run it on windows with my GPU so am not sure!

LMK if you would like an in-depth explanation of how the code works aswell :)