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 filterTriangle filterGaussian filter
Uniform sampling image
5.7
image
5.6
image
7.0
Jitter sampling image
5.7
image
6.2
image
7.1
Random sampling image
5.8
image
6.2
image
6.9

Box scene:

Box filterTriangle filterGaussian filter
Uniform sampling image
23.5
image
23.6
image
23.8
Jitter sampling image
22.1
image
22.7
image
24.1
Random sampling image
21.7
image
22.4
image
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.