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.