Path tracer using C++
Lighting Path tracer implemented by following Peter Shirley's Ray Tracing in One Weekend Book Series.
Originally I wanted to use this code to render a high resolution avatar similar to one I made in Unity some time ago, but it turned out that I had great interest in the inner workings of a Ray Tracer, so ended up following a book and making my changes to the code. The avatar is one of the scenes in the image above.
This repository is always work in progress. Sometimes when I have free time, I sit down to continue following the book and adding new features 🙂.
Custom changes:
- adding
scene
class that contains initialization ofhittalbe
objects and sets appropriate image format depending on scene - thread pooling: minimize downtime by rendering lines concurrently
- during render, enter p to generate preview
From the book:
- Materials:
- Lambertian, Metal, Dielectric, Diffuse-light, Isotropic
- Textures: procedural, image mapping
- Hittables:
- Sphere
- Rectangle
- Box (collection of 6 rectangles)
- Other:
- Defocus Blur
- Perlin noise (+ turbulence)
- Threading
For image loading (to use in textures) stb was used.
For thread pooling implementation, I used ThreadPool repository