MIS with more than one light

Starting easy.
Posts: 7
Joined: Fri Jul 25, 2014 1:22 am

MIS with more than one light

Postby yuriks » Thu Jul 31, 2014 7:20 pm

Hello, first time poster here. It seems like this is the only ray-tracer development community around! :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:
Now I have this, with the same amount (1024 per pixel) of samples:

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: 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: https://github.com/yuriks/NoiseRay/blob ... n.cpp#L174

Posts: 83
Joined: Thu Apr 24, 2014 2:27 am

Re: MIS with more than one light

Postby MohamedSakr » Sun Aug 17, 2014 1:51 am

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

Return to “My First...”

Who is online

Users browsing this forum: No registered users and 1 guest