I originally wrote Deluxe Render in the days of dial up modems, AOL and a job called “render support”. Back then, I found a collection of “Global Illumination Test Scenes” on the web somewhere. It was just what I wanted. Unit tests for global illumination algorithms. (I like sentence fragments.) Everyone writing renderers was going to use them and compare results. They had been created and collected by Henrik Wann Jensen and others.
One of the scenes had a simple floor with two lights on either side. On the left was a light made of 100 square area lights. On the right was a light made of a single square area light. Using Monte Carlo sampling in a naive way, the light on the left gets sampled 100 times more than the one on the right, simply because it is made of more light objects.
Importance sampling samples the lights with a frequency commensurate with their size and distance to the point being shaded (or other criteria). So the closer, bigger light gets sampled 100 times more than the smaller lights, as it should be, beacuse it’s huge! The result is less noise. Samples are distributed where they are most important.
One of the things I love about importance sampling is usually buried in a lot of math and scary summations.
You can assign a likelihood that each light will be important. A guess based on what you know, like size, distance and other tea leaves. And you can sample using that likelihood (probability) to distribute your samples, which should add bias… That would make large lights falsely brighter, right? Here’s the thing I love. You just divide the collected illumination by your guess at importance. So if you thought a light was important and you sample it more, those samples count for less. If you were right, your samples collected a lot of important energy, and dividing them by your guess is not a big deal.
The result is the same overall radiance collected (less bias) with less noise (less error) in the result. It’s new age programming. Everyone is happy.
I used a contour render to make sure my perception wasn’t accepting any bias.
Now that Deluxe Render is running again, I’m running through these old test scenes. The code was gutted, so I need to make sure everything is working and test new features. Here I’m running this old test, and also testing a new gamma option in my code.
The noise at the bottom of the light on the right irks me. Is it something revealed by the gamma boost test? Something caused by the interference of the yellow sphere? Or something that could be improved by adding some importance term?
How was my importance sampling measuring distance to the lights? Centroid? Worth looking into these questions. Sentence fragments are the BEST.
To use these test scenes, I had to rewrite my mesh object and support OBJs. Here’s how THAT went at first.