CPSC310A Assignment 16 - Area Lights and Soft Shadows

Due Monday April 2


Modify your C++ ray tracing program to render scenes with area lights. Instead of creating a new class of render-able objects the material class will be modified to specify surfaces that can emit light in addition to reflecting it.

The illumination calculation function should be modified to include a sixth term, emissive illumination. The emission of a surface is a color specified with a line that begins with Ke in an mtl file. The emissive illumination of a surface is equivalent to the surface's illumination color. The total illumination of a surface with an emission color is computed by summing the emissive, direct, reflective, and transmissive illumination.

The calculation of direct illumination in a scene with area lights should be modified. It should average the illumination calculated from random points on the surface of the area light. Add a function to the random class that returns the next point on a surface given a mesh and a second function for a sphere. To generate a point on a mesh, use one random number to choose a triangle in the mesh and two random numbers for the barycentric coordinates of the triangle. To generate a point on a sphere, use two random numbers for the latitude and longitude of the sphere.


Tar your code in a file that contains your name and submit it on the course Inquire site.