Exercise 3

March 23, 2016 before class

This is a more challenging exercise, please start early.

Problem Statement

This program is about a simplified radiosity implementation. Let us start with a "standard" scene. This scene consists of a box that has a rectangular (or square) light source somewhere on the ceiling as shown in the left image below. Then, add two smaller boxes as shown in the right image. Note that this image does not have the light source at the right position because it was generated for a different purpose. Also, make sure that there is space between a box and each wall. You may choose whatever colors for each object/patch. You should start with not so-coarse-patches. The images below were generated with a number of rather large patches, and, as a result, results are not very good. However, this is a good start. You may design your own input format for your scenes.

The following shows some student work in previous years:

  
  

Your radiosity program should read in a scene file and perform the "simplified" progressive refinement algorithm, as discussed in class, to calculate the radiosity of each patch. You should provide a simple interface for the user to pause the execution of your program and set an interval (e.g., every 5 iterations) for displaying the intermediate rendered result. Moreover, you should add an ambient term for the display purpose only. Initially, you may choose a camera position that can best view your scene. This interface must also allow the user to stop the computation early (i.e., before convergence occurs). Then, your program saves the scene as well as the radiosity of each patch. You should write a second program that can read in the rendered scene, display it, and and permit the user to move and rotate the camera to "look around."

Now comes the form factor computation. Suppose a rectangular patch is oriented counter clockwise with vertices V1, V2, V3 and V4. The center C of this patch is computed as

C = (V1+V2+V3+ V4)/4

Its (normalized) normal vector can also be computed easily. Define vectors U = V2 - V1 and V = V3 - V2. Then, the unit length u and v "coordinate" vectors are u = U/|U| and v = V/|V|, and the normal vector n is u×v/|u×v| . The following diagram shows the "lower" four vertices of the hemicube whose edges are parallel to the edges of the patch. The "top" four vertices are computed by adding n to the "lower" four because they are 1 unit on top of their corresponding vertices.

Do not use too many cells on the hemicube. Try to start with as few number of cells first, say 4×4 on the top and 4×2 on each side wall, to ensure your computation is right. You may also make the two boxes in the scene parallel to the walls and the ceiling to save computation time. When you are sure your form factor computation is right, increase the number of cells gradually until the scene is rendered satisfactory.

Since the computation of form factors can still be very time consuming, you may wish to precompute them before your demo. Keep in mind that the sum of all form factors from a patch is 1. Due to this simplified version and other factors, you may wish to normalize your computed form factors. You may also reduce the intersection computation time by performing a procedure similar to backface culling.

If you add substructuring, you will receive bonus points.

Design two more scenes. Note that your designs do not have to be very complex as long as they can reveal typical characteristics of radiosity. Good scenes receive bonus points.

Feel free to include more control and creative ways.

My Expectation

My expectation is simple: you will receive a good score if your implementation of radiosity is correct. Of course, your implementation should be able to demonstrate color bleeding, soft shadows, and indirect illumination. You will receive a higher score if your implementation can yield "better" results. Therefore, use your creativity and imagination.

Grading

The preferred system is Windows. Each of you will receive a CD for you to submit your work. Make sure that your full name, e-mail address, and the system used will be clearly shown on the CD. I will use this CD for grading. You should store the following information on the CD:

  1. A README file in the root directory that contains the following information:
  2. A GUIDE file, in PDF or Microsoft Word format, in the root directory that contains a detailed user guide, including the meaning of each button and menu item, operation, and the contents of screen. You may consider the use of some screenshots. You must discuss the results generated from your program(s).
  3. A bin directory that stores the executable file(s), data files (i.e., form factors and scenes), and all needed DLL files for Windows.
  4. A source directory that contains all source code files and makefiles (if any) for me to regenerate your executable files.
  5. A images directory that stores your best screenshots. Save these files in JPEG format and add a README file in this directory to explain why each of these images is good. Feel free to include these images in your report.
  6. The components your program will demonstrate and the way these demonstrations will be carried out.
  7. The design merit of each component.
  8. The way of compiling and running of your program(s) and the format of input, if any.

I will make suggestions and recommendations while you will perform demonstration for you to make improvement. Then, you should implement the suggestions and send me the final result within three days. Windows version is preferred.