Digital Lighting: Homework #4

return to course


Plastic Study

Due: Tuesday, May 2, 10:30am

 

1. Plastic Shading Study

Value: 10 points

This assignment is akin to a value study in a beginning design class where you paint a series of swatches from black to white where each swatch is exactly one step lighter than the previous. In this assignment, render a series of spheres (or other simple object) which progresses from a very shiny plastic surface to a very rough plastic surface. You will need to vary the ambient (Ka), diffuse (Kd), specular (Ks), and roughness components simultaneously in each sphere.

Keep in mind the rules of thumb, but remember that these are just guidelines. The bottom line is "what looks right, is right."

Remember that the goal is to produce a smooth, realistic transition from an object which is very smooth plastic to very rough plastic.

You will receive extra credit if you also incorporate "reflectiveness" (Kr) appropriately into your study. I.e. there should be some reflection of the environment in the very smooth plastic sphere and no reflection in the rough plastic sphere. Remember that too much reflectiveness will make the surface look unrealistic.

2. Plastic Shader Dissection

Value: 20 points

Describe, line by line, what each line in this plastic shader below does conceptually.

1.  /* plastic shader*/
2.
3.  surface plastic(float Ka = 1, Kd = 0.5;
4.                  float Ks = 0.5, roughness = 0.1; color specularcolor = 1)
5.  {
6.     point Nf, V;
7.     color amb, diff, spec;
8.
9.     Nf = faceforward(normalize(N), I);
10.    V = -normalize(I);
11.
12.    amb = Cs * Ka * ambient();
13.    diff = Cs * Kd * diffuse(Nf);
14.    spec = specularcolor * Ks * specular(Nf, V, roughness);
15.
16.    Oi = Os;
17.    Ci = Os * (amb + diff + spec);
18.  }

3. Questions

Value: 20 points

Briefly answer the following questions:

  1. Compare and contrast diffuse versus specular reflection.
  2. Why are dot products useful in the realm of illumination models?
  3. The rules of thumb state that in general, for realistic lighting, Ka = Kd. Why? Why also should, in general, Kd + Ks = 1? What is the relationship between Ks and roughness?
  4. Is there a reason why some people would consider the "matte" and "metal" shaders to not be useful for realistic shading?
  5. Would it be possible to write a different version of the "plastic" shader which automatically enforces the rules of thumb? This shader would presumably have different parameters instead of Ka, Kd, etc. What might those parameters be?

Last updated: 3/2/00 by Matthew Lewis

Steve May (smay@cgrg.ohio-state.edu)