Requires CUDA SDK v10.0 (the CUDA SDK version can be easily downgraded), tbb and embree3. Requires OptiX Prime v5.1
The build process requires the use of a Makefile. The advantage of the makefile is that CUDA can be linked statically which is a requirement for running the RTAO benchmark on GPGPU-Sim. The CMake is currently not working.
Edit the following lines in your Makefile to use the paths to your libraries:
USING_OPTIX=0# 1 enables OptiX OPTIX_INCLUDE_DIR = ~/Documents/RayTracing/NVIDIA-OptiX-SDK-5.1.0-linux64/include OPTIX_LIB = /home/francois/Documents/RayTracing/NVIDIA-OptiX-SDK-5.1.0-linux64/lib64/ # make sure this is in LD_LIBRARY_PATH
EMBREE_INCLUDE_DIR = ~/Documents/RayTracing/embree/include EMBREE_LIB = ~/Documents/RayTracing/embree/build
In the main.cpp you have to change the path to the models that you are trying to render. A great source for the models is Morgan McGuire's repo: https://casual-effects.com/g3d/data10/index.html Currently only obj input models are supported.
When reading a model you need to edit the base_path and the model_name to match the location of the model you want to load: const std::string model_base_path = "/home/francois/Documents/RayTracing/models/"; const std::string model_name = "teapot"; const std::string obj_path_addition = "teapot.obj";
The final path for this example will be: /home/francois/Documents/RayTracing/models/teapot
To build: cd build_make; make ./CWBVH
Currently only Linux has been tested.
Ray are generated on a per triangle basis. The user can input a given Samples Per Triangle (SPT) value and a Samples per Pixel (SPP) value when instantiating the RayGenerator class in main.cpp.
Ray origins are generated using a random distribution over the triangle. Ray directions are generated using cosine-weighted stochastic hemisphere sampling.
We support 3 ray tracers:
- Architecture Considerations for Tracing Incoherent Rays (https://research.nvidia.com/sites/default/files/pubs/2010-06_Architecture-Considerations-for/aila2010hpg_paper.pdf)
- Efficient Incoherent Ray Traversal on GPUs Through Compressed Wide BVHs (http://research.nvidia.com/publication/2017-07_Efficient-Incoherent-Ray)
- OptiX Prime (version 5.2 is tested)
We hope to support hardware accelerated OptiX in the future.
We print out a .ply file that represents a pointcloud of the ambient occlusion results. We recommend loading the .ply file into Blender (https://www.blender.org/) and then visualizing it with the PointCouds plugin for Blender (https://github.com/uhlik/bpy#point-cloud-visualizer-for-blender-280, https://www.youtube.com/watch?v=eXct_7k779Q)
All credits for the implementation of "Efficient Incoherent Ray Traversal on GPUs Through Compressed Wide BVHs" (http://research.nvidia.com/publication/2017-07_Efficient-Incoherent-Ray) go to AlanIWBFT, this work is based on his repo at AlanIWBFT/CWBVH.