Skip to content

Trippasch/CudaRayTracer

Repository files navigation

CudaRayTracer

CudaRayTracer

CudaRayTracer is a simple real-time path tracer based on the Ray Tracing in One Weekend Series accelerated with CUDA.

CudaRayTracer is a project developed for our university thesis titled "REAL-TIME ACCELERATED RAY TRACING IN 3D GRAPHICS USING CUDA".

This project is developed by Paschalis Choropanitis and Panayiotis Yiannoukkos .

Getting Started

1. Download the CUDA toolkit:

Start by downloading the CUDA toolkit, if you haven't done that already, from here.

2. Downloading the repository:

Then clone the repository with:

git clone --recurse-submodules [email protected]:Trippasch/CudaRayTracer.git

If the repository was cloned non-recursively previously, use git submodule update --init to clone the necessary submodules.

3. Generate Project files:

3.1. Premake:

For Windows run the GenerateProjects.bat file. This will generate the visual studio (2022) solution to compile and run the project.

For Linux run the GenerateProjects.sh file. This will generate makefiles to compile and run the project. The compiler used inside the script is LLVM's clang but you can change it to gcc as well.

3.2. CMake:

For Windows run the command: cmake -S . -B build on the project's root folder to generate the build files. Then, you can either run the Visual Studio solution to build the project or run cmake --build .\build --config=release -j to build the application on release mode.

For Linux run the command: cmake -DCMAKE_BUILD_TYPE=Release -S . -B build/release/ and cmake --build build/release -j to build the application on release mode.

tasks.py python script can also be used to simplify the cmake process. First, you have to install the invoke python submodule with the command pip install invoke. Then run invoke config to configure the project, next invoke build to build the project and finally invoke run to run the application. The default build type of this script is Release, but you can also specify it by using --build-type=Debug for every invoke task.

4. Run Project:

4.1 Windows:

  • Premake: Just run the application through the Visual Studio Solution.
  • Cmake: Run .\build\CudaRayTracer\Release\CudaRayTracer.exe from the project's root folder.

4.2 Linux:

  • Premake: Run ./bin/Release-linux-x86_64/CudaRayTracer/CudaRayTracer from the project's root folder.
  • Cmake: Run ./build/Release/CudaRayTracer/CudaRayTracer from the project's root folder.

**Remember to run the application from the project's root folder to load the correct paths.

5. Clean Project files:

For Windows run the CleanProjects.bat file.

For Linux run the CleanProjects.sh file.

Dependencies

The project uses the following dependencies:

  • CUDA for GPU acceleration.
  • ImGui for creating graphical user interfaces (GUIs).
  • GLM for vector math.
  • GLFW for creating windows, contexts and surfaces.
  • Glad for generating OpenGL functions.
  • spdlog for logging.
  • stb for image loading.
  • CMake for building the project.
  • Premake for building the project.