(^) final project - cse 782

Joshua A. Levine
levinej@cse.ohio-state.edu

Overview
Results
Conclusions

Overview

For my final project, I decided to experiment with different sampling techniques. In particular, I implemented the paper Multi-Jittered Sampling by Chiu, Shirley, and Wang to improve the stratified sampler in PBRT.

The task basically involved changing how 2d samples were provided for the integrators that pbrt uses. If the integrator needed 4 2d dimensional samples, and there are 3 samples per pixel, the default is for the stratified sampler to generate 3 sets of 4 of samples using latin hypercubes (LHS). However, the distribution of those samples, while individually may be ok, could potentially cause the total set of samples to not be well distributed among themselves.

One solution is to use this multi-jittering technique, which simultaneously satisfies both the LHS property as well as stratified sampling. Below I show two images which illustrate the input (left) and output (right) of the multi-jittered approach, here we have generated 12 samples which will correspond to the 4x3 samples we need for a pixel


The above demonstrates how the multi-jittered would work on a set of m x n samples, m = 4, n = 3. We first begin by picking samples in the red squares, which trivially satisfied the LHS and stratified conditions. We next do a random set of swaps in either rows or columns of the larger blocks. By projecting the samples to the x-axis and y-axis, one can see that LHS is satisfied. Clumping is reduced from the typical stratified sample and moreover the constraint that we have a perfect square is now gone. Basically we get the best of both ideas.

Since when we do the multi-jittering we result in a per pixel sample, one needs to specify how this sample is distributed among the n image samples. It seemed like the logical choice here was to just pick the i-th row of samples for each image sample. They already have the necessary m samples needed, and there are n of them. Moreover, each row is well distributed when projected on the y-axis (although this is not true on the x-axis). Below I found that I got pretty good results with this method.





Results

We tested out the samplers on 3 different scenes. First I designed a checkerboard scene which I hoped would highlight aliasing problems that would be apparent in the stratified sampler, but less so in the multi-jittered. Below are the results with a comparison of 4 samples/pixel:


Stratified (4 samples/pixel)

Multi-Jitter (4 samples/pixel)

Best-Candidate (4 samples/pixel)

From the above I have a tough time really telling a difference between the images. It looks as though the best candidate is slightly better, which I would expect. However, between the stratified and multi-jittered there is very little difference unfortunately. I'm not fully sure why here, but I think part of the problem is that they are all too-well sampled for this scene.

Next I did an experiment with the areapot scene that comes with pbrt. I did find a large difference between the multi-jittered and stratified. The top row has 4 samples/pixel while the bottom has only 1 sample/pixel:


Stratified (4 samples/pixel)

Multi-Jitter (4 samples/pixel)

Stratified (1 sample/pixel)

Multi-Jitter (1 sample/pixel)

Here this is a pronounced improvement using the multi-jittered technique. Especially around the shadow of the teapot's spout, which is far clearer (esp. in the 1 sample/pixel view).

Finally I show a scene with a bump-mapped sphere, also from pbrt's scene collection. I show the results with 2 samples/pixel for four different samplers, the low discrepancy (default for the scene), best candidate, stratified, and multi-jittered:


Stratified (2 samples/pixel)

Multi-Jitter (2 samples/pixel)

Low Discrepancy (2 samples/pixel)

Best Candidate (2 samples/pixel)

I think the most glaring issue here is actually with the best candidate sampler, which has black specks throughout the image. Apparently to sample this well, this sampled needs more than 2 samples/pixel. Although if you look at the lines of the texture, I feel like the best candidate captured them better than the other three.

In terms of comparison with the multi-jittered and the stratified, it's tough to say which is better. The multi-jittered produced a slightly sharper imagine, with the lines on teh texture more produced, but also more aliased. Whereas the stratified is smooth and closer to the low discrepancy, which in this case did the best job.



Conclusions

From the above experiments, I don't think it's very conclusive that using the multi-jittered approach makes the resulting sampling better than the original stratified sampling. In terms of aliasing on the checkerboard, both seemed to perform equivalently, and some images not included here at a lower sampling rate were also equivalent. Plus compared to the best candidate algorithm which runs in comparable time, they were slightly worse.

In the teapot experiment, the multi-jittered approach did make a nicer shadow on the neck, but that was the only marked difference between the two.

Finally in the bumped sphere, again they were similar in their results. The texture on the multi-jittered was slightly sharper, but also slightly more jaggy as a result.

So overall, both performed pretty similarly. Neither however were significantly more expensive to do, so really there's no strong conclusion as to which is better.