For the final project, I concentrated on environment maps, simply because it was the first feature I had decided to implement. Subsurface scattering would have to wait until that kd tree worked. I ended up implementing the following features:
-
Depth of Field
-
Supersampling Pixels
-
Reading in PFM files
-
Environment Map based Lighting
PFM Files
I wanted to have some High Dynamic Range information for generating my lighting schemes, so I opted to support PFM files. They have three float values for each color channel of a pixel with a variable maximum value for each. I would have liked to read in hdr files instead because once I started implementing, I found out that the exposure information is extremely useful in efficiently normalizing the lighting data to the proper values. Instead, I had to resort to scanning through the arrray of data to find the maximum value of each color channel.
Environment Mapping
I implemented Environment Mapping as described on Paul Devebec's Light Probe webpage: http://www.debevec.org/Probes/. This is also where I got these awesome environment maps. I chose to use his pfm versions of high dynamic range files. I hoped it would be pretty similar to the ppm files already supported by miro.
By
sampling the images, I generated point lights to illuminate my
scene. I did this by sampling about a whole sphere's surface,
then averaging a 3x3 grid in the texture space. Then a user set
threshold is used to only create lights of large enough
intensities. This allowed me to approximate area lighting as
well as point lights as shown from using the Grace Cathedral
environment map on the left.
Here's a sample of
when I was trying out my generated lighting scheme. I noticed
some aliasing type artifacts from the light sources on the red sphere
which follows the additive Phong lighting model. So I decided to
jitter my sampling and got a much better results. Yes, and I
forgot to resize the distance of my lights according to the bounding
box of the entire scene in the rendering on the right. And the
jaggies on the grid lines would still have to wait until antialiasing
got implemented.
Depth of Field
I also implemented depth of field by sampling on a circular lens at my camera eye. However, I found the number of rays to get a smooth image and well focused in the right plane to be too much effort especially with time constraints, so I decided to leave the Impressionistic pointilism out. But here's a few tests just for fun:
Supersampling
Lastly, I added in supersampling.
For each pixel in the image, I divided into a grid and jittered my
samples within each square. However, I just don't have the
patience to wait for hours to see an image, so I only tested this out
on tiny images.
In Hindsight
I
honestly wish I had more time for this project since I didn't even get
to the feature I most wanted to implement, subsurface scattering.
I merely started to implement photon mapping so that I'd have a kd tree
implemented to use for my subsurface scattering. In any case, I
realized I spent too much time trying to get my BSP Tree working as
well as running after some resilient bugs from earlier projects,
that I had little time left to actually implement any new
features. Once I added them in and tested it on more complex
geometry, the running time drove me and my computer nuts, to the point
that my hard disk had a head crash. So here's in memory of my
computer.







