Skip to content

LesleyLai/cuda-path-tracer

Repository files navigation

CUDA Path Tracer

Windows Ubuntu

Interactive Path Tracer in CUDA.

Features

  • Sphere and triangle mesh primitives
  • obj file loading
  • BVH (bounding volume hierarchy) acceleration
  • Edge-Avoiding À-Trous Wavelet Transform denoising

Build

You need to have a recent version of C++ compiler (Visual Studio , GCC, or Clang), CMake 3.17+, CUDA Toolkit, and Conan package manager installed.

To install conan, you need have a recent Python installed, and then you can do:

$ pip install conan

Afterwards, you can invoke CMake in command line to build the project

$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ cmake --build .

or alternatively use your IDE's CMake integration.

Troubleshoot

Path-related errors in Windows

nvcc fatal : Cannot find compiler 'cl.exe' in PATH nvcc fatal : Could not set up the environment for Microsoft Visual Studio

The way NVCC parse Windows PATH environment variable seems to be brittle. A reliable way is to clear the Path variable and only set the location of cl.exe to the path. For example:

Path=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\

Run

The executables should be under the bin directory of the build directory:

  • cuda_pt is the main executable. The usage is cuda_pt [option] <filename>, where <filename> refers to scene files. By default, it executes in interactive mode, but with --output <output filename> option it runs in command line mode.
  • test runs unit tests

Gallery

Denoising

One sample-per-pixel output Edge-Avoiding À-Trous Wavelet Transform

Credit

This project consults the following resources and papers

Dependencies

This project uses the following excellent third-party dependencies

CUDA

  • CUDA SDK
  • Thrust - High level CUDA algorithm library

Asset

Utilities

Testing

Interactive App

License

This repository is released under the MIT license, see License for more information.