Here is the assignment handout for Homework 5.

Here is the framework for the assignment. To facilitate merging with your existing code, here is a summary of changes from the solution to the previous assignment:

A number of these changes would require small changes to your surface rendering code, but there no real design changes.

There are a few test scenes for this assignment, which are listed below together with the output from my implementation.

First, some numerical-answer scenes. A diffuse enclosure (of any shape) with walls that have emitted radiance L and reflectance R has a very simple answer under global illumination: the radiance everywhere is L / (1 - R). This kind of environment is called a furnace:

Remember you can get a numerical answer from the renderer by setting the image size to 1 by 1.

Pure absorption in a backlit slab of homogeneous medium:

Single scattering from a slab of homogeneous medium with a distant source and camera has an analytic solution (but not for multiple scattering):

A sufficiently deep layer of non-absorbing medium, under multiple scattering, reflects all of the incident light. You'll need to let the paths get pretty long, though:

Here is the classic test scene, the Cornell Box:

The following images were computed at 100 samples per pixel:


From left to right: direct only (luminaire sampling); brute force path tracer (depth 5); Kajiya path tracer with luminaire sampling (depth 5).

The Cornell box, with no light source; it is just illuminated by the background.

The following image was computed at 100 samples per pixel:


Here the brute force algorithm works just fine.

An empty Cornell Box with a cube of scattering medium in it:

The following images were computed at 400 samples per pixel:


These are all with direct only, using luminaire sampling. They have different absorption and scattering coefficients, in the range 0.000–0.050, indicated in the filenames.

The Cornell Box illuminated by a shaft of light coming in through a hole in the ceiling, with and without a scattering atmosphere:

The following images were computed at 100 samples per pixel:


From left to right: direct only (luminaire sampling); brute force path tracer (depth 5); Kajiya path tracer with luminaire sampling (depth 5).
The following images were computed at 400 and 1600 samples per pixel respectively:


From left to right: direct only (luminaire sampling); Kajiya path tracer with luminaire sampling (depth 5).