Optimised BVH traversal + HDRI environment mapping
C++ Cuda C CMake
Latest commit 0f9ae32 Oct 10, 2016 @straaljager committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
Array.h Compile fixes for Linux with GCC Sep 23, 2016
BVH.cpp Compile fixes for Linux with GCC Sep 23, 2016
BVH.h Compile fixes for Linux with GCC Sep 23, 2016
BVHNode.cpp Add files via upload Sep 20, 2016
BVHNode.h Add files via upload Sep 20, 2016
CMakeLists.txt Compile fixes for Linux with GCC Sep 23, 2016
Camera.cpp Add files via upload Sep 20, 2016
Camera.h Compile fixes for Linux with GCC Sep 23, 2016
CudaBVH.cpp Compile fixes for Linux with GCC Sep 23, 2016
CudaBVH.h Add files via upload Sep 20, 2016
CudaRenderKernel.h Compile fixes for Linux with GCC Sep 23, 2016
Geometry.h Add files via upload Sep 20, 2016
HDRloader.cpp Use long with scanf()'s %ld format specifier Sep 23, 2016
HDRloader.h Add files via upload Sep 20, 2016
MouseKeyboardInput.h Compile fixes for Linux with GCC Sep 23, 2016
README.md Update README.md Oct 10, 2016
Scene.h Add files via upload Sep 20, 2016
SceneLoader.cpp Add files via upload Sep 20, 2016
SceneLoader.h Compile fixes for Linux with GCC Sep 23, 2016
Sort.cpp Add files via upload Sep 20, 2016
Sort.h Add files via upload Sep 20, 2016
SplitBVHBuilder.cpp Add files via upload Sep 20, 2016
SplitBVHBuilder.h Add files via upload Sep 20, 2016
Util.cpp Add files via upload Sep 20, 2016
Util.h Add files via upload Sep 20, 2016
cutil_math.h Add files via upload Sep 20, 2016
linear_math.h Add files via upload Sep 20, 2016
main.cpp Update main.cpp Oct 6, 2016
renderkernel.cu Update renderkernel.cu Sep 23, 2016

README.md

GPU-path-tracing-tutorial-4

Matching Socks CUDA path tracer by Samuel Lapere, 2016 https://raytracey.blogspot.com

Demo of high performance CUDA accelerated path tracing based on the GPU ray tracing framework of Timo Aila, Samuli Laine and Tero Karras (Nvidia Research)

Screenshots and more info about this tutorial can be found at http://raytracey.blogspot.co.nz/2016/09/gpu-path-tracing-tutorial-4-optimised.html

Downloadable demo available at https://github.com/straaljager/GPU-path-tracing-tutorial-4/releases

Source code for original framework:

Features:

  • fast interactive path tracing
  • progressive rendering
  • interactive camera and depth-of-field
  • real-time user interaction
  • BVH acceleration structure built with surface area heuristic (SAH) and spatial splits
  • Woop ray/triangle intersection
  • highly optimised hand tuned ray traversal and intersection kernels
  • HDRI environment mapping
  • anti-aliasing
  • basic OBJ loader
  • basic material system with support for diffuse, clearcoat, refractive (glass), specular(mirror) and metal material
  • support for spheres and triangle meshes

Instructions for compiling with Visual Studio 2013/2015:

  • download and install the CUDA 7.5 toolkit and choose integration with Visual Studio
  • open VS2013/2015 (Express or any other version such as the free Community version)
  • click New Project...
  • select Visual C++, then General, then Empty Project
  • right click on the project, select Build Dependies > Build Customizations, check CUDA 7.5, click OK
  • add all the files to the project
  • in the solution explorer, right click on "render_kernel.cu", select Properties, change the Item type to CUDA C/C++
  • right click on the project name and select Properties
  • under Linker > Input > Additional Dependencies, add "cudart.lib" and "glew32.lib" (glew32.lib should be automatically found when the CUDA toolkit is installed)
  • when the compiler can't find glew32.lib, add the library path to Linker > General > Additional Library Directories, the path is something like "%NVSDKCOMPUTE_ROOT%\C\common\lib")
  • disable SAFESEH by selecting NO in Linker > Advanced > Image Has Safe Exception Handlers
  • select Build > Rebuild Solution and run the program
  • IMPORTANT: build the code in Release mode (building in Debug mode will result in extremely slow render performance, in some cases more than 100x slower due to hundreds of CUDA processors logging state with extra debug information)

Issues:

  • the OBJ loader is quite basic at the moment and only loads obj models that are in a particular format, hence some but not all OBJ files will work
  • at the moment there is no CUDA error checking when copying data to the GPU. When CUDA tries to access data on the GPU that is missing/has not been copied to the GPU, the program may render a black screen instead.