Adaptive sampling improvements

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

Re: Adaptive sampling improvements

Post 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).
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Adaptive sampling improvements

Post 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
Support LuxCoreRender project with salts and bounties
provisory
Posts: 235
Joined: Wed Aug 01, 2018 4:26 pm

Re: Adaptive sampling improvements

Post by provisory »

Does the daily build contain the new adaptive sampling, and does it work with bidir?
User avatar
alpistinho
Developer
Developer
Posts: 198
Joined: Thu Jul 05, 2018 11:38 pm
Location: Rio de Janeiro

Re: Adaptive sampling improvements

Post 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! ;)
Support LuxCoreRender project with salts and bounties
provisory
Posts: 235
Joined: Wed Aug 01, 2018 4:26 pm

Re: Adaptive sampling improvements

Post 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?
User avatar
alpistinho
Developer
Developer
Posts: 198
Joined: Thu Jul 05, 2018 11:38 pm
Location: Rio de Janeiro

Re: Adaptive sampling improvements

Post 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
Support LuxCoreRender project with salts and bounties
provisory
Posts: 235
Joined: Wed Aug 01, 2018 4:26 pm

Re: Adaptive sampling improvements

Post 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.
Attachments
AdaptivityTest2.blend
(504.78 KiB) Downloaded 141 times
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Adaptive sampling improvements

Post 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 :?:
Support LuxCoreRender project with salts and bounties
User avatar
alpistinho
Developer
Developer
Posts: 198
Joined: Thu Jul 05, 2018 11:38 pm
Location: Rio de Janeiro

Re: Adaptive sampling improvements

Post 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?
Support LuxCoreRender project with salts and bounties
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Adaptive sampling improvements

Post 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?
Post Reply