MIS with more than one light back

Board: Home Board index Raytracing General Development

(L) [2014/07/31] [tby yuriks] [MIS with more than one light] Wayback!

Hello, first time poster here. It seems like this is the only ray-tracer development community around!  [SMILEY :cry:]
In my spare time, I'm reading PBRT and developing a ray/path/hacktracer of my own. Using the book for a mathematical and technical foundation but then trying to apply my own ideas.
Recently I've implemented Multiple Importance Sampling for the sampling of surfaces. I do this by, on each intersection, sampling both a random direction from the BRDF and also sampling a random light, then combining both using the power heuristic.
When I have only a single light, the results are beautiful. Whereas previously I had this:
[IMG #1 Image]
Now I have this, with the same amount (1024 per pixel) of samples:
[IMG #2 Image]
So the algorithm seems to work well. The problem is when I add a second light source to the scene, the noise comes back! This is a render with a second light source. Even though it uses 4096 samples per pixel it is significantly noisier: [IMG #3 Image]
I am probably using the technique incorrectly. Perhaps I need to sample all light sources at once, instead of randomly picking one like I'm doing now? That doesn't seem like it would scale well as the number of lights go up, however. The implementation was loosely based on pbrt's DirectLightingIntegrator, and I suspect the reason why it doesn't work properly is that I also have multi-bounce indirect lighting. You can see my core integration function here: [LINK https://github.com/yuriks/NoiseRay/blob/master/src/main.cpp#L174]
[IMG #1]:[IMG:#0]
[IMG #2]:[IMG:#1]
[IMG #3]:[IMG:#2]
(L) [2014/08/17] [tby MohamedSakr] [MIS with more than one light] Wayback!

read smallVCM [LINK http://www.smallvcm.com/]
it contains a good MIS implementation, + some good integrators  [SMILEY :D]

back