HART is a multi-threaded software ray tracer written entirely from scratch in C++. The main goal of the project was to educate myself on the basics of ray tracing and to improve my math skills. It's also the perfect exercise to write some multi-threading code which turned out be amazing.
The multi-threading engine is a lock-free (blocking-free) job based system where:
- The number of threads does not exceed the number of physical threads that are on the CPU.
- Each thread consists of their own queue to take jobs from.
- The threadpool inserts jobs into the threads in a round-robin fashion.
Render Resolution: 640 * 480
Samples per pixel: 512
Ray Bounces: 50
Render time: Instantaneous
Render Resolution: 640 * 480
Samples per pixel: 4096
Ray Bounces: 10000
Render time: 1.5 hours
Render Resolution: 1920 * 1080
Samples per pixel: 4096
Ray Bounces: 10000
Render time: ~2 hours
Render Resolution: 1920 * 1080
Samples per pixel: 16384
Ray Bounces: 64
Render time: 8 hours
Render Resolution: 1920 * 1080
Samples per pixel: 16384
Ray Bounces: 64
Render time: 8 hours