## Veach thesis - formula question

Practical and theoretical implementation discussion.
spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

### Re: Veach thesis - formula question

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
Spectral
OMPF 2 global moderator

Zelcious
Posts: 42
Joined: Mon Jul 23, 2012 11:05 am

### Re: Veach thesis - formula question

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'||.

apaffy
Posts: 46
Joined: Thu Dec 01, 2011 11:00 pm
Location: UK
Contact:

### Re: Veach thesis - formula question

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).

ingenious
Posts: 282
Joined: Mon Nov 28, 2011 11:11 pm
Location: London, UK
Contact:

### Re: Veach thesis - formula question

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.

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

### Re: Veach thesis - formula question

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 6085 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 ?
Spectral
OMPF 2 global moderator

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

### Re: Veach thesis - formula question

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 ?!
Spectral
OMPF 2 global moderator

Zelcious
Posts: 42
Joined: Mon Jul 23, 2012 11:05 am

### Re: Veach thesis - formula question

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.

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

### Re: Veach thesis - formula question

Right, I understand... its efficient ! Veach framework is really incredible... I fall in love
Spectral
OMPF 2 global moderator

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

### Re: Veach thesis - formula question

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 6014 times
Spectral
OMPF 2 global moderator

Dietger
Posts: 50
Joined: Tue Nov 29, 2011 10:33 am

### Re: Veach thesis - formula question

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.