Today I fixed the memory hole in the code I wrote yesterday. I have decided to continue on the path I played with yesterday. I also rendered three more images, I changed the number of lights to create from 4 to 10.
| Segmented Sampling |  |
| Random Sampling |  |
| Random Sampling (9 times supersampling) |  |
I think it shows quite well, how much better the segmented approach is. The first image is not very noisy, the noise concentrates in the dark areas, the brighter parts of the shadow are very even. Also the banding is nearly invisible, only very near to the darkest area you can see it slightly. In contrast the true random sampling of image 2 creates a lot of noise. I wanted to see, what level of antialiasing I would need to make it similar in appearance. For 9 times supersampling (i.e. each pixel in the image was calculated from 9 primary rays) the image in 3 still shows more noise than image 1.
I believe, that the amount of noise is very similar in the images 1 and 2, after all I am using the same number of random samples, in image 1 I just have a better distribution which is closer to reality and therefor the amplitude of the noise is smaller. E.g. in the case of four samples, if only one fourth of the area light is visible I will only have one light source with 1/4th of the light. If slightly less is visible I make a small error by either assigning 1/4th or no light to the pixel. The average will be right again. In the truly random case I can have the situation, that two or more samples are in the visible part and so the intensity is much too bright. But there too on average it will be right.
The segmented case has its weakest point in the dark area, where either there is 1/4th of the light or nothing. In the areas farther away the error gets smaller. E.g. if 5/8ths of the light source are visible it will always use a minimum of 4/8ths and a maximum of 6/8ths. The random sampling can use anything from nothing to full light. So the segmented sampling will always have problems with banding, but random sampling will always be more noisy in the brighter parts. As the brighter parts are much bigger for reasonable amounts of samples, I will try to implement the first case for all the forms of area lights I have defined.