Skip to content
/ CWBVH Public
forked from AlanIWBFT/CWBVH

An implementation of NVIDIA's paper "Efficient Incoherent Ray Traversal on GPUs Through Compressed Wide BVHs"

Notifications You must be signed in to change notification settings

bftf/CWBVH

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ray-Traced Ambient Occlusion Benchmark for Hybrid Rendering Workloads

Image: RTAO Dragon

Image: RTAO Hairball

Build

Before building:

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

Build:

To build: cd build_make; make ./CWBVH

Currently only Linux has been tested.

Ambient Occlusion

Ray Generation

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.

Ray Tracing

We support 3 ray tracers:

  1. Architecture Considerations for Tracing Incoherent Rays (https://research.nvidia.com/sites/default/files/pubs/2010-06_Architecture-Considerations-for/aila2010hpg_paper.pdf)
  2. Efficient Incoherent Ray Traversal on GPUs Through Compressed Wide BVHs (http://research.nvidia.com/publication/2017-07_Efficient-Incoherent-Ray)
  3. OptiX Prime (version 5.2 is tested)

We hope to support hardware accelerated OptiX in the future.

Output Visualization

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)

Efficient Incoherent Ray Traversal on GPUs Through Compressed Wide BVHs


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.

About

An implementation of NVIDIA's paper "Efficient Incoherent Ray Traversal on GPUs Through Compressed Wide BVHs"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 72.3%
  • Cuda 13.2%
  • Python 7.7%
  • CMake 6.0%
  • Other 0.8%