Assignment 1

Kyle Moore

COMP 870 - Advanced Image Generation
Professor Anselmo Lastra
September 12, 2006


Intro

The ray tracer used in this assignment was based on a ray tracer I wrote for a previous class at The Ohio State University. It uses the Coin3D (OpenInventor) file format for describing scenes. It was originally written to run in Unix, but I ported it to Windows because I prefer windowed GUIs to the command line. It is written in C++ and I used Microsoft .NET to make the GUI. It was built in Visual Studio .NET 2003 and VS 2003 should be used to test the code. In all likelihood it will not run in VS 2005 because of the changes to managed C++ in .NET 2.0. However, I have not tested it in 2005.

Features

Some of the features include: reflection, refraction, soft-shadows, and anti-aliasing. The anti-aliasing routine is adaptive, meaning the program can detect when anti-aliasing is not needed and turn off super sampling to increase rendering performance. Currently no acceleration techniques are used, but I intend to try some in the future.

Techniques

The sampling techniques used were a uniform 4x4 grid, a jittered 4x4 grid, and a set of 16 completely random samples within the boundaries. The reconstruction filters used were the box filter, the tent filer, and the Mitchell-Netravali filter. For the Mitchell-Netravali filter the value 1/3 was used for both B and C as suggested. For the box filter, the sampling pattern was constrained to the size of the pixel, whereas for the other filters the sampling was allowed to move half a pixel width outside of the pixel. Below, the results of each are compared.

Results

Full Image Sampling
Uniform 4x4 Grid Jittered 4x4 Grid 16 Random Samples
Reconstruction Box Filter
Tent Filter
Mitchell-Netravali Filter (1/3, 1/3)

 


Zoomed Image Sampling
Uniform 4x4 Grid Jittered 4x4 Grid 16 Random Samples
Reconstruction Box Filter
Tent Filter
Mitchell-Netravali Filter (1/3, 1/3)

Discussion

As we look at these results we see some very interesting things. The most obvious observation is that 16 random samples did not turn out very well. For all the reconstruction filters, the random sampling produced the most "jaggy" images. This is interesting because some would think a random sample would be the noisiest, however it produced images with very little noise. This is probably due to the fact that the randomness ended up creating samples that were very close to each other and not representative of the entire area being sampled. This makes them appear like single point samples whereas there are actually many samples close together. This emphasizes the need for Poisson-like distributions when using random samples. With out constraints put on the randomness, it will likely produce a very bad set of samples.

Next, we compare the difference between a uniform grid and a grid that has been jittered. With the box filter, there is little noticeable difference between the images produced by uniform and jittered grids. This is likely because the average of the box filter suppresses small differences over a region and because the samples all resided within the pixel boundaries for this filter. With other filters, the samples were allowed to move outside of the pixel boundaries which produced more noise between the uniform and jittered methods. The most noticeable difference was found with the Mitchell-Metravali filter. We see here that jittering helped to break up the regularity by adding randomness. Since this is the goal of jittering, we see that it is fairly effective and produces a much more natural and less "aliased" image. However, some might argue that the jittering caused too much noise in the Mitchell-Netravali case. Therefore, it is a trade-off between noise and aliasing, and is largely up to a person's preference as to which is better.

Now I will compare the reconstruction filters. It is fairly obvious that the box filter created images with the most "jaggies". This is in keeping with theory, as the box filter is known to create box-like artifacts. The tent filter created much softer images than the box filter. While some of the edges in with this filter appeared a bit blurry, I did not see the ringing effect that is common with the tent filter. Perhaps if my window size were bigger, they would have appeared. Overall, I would rate the image quality of the tent filter as better than that of the box filter. The Mitchell-Netravali filter behaved very similarly to the tent filter. This is likely because at the sampled locations, the M-N filter closely approximated a linear curve instead of a cubic one. More samples could have improved the quality of this filter. The two noticeable traits you see from this filter are that it is a little bit crisper than the tent filter, but also tends to add more randomness when jittering is used. I believe this to be happening because of negative portion of the curve, which in theory will help some pixels appear darker when samples randomly lie in this region. For this reason, I recommend using more than 16 samples with this filter. Therefore, I believe that the tent filter with jittering created the best images out of these tests. This is largely personal opinion and with more samples I think the M-N filter would look best.

I would like to add a word about performance. While I have no performance measures built into the program, I did try to "guestimate" the performance for each of these methods. Overall, my impression was that all of the methods performed equally. This makes sense because all methods use the same number of samples which should translate roughly to the same number of rays (with reflection and refraction there may be more or less rays used depending on the sampling.) The reconstruction filters also perform similarly because they all involve simple math (an average at the simplest, and a cubic function evaluation at the hardest.) The differences in calculation times between the different operations is fairly negligible next to the time spent on other bottlenecks in this program. Therefore, the decision about which method to use - between the ones presented here - can be based entirely on image quality.

Code

Here is a link to the code. This should be opened with Visual Studio 2003.

Grading & Comments

Grading information and comments can be sent to .