CS 6650, Fall 2002
Program 5: Metropolis Light Tansport
David Cline
Baseline Images:
The first thing I needed to do was make sure that my accumulation strategy would produce reasonable results. To this end I produced a couple of baseline images, one for the totally diffuse case, and one for the specular case.
|
Diffuse baseline image. Path traced using 2000 paths per pixel. |
Specular baseline image. Path traced using 10000 paths per pixel. |
Accumulation Strategy:
The basic sampling strategy I am using is to compute light paths using spectral colors, convert each sample to XYZ space, and then accumulate the samples in an XYZ image. I consider a single sample to be an XYZ triple in which X+Y+Z=1. After all of the samples are accumulated, I convert to RGB for the final output.
For this test I generated samples by choosing random paths in the scene. Instead of computing a single path from the image plane to a light source in the scene as Veach does, each vertex of the path sends a ray to light source. In other words, the F(.) that I am evaluating is a standard path tracing path that includes direct lighting. Since the path at a given screen location is chosen at random, this solution can be thought of as a 2D metropolis algorithm in which the value of F(x,y) cannot be evaluated directly, but we can take samples from a distribution that has expected value F(x,y). The only mutation strategy I used for these images was to create a new random path each time. The scalar value needed for mutation, S(x,y), was evaluated by converting the spectral color returned by the random path to XYZ space, and then summing the X, Y and Z values: S(x,y) = X+Y+Z. A sample was created by dividing the XYZ triple by (X+Y+Z). Also, in this example I am assume that the transition probabilities T((x,y) | (x1,y1)) and T((x1,y1) | (x,y)) are equal. The images below show the viability of this sampling strategy:
|
This image shows counts of samples accumulated at each pixel, basically a grayscale version of the scene. 100 samples per pixel on average were used in this image. |
Result of accumulating in XYZ space and converting the XYZ image to RGB. |
Difference between the previous image and the diffuse baseline image (scale=2). |
Using the accumulation strategy described above, I created a metropolis image of the specular box. The results are show below
|
Metropolis image of the specular box with 100 samples per pixel. |
Difference between the previous image and specular baseline image (scale=2) |
Note that bright speckles appear, just as in regular path tracing. This is likely due to the naive mutation strategy.
The first tests were really just to make sure that my accumulation strategy was working. The next stage is to change the light path framework so that each sample is a path from the eye point to the light source:
|
The diffuse box is about the same as before. 100 paths per pixel. |
|
|
Up to now I assumed that the probability of all the paths was equal. This worked until I tried an object that was both reflective and transmissive. For objects with more than one type of reflection, I set the probability of the path to the probability of creating that reflection/transmission sequence. |
Here, with the path probabilities worked out, the transparent sphere is as bright as it should be. This quite a bit noisier than the one above, but it still seems to be moving towards the correct result. 100 paths per pixel. |
Finally, I’m getting to the mutation strategy. For this example, I have 2 types of mutations. The first is simply to create a new path. The second mutation is essentially the “squiggle” mutation that we talked about in class. This is basically a combination of the lens and caustic perturbations.
|
Path tracing. Even with 200 samples per pixel, the caustic appears as just a bunch of noise. |
Metropolis does a much better job of finding caustic paths, although there are still some major problems in my image. Hmm. |
Looking back at the paper, I noticed that Veach uses an exponential distribution for path mutations, while I was using a uniform distribution. Another thing that the paper suggests is that path tracing be used for direct lighting. Adding these improvements, I get:
|
Direct Lighting |
Metropolis Estimate |
Metroplolis Computation |
Metropolis plus Direct Lighting |
|
|
|
200 mutations per pixel |
|
|
|
|
200 mutations per pixel |
|
|
|
|
250 mutations per pixel |
|
|
|
|
600 mutations per pixel |
|
As can be seen by the images, there are still some major issues with the way I’m doing things. The diffuse box scene works okay, but as soon as specular paths are added to the scene, everything goes haywire. The box with two spheres seems to be a total failure. The speckles in the scene have been turned into bright smudges. In the third row of the table, the sphere is not reflective, only transmissive. Even in this case, annoying smudge marks appear on the left wall. Every time a caustic path is found in the scene a bunch of samples get added near that point. There seems to be a major flaw in my methodology as it stands.
After tweaking a few parameters, I got slightly better results on the ring scene:
|
Metropolis, 450 mutations per pixel |
Path tracing, 900 paths per pixel |