Friday, December 18, 2009

Fall 2009 CS 513 Final Project

The goal of this project was to take a photograph and place a model into that photo and match the lighting.

For this project, two cheap light probes were built for less than $10. Shiny and diffuse Christmas balls were used to probe the reflective and diffuse components of the scene. They were attached to dowel rods using duct tape and placed into the tree.

A consumer grade 10-megapixel ultracompact camera was placed on a tripod and used to take pictures of the spheres:




This resulted in the following sphere maps:





These sphere maps were mapped onto the model to produce an initial image:



Later, an image of a fingerprint was added to decrease the specularity of the model where the fingerprint left oil residue and caused dirt to accumulate.


Antialiasing was performed using the accumulation buffer. Slightly different view / projection matrices were used for each pass and the results averaged.

Ambient occlusion was approximated using only 26 lights. Shadow maps were computed for each pass and baked into a texture. Ideally at least 128 lights would be used.


Seams are always a problem with texture baking. Earlier in the semester, I wrote some software to find the seams in an OBJ model and transport texture data across seams to minimize their impact. The software isn't perfect, but it helps greatly.

The ambient occlusion is used to diminish the amount of light that is reflected by the model by decreasing the amount of available light in the shader. The end result has a pewter look to it:






This project was done on a 17" MacBook Pro running Snow Leopard. To build and download:

wget http://riskybacon.com/classes/cs513/final/cs513-final-jbowles.tar.bz2
tar jxf cs513-final-jbowles.tar.bz2
cd cs513-final-jbowles/final
make
./final

No comments:

Post a Comment