Coursework 2: Progressive Refinement Radiosity (Individual)

In the zipped directory you will find a simple but fully functional Radiosity program.  It's based on the progressive refinment approach and uses the hemicube for the form factor computation. The data set is the classic Cornel Box, which is a room with two boxes and a light source in the middle on the ceiling. The right wall of the room is blue while the left is red. The resulting image (as done at Cornell) should look like the one on the left, however the current solution of the radiosity program that you are given looks like the one on the righ.


 

Assignment

Your task is to change the code to improve the image as much as possible.

Part 1: (30%) Adaptive subdivision of patches (sub-structuring)
Currently the polygons (quads) are partitioned into a pre-specified number of patches and elements at the start and that partitioning is used throughout the solution. Go through the code and analyse all the parts of the code affected by sub-structuring. List all those parts and relate them to the algorithm seen during the lectures. Modify the number of patches and elements in room.c and compare different solutions both in terms of image quality and computation time. Please report on at least six different solutions. What are your conclusions? How should one choose the number of elements and patches? In your hand out, please also show how you modified the code.

Part2: (40%) Adding the ambient factor for rendering
In rad.c, you will find the GetAmbient() method. It does not do anything at the moment. Modify this method to calculate the ambient facor for each iteration. This needs to be calculated for each component of the radiosity (R,G,B). The calculation needs to use the unshot radiosity, the area and the reflectance stored with each patch. Report on the equations and algorithm you used. Show solutions (using the original number of patches and elements) with and without ambient factor for one, two, three, and four iterations. Discuss differences between the solutions.

Part 3: (30%) Interpolated shading for rendering
At the moment each patch/element is rendered using flat shading, using the color given by its radiosity. For interpolated shading, a color value needs to be computed at each vertex of the patch. This can be done by averaging the radiosities of the patches touching at that vertex. Note that this is done for rendering, it doesn't actually change the radiosity solution (see also [Cohen 85]). For this you will need to modify the code of DrawViewElement() in rad.c and add a new method in draw.c to draw polygons with a colour per vertex. Show before and after images (using the original number of patches and elements), and discuss your implementation.

Important

You need to hand in a print out of your commented code (only yours with the context), a short report refering to the technique(s) you use - description of equations if necessary, the choice you made in your algorithm, and analysed results (please add pictures as described above). 
 
Jan Kautz