Page 2 of 2

Re: MIS with IBL

Posted: Sun Jul 16, 2017 3:30 pm
by papaboo
Out of curiosity, because it sounds like I'm doing something very similar and back when I was investigating it I saw no bias issues, what is the RIS trap? Is RIS conceptually flawed or is it a reoccurring 'gotcha' that you keep forgetting?

Re: MIS with IBL

Posted: Tue Jul 18, 2017 1:59 pm
by jbikker
papaboo wrote:Out of curiosity, because it sounds like I'm doing something very similar and back when I was investigating it I saw no bias issues, what is the RIS trap? Is RIS conceptually flawed or is it a reoccurring 'gotcha' that you keep forgetting?


I used RIS for my light sources in the past: out of e.g. 1k lights, select 4 based on view independent information (i.e. brightness and area), then evaluate those four in more detail (including distance and orientation). This works like a charm until you need MIS. It is simply not possible to reproduce the probability of sampling a light explicitly when an implicit path reaches the light.

Re: MIS with IBL

Posted: Wed Jul 19, 2017 10:08 am
by rtpt
papaboo wrote:Out of curiosity, because it sounds like I'm doing something very similar and back when I was investigating it I saw no bias issues, what is the RIS trap? Is RIS conceptually flawed or is it a reoccurring 'gotcha' that you keep forgetting?


if you want to combine ris/mis have a look at the work of j. talbot and refs.

Re: MIS with IBL

Posted: Wed Jul 19, 2017 10:46 am
by jbikker
rtpt wrote:if you want to combine ris/mis have a look at the work of j. talbot and refs.


I am aware of his work, but I don't think he solved this issue, and in fact, I don't think it's possible.

Re: MIS with IBL

Posted: Wed Jul 19, 2017 1:50 pm
by papaboo
Interesting.

I guess I must do it slightly different then, because I just tested mine with MIS and MIS + 3 light RIS (or whatever warped self-rolled version of RIS I'm using) and there is no difference. I don't scale the PDF though when evaluating multiple light sources. I simply leave the light PDF as is and scale the contribution of the final selected light. That way my MIS weights should be fairly safe and independent of RIS.

The code looks like this

Code: Select all

    LightSample light_sample = sample_single_light(material, world_shading_tbn);
    for (int s = 1; s < light_samples; ++s) {
        LightSample new_light_sample = sample_single_light(material, world_shading_tbn);
        float light_weight = sum(light_sample.radiance);
        float new_light_weight = sum(new_light_sample.radiance);
        float new_light_probability = new_light_weight / (light_weight + new_light_weight);
        if (rng.sample1f() < new_light_probability) {
            light_sample = new_light_sample;
            light_sample.radiance /= new_light_probability;
        } else
            light_sample.radiance /= 1.0f - new_light_probability;
    }
    light_sample.radiance /= light_samples;