This implementation does the raytracing and generates image in the CPU and then sends the whole thing ready to render to the GPU.
The ray tracer supports:
- Phong model ilumination
- Pure lambertian objects
- Hard shadows
- Reflection / Refraction combinable following Snell’s law
- Anti-alising
- Only handles spheres and boxes (Could be easily expanded by creating a child of Object overriding intersection algorithm by, for instance, something that handles convex hulls )
Later I investigated a bit on sub-surface scattering, mainly by reading this paper, and tried to improvise a simpler version myself. Leading to these results: