CPU pathtracer in C++ from scratch
A CPU pathtracer written in C++ from scratch as a university project.
CPU Pathtracer in C++ from scratch.
This monte-carlo pathtracer is the second project I did for the Breda University of Applied Sciences. The pathtracer runs on the CPU, using multithreading, and can render scenes with large numbers of primitives (triangles, planes, spheres, boxes), simulating both dielectric and metallic materials.
Some of the features and techniques leveraged are:
- Bounding Volume Hierarchies for scenes and meshes, for fast intersection of large numbers of primitives.
- Next Event Estimation for the fast evaluation of direct light.
- Cosine-weighted Importance Sampling of the Hemisphere for the fast evaluation of indirect light.
- Multiple Importance Sampling to combine the contributions of next event estimation and importance sampling of the hemisphere more effectively.
- Configurable Reconstruction Filters for improved image reconstruction, resulting in better anti-aliased images.
- Russian Roulette path termination, terminating low-contribution paths randomly for faster convergence rates while keeping an unbiased renderer.
- Stratified Sampling for more well-distributed sampling sequences with better convergence rates than regular white noise.
- HDR environment maps provide natural lighting in scenes with ease, imported using a handwritten .hdr parser.
- Tonemapping, sRGB transform and TPDF blue noise dither to output a high quality image mapped from high dynamic range into the final 8 bits per channel output image format.
- Nested dielectrics allowing for simulating more complex scenes such as a glass marble with air bubbles.
- Simple but responsive UI using rxi's microui library, running on a separate thread from the rendering for full responsiveness even if the renderer is completely locking up.
Both images were taken with 64 samples per pixel.
Nested dielectrics
Simulating a glass marble with air bubbles inside.
The recording is at 960x540 because otherwise the framerate of the recording would be too low.
Comments (0)
This project doesn't have any comments yet.