Homework #1: Shading, shadows...
This assignment is simply creating a box intersector and implementing the shading function
with ambient, diffuse and specular components. Also, sharp shadows were implemented.
See the results page.
Homework #2: BSP trees
This second homework consists of the implementation of a ray-tracing acceleration technique
of our choice. I decided to do a BSP tree because of its simplicity, flexibility
and availability of information: Google returns
almost 3 million results.
A problem that was left to our judgement was the online creation of the data structure:
Elements would be inserted one by one, and the data structure would have to be ready after each
insertion. One posibility to avoid this problem was to set a flag indicating whether any
intersection query has been already performed on the BSP, and if not, insertions would just add
an element to the list. The first time a collision is checked, the BSP structure would be
constructed. I interpreted this not to be what we were asked to do, and therefore constructed
the tree incrementally, only to find that my acceleration technique takes so
much time to prepare the tree with large datasets, that it actually decelerates the
ray-tracing.
The results in these conditions (online construction with repetition of objects when they
can't be separated from a plane) achieves an acceleration of a factor of 3-6 in most tested
models, which in my opinion is rather poor. One way I think I could improve its behavior is
by using surface area measures when deciding the best splitting plane, instead of just counting
the number or objects. The other way is, as explained above, doing an offline construction
of the data structure.
The source code, as well as the obtained results can be obtained in the above sections of
this webpage. Simply follow the files
and results links in the navigation bar for either download.
Update: I changed the sdfViewer so that it correctly handles lights they way they are defined
in the scene files. So far, only 8 lights are allowed, and it will probably crash if more
are defined in the input.
Also, I randomized the input to my BSP class, but it still takes way
too much time to render a complex scene. My hope was that the ordering of the triangles in
the chair and teapot models was making my tree highly unbalanced, but there's still something
else I need to do... Any suggestions are welcome in either the light limit or the BSP problems.
Homework #3: Soft shadows
This homework implements soft shadows by Monte Carlo sampling of circular light sources.
Stratified stochastic sampling reduces the variance in the sampling, thus leading to better
looking images, with less granular aspect.
You can see it in the results section.
Homework #4: Indirect illumination
In this simple homework we had to implement indirect illumination through a recursive set
of Monte Carlo integrations, to estimate how light bounces off diffuse surfaces. In our
final project on Photon Mapping, we'll obtain nicer images, thanks to the expected
acceleration. Also, caustics should be achieved. Meanwhile, enjoy these results.
Final Project: Photon Mapping
We created a whole project report that you can check out here.
Also, take a look at the results!.
|