Skip to content

ukoeln-vis/ctpperf

Repository files navigation

C++ Compile Time Polymorphism for Ray Tracing

Source code repository accompanying the scientific paper

S. Zellmann, U. Lang (2017)

"C++ Compile Time Polymorphism for Ray Tracing".

Proceedings of the 22nd International Symposium on Vision, Modeling and Visualization (VMV 2017), Bonn, Germany, September 25, 2017 (accepted for publication).

Description

This repository includes the complete benchmark routine for the paper mentioned above. Note that the benchmark code is not intended to be "production ready" and was only tested in a very limited environment: Ubuntu 16.04, compiling with GCC 5.4.0 or CUDA 8.0 nvcc. Running the benchmarks requires switching git branches and editing some compile time defines in header files!

We created the benchmark suite by first forking Visionaray at commit 047e641ca5ee2cb35507923f109bcd9fe2a00b2e. For simplicity, we implemented the benchmark itself as a Visionaray example that can be found in

src/examples/wavefront_pathtracer

For the paper, we implemented the following benchmark tests using a wavefront pathtracing approach:

  • Shading, compile time polymorphism to determine the correct shading routines (CPU & CUDA). Implemented on branch shading_benchmarks.

  • Shading, object oriented polymorphism to determine the correct shading routines (CPU only). Implemented on branch shading_benchmark_oop.

  • Shading, one kernel per material type, and sorting (CPU & CUDA). Implemented on branch shading_benchmarks.

  • Intersect, compile time polymorphism to support BVHs containing multiple primitive types (CPU & CUDA). Implemented on branch intersect_benchmarks.

  • Intersect, object oriented polymorphism to support BVHs containing multiple primitive types (CPU only). Implemented on branch intersect_benchmark_oop.

  • Intersect, with one BVH per primitive type (CPU & CUDA). Implemented on branch intersect_benchmarks.

Tipps for building the benchmark suite

Follow the general instructions to build Visionaray. Make sure that you build the examples (cmake variable VSNRAY_ENABLE_EXAMPLES! Use the cmake variable VSNRAY_ENABLE_CUDA to switch between CPU and GPU builds. Make sure to configure release builds: CMAKE_BUILD_TYPE=Release.

The tests "CTP vs. sorting" and "CTP vs. kernel per primitive" can be found on branches shading_benchmarks and intersect_benchmarks. Activate the respective tests by manipulating the C preprocessor defines SORT_BY_MATERIAL_TYPE and INTERSECT_PER_PRIMITIVE_TYPE in pathtracer.h before compiling on the respective branch.

For the "kernel per primitive" tests, we add randomly distributed spheres to the scenes. Note that we hardcoded specific setups (e.g. sphere size) for the Conference Room and San Miguel test scenes. You may play around with the C preprocessor defines in main.cpp for the various configurations.

Tipps for running the benchmarks

Invoke the wavefront_pathtracer application with a command line similar to the following one:

src/examples/wavefront_pathtracer/wavefront_pathtracer data/models/model-dir/model-name.obj -camera=camera-file.txt -bvh=split -width=2560 -height=1024

The models we used for our tests can be found under data/models, camera files can be found under /data/cameras.

License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published