Skip to content

dachengx/geodesic-raytracer

Repository files navigation

Raytracer in Curved Spacetime

This repo real-time-renders lights near Schwarzschild black hole using CUDA and OpenGL in C++.

Derivation of geodesic equation

The derivation of geodesic equation in two dimensional space is in overleaf project.

Demo of 2D and 3D raytracing using numba

In the folder demo, raytracing is demonstrated first in two-dimensional space. Then by simple coordination transformation, three-dimensional raytracing is also achieved. By numba acceleration, each frame needs about one minute.

3D raytracing using CUDA

Prerequisite installation:

Make sure Visual Studio is installed first then CUDA. Add C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin to PATH. The CUDA related path are automatically added to PATH when installation.

Build executable file

Remove-Item -Recurse -Force build

then

cmake -B build

then

cmake --build build --config Release

The executable file is at build\Release\raytracer.exe.

About

Real-time renderer of light in curved spacetime

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors