OIDN Bad quality result and analysis of the problem to see if we can get it fixed :)

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
juangea
Donor
Donor
Posts: 332
Joined: Thu Jan 02, 2020 6:23 pm

OIDN Bad quality result and analysis of the problem to see if we can get it fixed :)

Post by juangea »

So I found the the result OIDN delivers in Lux is below the optimal result it can deliver.

I've done a video showing the problem and the comparison so you can see what am I referring to, but basically OIDN can go from this:
susi_badoidn.png
To this:
susi_goodoidn.png
This is the same exact render, same noise result, in this case both are cycles but because the main problem is that in LuxCore I'm totally unable to achieve the best result OIDN can deliver and I explain that in this video, it's a hidden video just for this forum, just 11 minutes :) :

https://youtu.be/naZlNPGO8jY

Also here you have the .blend I used in that video:

https://1drv.ms/u/s!AlC82JdQ66jg1kwXgJE ... J?e=R4YKmx

I hope this helps a bit with the OIDN implementation because OIDN is able to deliver an astonishing denoising quality and it's useful even for animation.
User avatar
Dade
Developer
Developer
Posts: 5675
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OIDN Bad quality result and analysis of the problem to see if we can get it fixed :)

Post by Dade »

I'm looking into this but not everything is clear to me.

First of all disable light tracing: 20% of you samples is coming from light tracing so you are really comparing an 80 samples/pixel LuxCore render with a 100 samples/pixel Cycles render. Just compare Path tracing Vs. Path tracing (otherwise it is more LuxCore BiDir Vs. Cycles Path tracing).

Light tracing also is not accounted in most AOVs (like BiDir) so this may explain why you get a slightly different result with re-composing the image.

I was doing Mirror albedo like Cycles (and specular surfaces in general, see viewtopic.php?f=5&t=872&start=210#p9679) but than some case where it was a problem was found (viewtopic.php?f=5&t=872&start=230#p9795) and the conclusion was to have just a plain white albedo.

However, for the moment, I would focus on solving the blurred texture over the Suzanne (specular surfaces is a big topic all on its own).

To recap: you get the same (blurred) result of of Lux and Cycles by default; however you can improve Cycles result using compositing. It is unclear to me how exactly ?
OIDN has 3 inputs: rendering, albedo and normals ? How they are processed to improve the result ? How they differ from the default setup ?
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5675
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OIDN Bad quality result and analysis of the problem to see if we can get it fixed :)

Post by Dade »

My first candidate for the problem is the blurred ALBEDO pass. Even after 1000 samples is still blurred:

Screenshot from 2020-03-01 11-53-04.png

As expected, if I reduce the pixel filter radius, I end with a moire pattern:

Screenshot from 2020-03-01 11-54-24.png

Even disabling pixel filtering (i.e. the sharpest possible render), I end with a quite blurred render:

Screenshot from 2020-03-01 11-56-08.png

This is unavoidable as there aren't simply "enough" pixels to carry the information.

However this also suggest a possible solution: doing a rendering a 512x512 at 1024 samples/pixel has the same cost of a 1024x1024 at 256 samples/pixel however the later should produce a far better denoised result (i.e. denoise at 1024x1024 and than scale down to 512x512) :idea:
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5675
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OIDN Bad quality result and analysis of the problem to see if we can get it fixed :)

Post by Dade »

Dade wrote: Sun Mar 01, 2020 11:03 am However this also suggest a possible solution: doing a rendering a 512x512 at 1024 samples/pixel has the same cost of a 1024x1024 at 256 samples/pixel however the later should produce a far better denoised result (i.e. denoise at 1024x1024 and than scale down to 512x512) :idea:
It tested this idea, this is a 960x540 with 100 samples/pixel:

render512.jpg

And this at 1920x1080 with 25 samples/pixel and than scaled down to 960x540:

render1024.jpg

It is a lot better on the plane but worse on the Suzanne ... this stuff is really unpredictable ...

I guess it should be rendered even at higher resolution (with less samples/pixel).
Support LuxCoreRender project with salts and bounties
juangea
Donor
Donor
Posts: 332
Joined: Thu Jan 02, 2020 6:23 pm

Re: OIDN Bad quality result and analysis of the problem to see if we can get it fixed :)

Post by juangea »

The way of improving the result in cycles is denoising each pass separatedly, you have the exact technique in the compositing of the blend file I gave you (the same I show in the video)

