Skip to content
An example path tracer which runs on multiple ray tracing backends (Embree/DXR/OptiX/Vulkan)
C++ C Other
Branch: master
Clone or download
Latest commit 25866e2 Sep 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmake fix find cmake package script locations May 17, 2019
dxr fix up dxr sbt alignment Sep 7, 2019
embree hack no longer needed w/ embree 3.6.1 Aug 30, 2019
imgui
optix also search wehre nvcc is Sep 10, 2019
ospray clang format Aug 30, 2019
util missing ; Sep 10, 2019
vulkan send light params through ssbo in vulkan backend Sep 5, 2019
.clang-format
.gitignore Add OSPRay OBJ viewer Feb 19, 2019
CMakeLists.txt Cool name Aug 26, 2019
LICENSE.md license,readme Feb 19, 2019
README.md update readme Sep 11, 2019
main.cpp Starting to get in GLTF support via tinygltf Sep 6, 2019

README.md

ChameleonRT

An example path tracer which runs on multiple ray tracing backends (Embree/DXR/OptiX/Vulkan). Uses tinyobjloader to load OBJ files. The San Miguel, Sponza and Rungholt models shown below are from Morgan McGuire's Computer Graphics Data Archive.

San Miguel, Sponza and Rungholt

Ray Tracing Backends

The currently implemented backends are: Embree, DXR, OptiX, and Vulkan. When running the program, you can pick which backend you want from those you compiled with on the command line. Running the program with no arguments will print help information.

./chameleonrt <backend> <mesh.obj>

All five ray tracing backends use SDL2 for window management and GLM for math. If CMake doesn't find your SDL2 install you can point it to the root of your SDL2 directory by passing -DSDL2=<path>. Similarly for GLM, you can point it to the glmConfig.cmake file in your GLM distribution by passing -Dglm_DIR=<path>. To track and report statistics about the number of rays traced per-second run CMake with -DREPORT_RAY_STATS=ON. Tracking these statistics can impact performance slightly.

ChameleonRT only supports per-OBJ group/mesh materials, OBJ files using per-face materials can be reexported from Blender with the "Material Groups" option enabled.

Embree

Dependencies: Embree, TBB and ISPC.

To build the Embree backend run CMake with:

cmake .. -DENABLE_EMBREE=ON \
	-Dembree_DIR=<path to embree-config.cmake> \
	-DTBB_DIR=<path TBBConfig.cmake> \
	-DISPC_DIR=<path to ispc>

You can then pass -embree to use the Embree backend. The TBBConfig.cmake will be under <tbb root>/cmake, while embree-config.cmake is in the root of the Embree directory.

OptiX

Dependencies: OptiX 7, CUDA 10.

To build the OptiX backend run CMake with:

cmake .. -DENABLE_OPTIX=ON

You can then pass -optix to use the OptiX backend.

If CMake doesn't find your install of OptiX you can tell it where it's installed with -DOptiX_INSTALL_DIR.

DirectX Ray Tracing

If you're on Windows 10 1809, have the 10.0.17763 SDK and a DXR capable GPU you can also run the DirectX Ray Tracing backend.

To build the DXR backend run CMake with:

cmake .. -DENABLE_DXR=ON

You can then pass -dxr to use the DXR backend.

Vulkan NV Ray Tracing

Dependencies: Vulkan.

To build the Vulkan backend run CMake with:

cmake .. -DENABLE_VULKAN=ON

You can then pass -vulkan to use the Vulkan backend.

If CMake doesn't find your install of Vulkan you can tell it where it's installed with -DVULKAN_SDK. This path should be to the specific version of Vulkan, for example: -DVULKAN_SDK=<path>/VulkanSDK/1.1.114.0/

OSPRay [stale]

The OSPRay reference backend has gotten stale during the path tracer implementation in the other backends, but is on the list to get back up to date.

Dependencies: OSPRay.

To build the OSPRay backend run CMake with:

cmake .. -DENABLE_OSPRAY=ON -Dospray_DIR=<path to osprayConfig.cmake>

You can then pass -ospray to use the OSPRay backend.

Citation

If you find ChameleonRT useful in your work, please cite it as:

@misc{chameleonrt,
	author = {Will Usher},
	year = {2019},
	note = {https://github.com/Twinklebear/ChameleonRT},
	title = {{ChameleonRT}}
} 
You can’t perform that action at this time.