CS 5610/6610 - Fall 2009

Homework Assignment 2

Shadow Algorithms (150 points)

Handed out: Sept 29, 2009

Due: 11:59pm, Oct 22, 2009 (Thursday)

 You will write an OpenGL program which introduces you to shadows.

1. A white point light source (positional) using the OpenGL lighting model. The light should be placed near the ceiling in the center of your room. You should be able to move the light with a GLUI control. Provide a light intensity control with GLUI.

2. You should model the same room as you did in the last assignment. This time, make the walls are light-colored but not white. You do not need to use an environment mapped sphere but in additional to the sphere with your face texture-mapped on it, place a cube with a teapot on top in the center of the room with a torus balanced on the spout.  You do not need to environment map the sphere (unless you want to). Texture the floor as in the last assignment but you do not need to include a lightmap.

3. You should include projective shadows (select with a GLUI radio control). Projective shadows which show up on the walls and floor. The shadows should be drawn so that they are blocking the direct light, but are still lit by global ambient light and diffuse (not simply black polygons). For example, you should be able to see the wood floor texture through the shadows. The objects in the room should cast shadows on the floor but not each other or themselves.

4. You can include either shadow maps or shadow volumes. For shadow maps the scene as stated above will be the occluders. For shadow volumes, place a triangle (sized so that it casts a reasonable shadow) between the light and the scene. It can be the only occluder for shadow volumes. Please add a GLUI control to translate and rotate the triangle. Provide a GLUI radio button to select the shadow option. The shadows should be drawn so that they are blocking the direct light, but are still lit by global ambient light plus diffuse (not simply black polygons). For example, you should be able to see the wood floor texture through the shadows. The objects in the room should cast shadows on both themselves, other objects, and the floor with shadow maps.

5. Your light should be modeled by a small emissive sphere.

CS6610 For the 6xxx courses, you should implement all of the above but also shadow volumes and shadow maps (selected with a GLUI radio button). However, you should use a cube rather than a triangle for the occluder in the shadow volume method.

Output

The program should draw its output to an OpenGL window and have full functionality through the GLUI interface described above.

Your write up should be about 1 page in length and describe any problems/issues you have had as well as what you learned in this assignment. It should clearly document the program user interface and any additional features or bugs that your program exhibits.

Submission

Please handin from the CADE system. The handin name for this lab is "openGL2". Name your zip/tar openGL2[zip|tar.gz] where tar is used for Linux and win for Windows. Handin your executable along with the source code and documentation describing how your user interface works, design choices you made and why you made them. Windows users should use the Zip utility and handin a single zipped file. Unix users should use the tar program followed by gzip to do the same.