If you compare both Albedo passes they are kind of similar, however the Cycles Albedo contains two things, the reflection/refraction and the fresnel effect, so it’s not a pure Albedo.

The other big difference is the Denoise Normal pass, it seems to me it’s a Normal pass in screen space.

In the end the key in cycles is to denoise each pass separatedly, but the same does not work in LuxCore, I imagine that it’s because the different AOV organization, which I don’t understand too much, but I would assume that it’s because how LuxCore works, for example the Diffuse pass is entirely black, not sure why, when most of the info it’s in the specular pass, not sure why either.

Regarding the light tracing, understood, that might be the brightness difference, could be good to have a Light Tracing AOV also, otherwise it’s impossible to use compositing to recreate the final render right now :) (also the clamping thing I mentioned)

In the end it didn’t made a big difference to render with more samples or not, the idea was to make the point about the possible denoise quality with OIDN, not sure why the same technique does not work with LuxCore.

Keep in mind that in cycles I’m using the same resolution, so not sure why there is such a big difference between Cycles and Lux regarding the Albedo blurryness.

BTW thanks for looking into this, if we find a solution this will improve a lot the denoise quality :)
CodeHD
Developer
Developer
Posts: 492
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: OIDN Bad quality result and analysis of the problem to see if we can get it fixed :)

Post by CodeHD »

There are currently also two open issues on the OIDN-GitHub on textures.

https://github.com/OpenImageDenoise/oidn/issues/46
https://github.com/OpenImageDenoise/oidn/issues/50

If the issues described there are similar enough, maybe this can serve as additional input for you, or you can serve as additional input for them ;)
juangea
Donor
Donor
Posts: 332
Joined: Thu Jan 02, 2020 6:23 pm

Re: OIDN Bad quality result and analysis of the problem to see if we can get it fixed :)

Post by juangea »

I'm not sure if it's the same problem, because what I show in the example with Cycles is the same OIDN version, not a single difference, so it's more a difference in how OIDN is applied instead of a difference in the OIDN internals, so I don't think it's strictly related.
User avatar
Dade
Developer
Developer
Posts: 5675
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OIDN Bad quality result and analysis of the problem to see if we can get it fixed :)

Post by Dade »

juangea wrote: Sun Mar 01, 2020 12:08 pm The other big difference is the Denoise Normal pass, it seems to me it’s a Normal pass in screen space.
This is not a problem according OIDN documentation:

Code: Select all

The normal image should contain the shading normals of the surfaces either in world-space or view-space. 
juangea wrote: Sun Mar 01, 2020 12:08 pm for example the Diffuse pass is entirely black, not sure why, when most of the info it’s in the specular pass, not sure why either.
It is black because there are not diffuse materials in this scene (only glass and disney are visible and one is "SPECULAR" and the other is "GLOSSY" in Lux classification). Are you looking for direct light AOV or something like that ?
Support LuxCoreRender project with salts and bounties
juangea
Donor
Donor
Posts: 332
Joined: Thu Jan 02, 2020 6:23 pm

Re: OIDN Bad quality result and analysis of the problem to see if we can get it fixed :)

Post by juangea »

I imagine yes :)

It's not that I'm requesting it, I'm just trying to understand how AOV's work in Lux.

In Cycles the way of achieving that denoise level is to denoise the decomposed image, and I'm trying to reproduce it here, but may not be possible right now if we don't have the same components.

I'm not sure of anything anymore hahaha I'm just trying to understand all this and to squeeze out more performance out of LuxCore with the denoiser :)

EDIT: And now I understand how those AOV's work, so they work per-shader type, not per "light" type like in Cycles

So for example in Cycles we have:

Diffuse Light: Direct - Indirect - Color
Glossy Light: Direct - Indirect - Color
Transmission Light: Direct - Indirect - Color

And those Direct/Indirect passes are the ones that are denoised separatedly, and after that we put the Color pass, which is not denoised because it does not have any noise on it.
User avatar
Dade
Developer
Developer
Posts: 5675
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OIDN Bad quality result and analysis of the problem to see if we can get it fixed :)

Post by Dade »

I think that one of the source of the problem is the Normal pass: try to compare Lux and Cycle normal pass output, Cycles's one is "rough" like if bump mapping had a lot higher scale or was not filtered.
Support LuxCoreRender project with salts and bounties
Post Reply