abstract.
In this lab, we wrote functions that, given all the necessary parameters, (surface normal, view vector, reflection coefficient, etc.), would calculate the intensity and color of the reflected light from a given point seen by the viewer. The first function calculates the diffuse (body) reflectance at a point, the second calculates the surface reflectance at a point (using the Phong specularity model), and the third calculates the reflectance due to multiple light sources, including ambient light and diffuse and surface reflectance for each additional light source.
 |
 |
 |
 |
| Ambient light R=G=B=10 |
Diffuse reflectance |
Surface reflectance |
Final image |
samples.
Changing the specular coefficient, ns, used in the Phong Specularity model of surface reflectance changes the apparent smoothness of the object. As the images below demonstrate, a high ns corresponds to a very smooth object. As ns decreases, the light reflected off the surface of the object spreads out, as it would for a rougher surface which has a larger distribution of surface normal directions, and thus more possible directions for the light to be reflected in, than a smooth surface of the same area.
 |
 |
 |
 |
| ns=4 |
ns=14 |
ns=24 |
ns=34 |
 |
 |
 |
|
| ns=44 |
ns=54 |
ns=64 |
|
The third function we wrote also gives us the ability to render an object that looks like it is being illuminated by several different light sources. Notice how the red light source, placed above and to the viewer's left, causes a specular reflection that does not extend to the bottom of the image. The blue light source, also above and to the viewer's left, but much closer to the object, causes a different specular pattern.
 |
|
 |
| With additional red light source |
|
With additional blue light source |
extension.
To extend this assignment, we wrote a function to calculate the reflection from a point using the Cook and Torrance Microfacet Model. This model considers a surface to be made up of many tiny microfacets, each with its own surface normal. This is modeled by a "distribution of surface normals" term in the equation for the reflectance at a point. The distribution term is a function of m, the roughness coefficient, with greater m corresponding to rougher surfaces. A criticism of the Phong specularity model is that it makes everything look like plastic. The Cook and Torrance model is supposedly better for rendering metals, so we attempted to make our cylinder look like it was made of metal and compared the performance of the two models. We found that the Cook and Torrance model was indeed more effective, as can be seen in the images below. For the second image set, we took a photograph of a metal cylinder, (the rod of a screwdriver), used the eye-dropper tool in photoshop to find the color of the metal, and used that color to develop the body reflectance coefficient, kd, used in the rendered images.
|
|
|
Phong specularity model,
ns=44 |
Phong specularity model,
ns=4 |
Cook & Torrance microfacet
model, ns=44, m=0.3 |
(Barbie's wedding ring) |
(Burger King crown) |
(The One Ring) |
|