Page 5 of 15

Re: Adaptive sampling improvements

Posted: Thu Apr 11, 2019 8:46 am
by Dade
alpistinho wrote: Thu Apr 11, 2019 1:02 am
Dade wrote: Wed Apr 10, 2019 6:35 pm #1 Convergence AOV with values between 0.0 and 1.0, optional stop the rendering when all values are under the halt threshold. Somewhat the old Convergence AOV.
Do you want me to normalize this or should I use the same code as before?
Whatever fit better the intuitive concept of what the Convergence AOV: it should start with a (nearly) white image (i.e. all pixels far from convergence) and end with a black image (i.e. all pixels under the halt threshold).

Re: Adaptive sampling improvements

Posted: Thu Apr 11, 2019 8:52 am
by Dade
alpistinho wrote: Thu Apr 11, 2019 1:01 am I have wrote the changes to create the new NOISE AOV, and the necessary changes on the convergence test code.
I have broken LuxCoreUI and haven't been able to fix yet. I am getting:

Code: Select all

RUNTIME ERROR: Unknown FilmChannelType in Film::GetChannelCount(): 1073741824
You have to add the code for the new AOV in a lot of places, just search for an old one and add the new one everywhere it is mentioned. The specific problem is the lack of a "case" for the new AOV, here: https://github.com/LuxCoreRender/LuxCor ... s.cpp#L119

Re: Adaptive sampling improvements

Posted: Thu Apr 11, 2019 1:27 pm
by provisory
Does the daily build contain the new adaptive sampling, and does it work with bidir?

Re: Adaptive sampling improvements

Posted: Thu Apr 11, 2019 2:30 pm
by alpistinho
provisory wrote: Thu Apr 11, 2019 1:27 pm Does the daily build contain the new adaptive sampling, and does it work with bidir?
Yes and yes. Please report any issues you find! ;)

Re: Adaptive sampling improvements

Posted: Thu Apr 11, 2019 3:53 pm
by provisory
It looks like brighter parts get much more samples.
I'm not in front of PC right now. Do you need an example scene?

Re: Adaptive sampling improvements

Posted: Thu Apr 11, 2019 4:00 pm
by alpistinho
provisory wrote: Thu Apr 11, 2019 3:53 pm It looks like brighter parts get much more samples.
I'm not in front of PC right now. Do you need an example scene?
If you have a scene that you believe the sampling is suboptimal, please share

Re: Adaptive sampling improvements

Posted: Thu Apr 11, 2019 5:37 pm
by provisory
So, I've first seen the issue with this scene (100 samples in both case, warmup and test step is 5 with adaptivity):
adaptivity-test1.png

But the samplecount difference by brightness is there in the simplest case too (50 samples, warmup and test step is 1):
adaptivity-test2.png

I've attachet this second, simple test scene.

Re: Adaptive sampling improvements

Posted: Thu Apr 11, 2019 9:02 pm
by Dade
provisory wrote: Thu Apr 11, 2019 5:37 pm But the samplecount difference by brightness is there in the simplest case too (50 samples, warmup and test step is 1):
It is intended and the result of this line of code: https://github.com/LuxCoreRender/LuxCor ... t.cpp#L121

Code: Select all

const float imgSum = imgR + imgG + imgB;
const float diff = (imgSum != 0.f) ?
	((dr + dg + db) / sqrt(imgR + imgG + imgB)) : 0.f;
The color "noise" is divided by the square of the color intensity: darker color have a larger denominator so they receive less samples. The paper explanation is:
The square root in the denominator is motivated by the logarithmic response of the human visual system to luminance. The term here behaves similarly, is easier to evaluate and was found to yield slightly better results.
It is about perception so we can argue if it is right :?:

Re: Adaptive sampling improvements

Posted: Fri Apr 12, 2019 11:41 am
by alpistinho
Hi,

I hope to finish the discussed changes this weekend.

@Dade, can you give me a wiki account so I can update the SDL page when I change it?

@Provisory,

As Dade said, the metric drives the sampling to the brighter regions due to the mentioned psychovisual considerations.

Do you think this is inappropriate?

Re: Adaptive sampling improvements

Posted: Fri Apr 12, 2019 12:09 pm
by B.Y.O.B.
In the posted example picture, the bright lamp appears noise-free to me in both renders.
However, the wall is clearly more noisy in the render with adaptive sampling.

In general, I agree that a noise metric should be based on the human vision system, but the metric that is currently used does not seem very good at this to me.

By the way, it looks like the current metric only compares old with new, but not neighboring pixels, is that correct?