comp870 - Assignment 1
Overview
For this assignment, I used a raytracer I had written previously. I implemented three sampling methods and three reconstruction filters. I also added triangle intersections and support for loading obj models.
The code and data for the project is available here.
Sampling
For my sampling methods, I chose to use a non-random uniform grid, a jittered grid, and random sample distribution. The results from the two random methods were similar, both reducing aliasing and outputing a scene with tolerable noise. The uniform method suffers from severe aliasing.
When perfoming the sampling, the code samples in rows. Three rows of samples are always known. As the framebuffer values are found, the old rows are discarded.
Reconstruction
I implemented three reconstruction filters. These where a box filter, a triangle filter, and a gaussian filter. The triangle filter produced scenes with sharper edges than the other two, but it also displayed artifacts at the edges in many cases. The box and gaussian filters output blurry scenes, but without noticable artifacts.
Since there are always three rows of samples available, the reconstruction methods can sample nearby pixels to generate the final framebuffer values. All reconstruction filters used a radius of 1.5 pixels from the center of the current pixel. Values in this radius were considered when reconstructing the final output.
Results
Checkboard scene:
Box filter | Triangle filter | Gaussian filter | |
Uniform sampling |
5.7 |
5.6 |
7.0 |
Jitter sampling |
5.7 |
6.2 |
7.1 |
Random sampling |
5.8 |
6.2 |
6.9 |
Box scene:
Box filter | Triangle filter | Gaussian filter | |
Uniform sampling |
23.5 |
23.6 |
23.8 |
Jitter sampling |
22.1 |
22.7 |
24.1 |
Random sampling |
21.7 |
22.4 |
24.6 |
Conslusions
After many tests, jittered samples produce the most pleasing results. This is expected; jittering grid values is likely to produce a good spread of values while still elimenating the aliasing that plague uniform sampling. For reconstruction, triangle or gaussian appears to give the best output. The triangle filter suffers from artifacts, but gives sharp clean results. By adjusting the filter size, the results of the gaussian filter could likely be improved.