CS 7650: Realistic Image Synthesis

Thiago Ize

Efficiency-Optimized Russian Roulette

I decided to make some comparisons between using a fixed max ray depth size, Russian roulette with a fixed kill probability, Russian roulette with kill probability proportional to the path's current importance, and efficiency-optimized Russian roulette.

The Russian roulette with proportional probability is the same as the efficiency-optimized Russian roulette except that the user specifies the value for which to divide the path throughput (importance) by instead of having this value calculated from the previous n rays cast.

I have the Russian roulette turn on after the ray depth is greater than 3 since for the first several bounces it is really likely that a light source is hit and it would be a shame to terminate a ray after just one bounce.

I modified the Cornell box scene slightly so that the far bottom left corner is covered from above and partly from the side (the box is hiding the side cover). The slope of the covers makes it even harder for light to escape. I did this so that the area in the corner would be more heavily shadowed and thus better show the differences between the methods (if there is little shadowed area, the images would all look roughly the same since most pixel contributions would come from depths of less than 4 and all the methods, in my code, handle paths of less than 4 the same way).

To compare the images, look at the resulting image diffs. You'll notice that the fixed depth images, unless you use a vary large depth, will have more error in the shadowed areas since rays were terminated before they had a chance to hit the light. The "speckles" in the Russian roulette images are from the increased variance that results from Russian roulette, since each time you let a ray bounce, you need to increase the value of that ray (so a ray that bounces 10 times in the 50% kill Russian roulette would be 2^10 times brighter than a ray that hit the light source from the start). Finally, note how the efficiency optimized Russian roulette has no bias, the amount of variance compares roughly (or possibly better) with the fixed depth of 100 image, and is faster than the fixed depth 7 and 30% kill Russian roulette. All the images however show some error compared to the reference image since I didn't have time to take enough samples. Alas...

If you want to learn about efficiency-optimized Russian roulette, look at chapter 10 of Veach's thesis.

I used this bash script to generate the difference image.

The following images were made using 5,000 rays per pixel.
 Rendered Image contrast enhanced diff with Reference Image dark areas enhanced diff with Reference Image Details Reference image around 4-5 hours Since I want something that looks perfect (or close to it)this uses 10,000spp Fixed Maximum depth (100). 134 minutes. fixed max ray depth of 100. ray depth of 100 should make this pretty much optimal Fixed Maximum depth (10). 33.9 minutes Fixed Maximum depth (7). 27.7 minutes Fixed Maximum depth (5). 23.1 minutes Fixed Maximum depth (3). 17.4 minutes Efficiency-Optimized Russian Roulette. 24.8 minutes Proportional to 0.004 (actually 1/255) Russian Roulette. 24.2 minutes Proportional to 0.01 Russian Roulette. 23.5 minutes Russian roulette with 30% kill probability. 27.6 minutes note the noise that comes from the increased variance. Russian roulette with 50% kill probability. 24.8 minutes While this is around the same speed as fixed depth of 5 and the bias is much lower (there is actually none), the increased variance, in my opinion, ruins the image.

Side by Side comparisons of the "good" choices.

 0.004 Proportional Russian Roulette Efficiency-Optimized Russian Roulette Fixed Maximum depth(100) Fixed Maximum depth(10) Images contrast enhanced diffs dark area enhanced diffs

Here's a zoomed in version of the modified cornell scene:

 Rendered Image contrast enhanced diff with Reference Image dark areas enhanced diff with Reference Image Details Reference image -- 100,000spp with proportional to .04 and min depth before Russian roulette turns on at 100. (many hours) Fixed Maximum depth (10) at 10,000spp 89.1 minutes Proportional to 0.004 (actually 1/255) Russian Roulette at 30,000spp 67.7 minutes Efficiency-Optimized Russian Roulette at 30,000spp 76.9 minutes
Here's another example that exploits the strengths of Russian roulette over fixed depth. These images all use 1,000spp.

 Rendered Image Details entire scene 10.5 minutes Efficiency-Optimized Russian roulette Zoomed in Fixed Max depth of 10. 10.6 minutes note how after 10 bounces nothing is drawn. Zoomed in Fixed Max depth of 100. 53.2 minutes note how this is still incomplete even after 100 bounces. Zoomed in Efficency-optimized Russian roulette. 28.8 minutes note how things are drawn until the very end (at least it looks that way). Also interesting is how the the render time has gone up compared to the entire scene render above, which also used efficency-optimized Russian roulette, but it's still faster and more complete than the 100 depth render. This shows how this method will go faster on the easy sections and slower on the harder sections. Zoomed in Russian roulette with probability proportional to pathThroughput/0.01 32.6 minutes This is a bit slower than the efficency-optimized Russian roulette, but quality is about the same. Zoomed in Russian roulette with probability proportional to pathThroughput/0.1 31.3 minutes This is still a bit slower than the efficency-optimized Russian roulette and now the quality is not as good (much more noisy). Zoomed in Russian roulette with probability proportional to pathThroughput/0.5 27.8 minutes This is finally a bit faster than the efficency-optimized Russian roulette, but now the quality is rather bad due to the high noise. Zoomed in 30% kill Russian roulette. This clearly looks horrible. Those few pixels that got drawn in the middle were actually extremely bright before they were clamped; that's why there is no bias introduced (but clearly the variance is HUGE).

Conclusion

According to these two scenes, efficiency-optimized Russian roulette and Proportional Russian roulette win hands down for both speed, low variance, and lack of introduced bias. The proportional Russian roulette seems to work about as well as the efficiency-optimized Russian roulette, which makes sense since they both operate the same way. The efficiency-optimized version should be a bit better since the proportionality constant can react according to the scene, but I can't see the difference. In the end I would recomend using the proportional version since it's so easy to implement.