Page **8** of **9**

### Re: Veach thesis - formula question

Posted: **Mon Jul 23, 2012 7:17 pm**

by **spectral**

But how MIS can fix the problem ? The problem is due to very small value of ||x-x'|| and G is not part of the path pdf ! G is not related with the way we sample... there is no relation !

What do I miss ?

I was also thinking to merge the vertices when ||x-x'|| is too small... but it will introduce a an error in the image, so I have to take a sheet of paper a find a theoretical solution before

BTW: I have just found this paper, looks interesting :

https://graphics.cg.uni-saarland.de/fil ... ia2011.pdf

### Re: Veach thesis - formula question

Posted: **Mon Jul 23, 2012 8:06 pm**

by **Zelcious**

spectral wrote:But how MIS can fix the problem ? The problem is due to very small value of ||x-x'|| and G is not part of the path pdf ! G is not related with the way we sample... there is no relation !

What do I miss ?

[/url]

You are missing the conversation from solid angle to area measure. That contains ||x-x'||.

### Re: Veach thesis - formula question

Posted: **Mon Jul 23, 2012 8:08 pm**

by **apaffy**

spectral wrote:But how MIS can fix the problem ? The problem is due to very small value of ||x-x'|| and G is not part of the path pdf ! G is not related with the way we sample... there is no relation !

What do I miss ?

Due to MIS, that sampling technique will be assigned a small enough weight that the Monte Carlo sample will no longer be huge. And your MIS pseudo-code in the post before that makes no sense, you need to compute the pdf (or usually pdf ratios) for all the techniques that could sample your

*current* path, then use this to compute the MIS weight (for your current path).

### Re: Veach thesis - formula question

Posted: **Mon Jul 23, 2012 8:32 pm**

by **ingenious**

spectral wrote:I was also thinking to merge the vertices when ||x-x'|| is too small... but it will introduce a an error in the image, so I have to take a sheet of paper a find a theoretical solution before

BTW: I have just found this paper, looks interesting :

https://graphics.cg.uni-saarland.de/fil ... ia2011.pdf

That works too indeed

But gives you an estimate of different type of transport, i.e. one fewer path segment, and is useful for other types of transport (caustics). Just go back to the pen and paper exercise - draw one length-3 path (i.e. 3 edges), where one of the edges is really short, much shorter than the others. Then compare the (product area) pdfs of two possible ways to construct that path, where one of the ways is by connecting along that short segment. You'll see that the other technique has a much higher sampling pdf, and will thus be weighter much higher in a MIS combination.

### Re: Veach thesis - formula question

Posted: **Tue Jul 24, 2012 8:03 am**

by **spectral**

When I compute the MIS weight, I have to use pdf in differential area and not in solid angle to compute my MIS !

Today, I use pdf in solid angle my path pdf is just the product of all theses pdf expressed in solid angle !

It seems easier to compute the L value (see picture below). So, I should I convert all theses pdf to dA before for MIS computation ?

Th eproblem is that I have to compute the product of all the path

**pdf in solid angle** (the one I will use when I connect with a segment) and also, I will compute the

**path pdf in dA** for the MIS ! I have to compute 2 path pdf (in different units). Or maybe it is better to compute L = LE G f G f G f G We directly and use P_A(X0)...P_A(X5) as the path pdf to avoid to compute the 2 paths pdfs ? It is a question of implementation you will tell me... In fact, using the pdf is solid angle avoid to play with the G term (and avoid some possible divisions by a very small distance !). Do you have councils for the implementation to avoid as much as possible conversions and possible division by 0 (or division by very small values) ?

- REA.png (3.51 KiB) Viewed 6091 times

BTW, in my path pracer, I use the power-heuristic to mix the bsdf-sampling and light-sampling, both paths have the same length but theses are different paths. Is it incorrect ? Simon, you tell that I can "only" use MIS to mix the same path with different sampling techniques ?

### Re: Veach thesis - formula question

Posted: **Tue Jul 24, 2012 9:51 am**

by **spectral**

I have also check the pbrt code and found the following code / math.

The compute the W(Xj) this way :

power-heuristic = lightPdf_da*lightPdf_da / (lightPdf_da*lightPdf_da+bsdfPdf*bsdfPdf)

Their bsdf_pdf is not computed in dA ! By example, for diffuse material they use |dot(wi, Ns)|/Pi => This one is expressed in solid angle ?!

### Re: Veach thesis - formula question

Posted: **Tue Jul 24, 2012 9:52 am**

by **Zelcious**

This is how MIS works:

You have a path generated by one of several sampling strategies. Lets say you generated the path by connecting to a VPL and the other sampling strategy you use in your software is plain Path tracing.

In this particular case the connection was really close causing extremly high G term. This is correct since the likelyhood of a really close connection is equally low so for it to be correct you have that division by square distance.

However in this case you also have another sampling strategy, path tracing. Now lets consider if you had created this very same path by path tracing, then the G term would have been canceled out. So when we are using MIS we balance the pdf with all the ways we could have generated the very same path. In this case with path tracing and VPL. However to do that we need to compare the same thing, the contribution F needs to be the same. So we could convert to Area measure like in veach thesis or introduce a G in both contribution and pdf for the path tracing case. It's been there all along, it's just been canceled.

Hopes it makes sense.

Remember: Compare the probability of the path with all the ways it could have been created by your software and make sure the contribution part, numerator, is the same before you begin.

MIS is not a way to weight different paths, it is always the same path by all the ways it could have been generated. That said there is nothing stopping you from doing several MIS at the same time. Like when sampling a light by angle or area.

### Re: Veach thesis - formula question

Posted: **Tue Jul 24, 2012 2:02 pm**

by **spectral**

Right, I understand... its efficient ! Veach framework is really incredible... I fall in love

### Re: Veach thesis - formula question

Posted: **Thu Jul 26, 2012 3:53 pm**

by **spectral**

First, thanks for all your help up now...

Now I'm back with MIS questions. I have the following formulas and if I have (a) and (b) and compute the value of 'I' I got the following !

What do I miss please ?

BTW: theses formulas are coming from "a survey of importance sampling applications in unbiased physical based rendering" (page 15 & 16)

- MIS01.png (37.21 KiB) Viewed 6020 times

### Re: Veach thesis - formula question

Posted: **Thu Jul 26, 2012 4:21 pm**

by **Dietger**

I assume you are referring to equations (3.3) and (3.7). Note that equation 3.3 does not correspond with your equation a. Equation 3.3 sums over a collection of N different samples X_1 ... X_N, which in BDPT terms is the collection of bidirection connections generated by a single eye and light path. Each 'sample' here is a single light transport path connecting the eye with a light source. These samples are than combined using equations 3.3 and 3.7 to form the combined Monte Carlo sample I (a bidirectional uber sample, if you will

). However, in your equation a, you simply re-use the same sample X repeatedly.