Part 7: Object Lights & Path Tracing
In the last (and the most challenging) part of this ray tracer, two main features are added: 1. Object Lights Until now, the ray tracer was only supporting lights that are not visible in the scene such as PointLight , AreaLight etc. No ray intersection tests were being performed for the light objects. In this version, two types of object lights ( LightMesh and LightSphere ) are added. These lights provide illumination for the scene and they are also objects that are included in the BVH and being tested against intersections with the sent rays. For the implementation, there are a few points to note: - For object lights, I used multiple inheritance. LightMeshes inherit from both Light and Mesh classes, while LightSpheres inherit from both Light and Sphere classes. These classes also have a property keeping the radiance of the light object defined in the xml. - Two new attributes are added to the Hit class: isLight to indicate whether the object hit is a light source, radiance to keep th...