Path Space Regularization (aka the solution to SDS paths)

Discussion related to the LuxCore functionality, implementations and API.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Path Space Regularization (aka the solution to SDS paths)

Post by Dade »

Vutshi wrote: Mon Sep 23, 2019 8:49 am I am curious about this darkening issue LuxCore has. If I understand correctly you said that eventually mollification will start to always return 0 and thus the image gets darker. I do not understand it. In my code if mollification returns 0 the path is just continued further according to the specular reflection/refraction law until it is killed by the Russian roulette.
I'm doing light tracing, not eye tracing (aka path tracing): in light tracing, you accumulate the samples on each pixel and then divide the value by the total amount of photon shot; clearly, more "black" photon (i.e. black samples), you add and darker the image becomes.

In eye tracing, instead of black samples, you will start to add samples without the caustic contribution so, instead of having the entire image becoming darker, you will have the disappear of only the caustics (on the long run).

SmallPT will show this behavior, if you choose a very aggressive mollification. Edit the following line:

Code: Select all

molif_r = 1.*pow(1.+s,-1./6); // Mollification shrinkage
in something like:

Code: Select all

molif_r = 1.*pow(1.+s,-1./2); // Mollification shrinkage
And the caustics should disappear first or later (reduce the -1/6 factor to decide how fast they will start to disappear .. or not appear at all).
Support LuxCoreRender project with salts and bounties
Vutshi
Posts: 16
Joined: Tue Jul 17, 2018 8:24 pm

Re: Path Space Regularization (aka the solution to SDS paths)

Post by Vutshi »

Dade wrote: Mon Sep 23, 2019 9:46 am I'm doing light tracing, not eye tracing (aka path tracing): in light tracing, you accumulate the samples on each pixel and then divide the value by the total amount of photon shot; clearly, more "black" photon (i.e. black samples), you add and darker the image becomes.

In eye tracing, instead of black samples, you will start to add samples without the caustic contribution so, instead of having the entire image becoming darker, you will have the disappear of only the caustics (on the long run).
Yes, I agree that a faster mollification will erase the caustics. But, as far as I understand, the main point of the paper is to use just the right rate of mollification such that only the initially excessive part of caustics get erased. The rate of mollification can never overtake the rate of image convergence such that the important contribution is always left in the image.

Regarding light tracing. Would you expect this darkening if the real delta is used (no mollification)?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Path Space Regularization (aka the solution to SDS paths)

Post by Dade »

Vutshi wrote: Mon Sep 23, 2019 10:51 am But, as far as I understand, the main point of the paper is to use just the right rate of mollification such that only the initially excessive part of caustics get erased.
The problem is the "right" rate is scene related with metropolis, it is tricky.
Vutshi wrote: Mon Sep 23, 2019 10:51 am Regarding light tracing. Would you expect this darkening if the real delta is used (no mollification)?
It is not possible to render the under water caustics at all if you use a real delta distribution. In the real world of 32bit floating point, you will never generate the only and exact path of the delta distribution. This is the point: you have to step near the edge of the cliff but never go there ... talking of living dangerously :D
Support LuxCoreRender project with salts and bounties
Vutshi
Posts: 16
Joined: Tue Jul 17, 2018 8:24 pm

Re: Path Space Regularization (aka the solution to SDS paths)

Post by Vutshi »

Dade wrote: Mon Sep 23, 2019 11:38 am It is not possible to render the under water caustics at all if you use a real delta distribution. In the real world of 32bit floating point, you will never generate the only and exact path of the delta distribution. This is the point: you have to step near the edge of the cliff but never go there ... talking of living dangerously :D
So the real delta distribution will result in a dark pool without any light reflected from its bottom. And currently LuxCore metropolis with PSR converges exactly to this solution. Is this understanding correct? If it is true then the metropolis mollification rate given in the paper is just too fast for some mysterious reason.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Path Space Regularization (aka the solution to SDS paths)

Post by Dade »

Vutshi wrote: Mon Sep 23, 2019 1:37 pm So the real delta distribution will result in a dark pool without any light reflected from its bottom.
Yes.
Vutshi wrote: Mon Sep 23, 2019 1:37 pm And currently LuxCore metropolis with PSR converges exactly to this solution.
It was when I was using the Metropolis large mutations count for the mollification progress, now I'm using a counter for each pixel so the mollification "speed" is a lot slower (i.e. film "width x height" slower on average).
Support LuxCoreRender project with salts and bounties
Vutshi
Posts: 16
Joined: Tue Jul 17, 2018 8:24 pm

Re: Path Space Regularization (aka the solution to SDS paths)

Post by Vutshi »

Dade wrote: Mon Sep 23, 2019 2:34 pm It was when I was using the Metropolis large mutations count for the mollification progress, now I'm using a counter for each pixel so the mollification "speed" is a lot slower (i.e. film "width x height" slower on average).
However, it does not really change the exponential scaling. The same effect can be achieved just by changing gamma, isn't it?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Path Space Regularization (aka the solution to SDS paths)

Post by Dade »

Vutshi wrote: Mon Sep 23, 2019 3:32 pm However, it does not really change the exponential scaling. The same effect can be achieved just by changing gamma, isn't it?
Yes, but you have have no tool to know if gamma is too small or not: you have to do a render with thousands of samples/pixel and if it was too small (i.e. gamma is too small and image goes dark) you have to try again. In practice, it was a nightmare.
Support LuxCoreRender project with salts and bounties
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Path Space Regularization (aka the solution to SDS paths)

Post by lacilaci »

Is this solution progressing somehow or are you looking into other options Dade?
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Path Space Regularization (aka the solution to SDS paths)

Post by lacilaci »

by the way, in an (poor) attempt to create some sort of reference straight in luxcore, I rendered 19K samples using bidir+metro that show how clear should the water become once the pool is filled with caustics...
19Kbidir.jpg
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Path Space Regularization (aka the solution to SDS paths)

Post by Dade »

I have somewhat built the perfect SDS benchmark. It is a pool scene with:

1) clear volume with no absorption and IOR 1.0 (like air);
2) water (i.e. glass) with (0.0, 0.0, 0.0) reflection and (1.0, 1.0, 1.0) transmission (so light is all transmitted). Note: if you use (1.0, 1.0, 1.0) reflection and (1.0, 1.0, 1.0) transmission, 50% is reflected so underwater is quite dark;

In the above conditions, water is perfectly transparent so what you see over-water must match what you see under-water.

This is a 1000 samples/pixel rendering with PSR:

psr.jpg

And this is a 50 samples/pixel (1.5 seconds pre-processing) rendering with photon mapping:

photon.jpg

PSR is never going to be reliable and/or easy to use, I give up. I will now on pursue a photon mapping/vertex merging solution. Photon mapping has is fair share of problems (notice the dark borders on polygon edges) but it is a least something I can work on.
Support LuxCoreRender project with salts and bounties
Post Reply