Skip to content

Latest commit

 

History

History
74 lines (51 loc) · 2.34 KB

File metadata and controls

74 lines (51 loc) · 2.34 KB

Rayfloat

A multithreaded, BVH enabled, cpu path tracer using a Whitted-style, iterative light transport integrator built to study performance, memory behaviour and algorithmic bottlenecks on multi-core CPUs.

Table of Contents

  1. Demo
  2. Highlights
  3. Documentation
  4. Build Instruction
  5. Future Work
  6. References

Demo

Highlights

  • Materials are modeled as BSDF-like scattering functions that stochastically generate outgoing rays and attenuate energy (lambertian, dielectric, metal, emissive)
  • Parallelizes rendering across image rows using OpenMP and employs a thread-local RNG (XorShift)
  • Iterative ray traversal (no recursion)
  • Bounding Volume Hierarchy (Median Split Strategy) has been implemented

Write-up

Build

Standard

Have CMake installed.
Use this when you just want to generate your image.

mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..

make
./raytracer

Profiling

cmake -DCMAKE_BUILD_TYPE=Profile ..
make
# this runs the code, creates gmon.out, and generates analysis.txt
make analyze

Use feh output/image.ppm to view the generated image.

Future Work

  1. AoS to SoA
  2. SIMD vectorization
  3. More primitive shapes
  4. Define explicit distribution functions for material types
  5. .obj file loading

References

  1. Ray Tracing in One Weekend by Sherley, Black and Hollasch
  2. What Every Programmer Should Know about Memory by U Drepper
  3. BVH - PBR Book
  4. BVH (Morton Codes) - Ten Minute Physics (Video)
  5. A reddit post on r/nvidia on BVH
  6. HackerNews thread on Fast and Slow If statements
  7. How Branch Prediction Works on CPUs - Computerphile (Video)