Progressive Photon Mapping: Non-Recursive CPU
A small C++ CPU implementation of photon mapping(non-recursive verion based on original smallppm by T. Hachisuka), developed as a study companion to an earlier CUDA/GPGPU renderer. The project explores how the same photorealistic rendering approach can be implemented and compared on different architectures.
Background
Around 2012, my brother Alireza Rasti and I developed a CUDA-based renderer as part of a student project on using GPGPU to accelerate photorealistic rendering. At the time, CUDA did not support recursive device code in the way ray tracing and photon mapping would naturally use it. We therefore used a non-recursive design in the CUDA version implementation.
We also built this C++ CPU version using a non-recursive approach. Keeping the CPU implementation close to the CUDA design gave us a more useful basis for comparing the two approaches and studying their trade-offs.
Note: We have made minor updates to our 2012 implementation to use modern C++.
Build and Run
The project has been tested on Linux.
Build with Make:
make
Run using the included scene file and specify the output image path:
./build/renderer ./scenes/Scene004.txt output.bmp
The renderer requires a scene file and output image path as positional arguments.
This project currently writes ouput images via stb_image_write. This library can output PNG, TGA, JPEG/JPG, and HDR files when the output writer is configured for those formats.
Project Scope
This repository contains the CPU implementation. It is intended for learning, experimentation, and comparison with the original CUDA project, rather than as a production rendering system. The CUDA version will be available in the repo as well soon.
License
This project is licensed under the Apache License, Version 2.0. See LICENSE for the full license text. Third-party components retain their own licensing terms; for example, stb_image_write is public domain.