一个路径追踪小程序,利用了 CPU 多线程或 CUDA 加速计算。项目最初参考了《GAMES101: 现代计算机图形学入门》的作业7,有大幅度的调整。
学习笔记保存于知乎专栏。
A simple Monte Carlo path tracer based on assignment 7 of GAMES101 originally, accelerated by C++ multithreading or CUDA.
Following features are only available in archived
version.
项目使用 vcpkg 进行 C++ 库管理。
automatically import from extern
folder:
ENABLE_WATERTIGHT_TRIANGLES
: Specifies whether or not enable Woop's watertight ray/triangle intersection algorithm.ENABLE_CUDA
: Specifies whether or not enable GPU-accelerated computing.
ENABLE_CUDA_DEBUG
: Specifies whether or not GPU debugging information is generated by the CUDA compiler
ENABLE_VIEWER
: Specifies whether or not enable real-time viewer.
Command Format: [-c/--cpu/-g/--gpu/-p/--preview] --input/-i 'config path' [--output/-o 'file path] [--width/-w 'value'] [--height/-h 'value'] [--spp/-s 'value']
Program Option:
--cpu
or -c
: use CPU for offline rendering.
--gpu
or -g
: use CUDA for offline rendering,
--preview
or -p
: use CUDA for real-time rendering,
--input
or -i
: read config from mitsuba format xml file.--output
or -o
: output path for rendering result.
--width
or -w
: specify the width of rendering picture.--height
or -h
: specify the height of rendering picture.--spp
or -s
: specify the number of samples per pixel.