Mark Schmelzenbach
Homework #7
CS684

This assignment implements a more elegant diffuse lighting model for surfaces and add area lights/soft shadows. The Cornell Box is used to demonstrate these techniques.

The amount of light on a surface at location x' from a lightsource at location x is calculated by the following equation:
L(x')=s(x,x')*R(x')/pi*(cos theta*cos theta')/(||x-x'||^2)*A
where:
s(x,x'): is a function returning 1 or 0, determining the visibility of point x from x'
R(x'): is the reflectance value of the surface at x'
theta: is the angle between the surface normal at x and the ray between x and x'
theta': is the angle between the surface normal at x' and the ray between x' and x
A: is the surface area of the light
x: is a stratified random sample on the surface of the light.


Using a stratified sampling strategy to find a random point on the area light causes the image to converge much faster to a 'noiseless' rendering. Originally, I was using a simple uniform random sampling, and the image sampled at 25 rays/pixel looked about the same as 4 rays/pixel does now!



The image sampled at 4 rays per pixel

The image sampled at 16 rays per pixel

The image sampled at 64 rays per pixel

The image sampled at 100 rays per pixel

The image sampled at 256 rays per pixel