Page 1 of 1

Clamping for AOV's not working

Posted: Thu Jan 30, 2020 7:05 pm
by juangea
This is simpler I think.

Can we get clamping for AOV's ?

Right now it's impossible to assemble the same result with AOV's if we use clamping since we don't get clamped AOV's.

I would like to do this to show a different way of using OIDN by denoising different render components separatedly, in Cycles this delivers a much better result and we avoid loss of texture detail, but without AOV's that actually represent what composes the final picture we get I cannot assemble it :)

Re: Clamping for AOV's not working

Posted: Mon Aug 10, 2020 1:52 pm
by juangea
I come back to this thread I opened some time ago, I think it got lost in the wind hahaha.

lately Igor Posavec on Discord found the same problem as me in the past, AOV's are not being clamped, and this makes AOV's unusable in many situations, here is the example, this is a picture rendered WITHOUT clamping, check the AOV's, specially the INDIRECT GLOSSY:

Image

This is the same picture rendered WITH clamping, as you can see the final result is ok, but it's impossible to re-compose the final picture with the AOV's:

Image

Some ideas?

Re: Clamping for AOV's not working

Posted: Mon Aug 10, 2020 10:30 pm
by Dade
The reason AOVs are not clamped is that: the clamp of the sum of all AOVs is different than the sum of the clamp of each AOV.

However, outside some extreme clamping value, they should be pretty near. So I can try to clamp the AOVs and see what does come out (but in few days because, at the moment, I'm working on the Bevel/Rounded Edges-thing).

Re: Clamping for AOV's not working

Posted: Tue Aug 11, 2020 6:59 am
by juangea
Awesome! Thanks Dade.

And awesome the bevel thing too!

Could the clamp be computed for the composited imaged and then applied over the passes? Or maybe have it as a render pass to be applied after compositing, or something like that, I’m not sure, I’m just thinking out loud, what I just said may be silly things :)

Re: Clamping for AOV's not working

Posted: Thu Aug 13, 2020 1:12 pm
by B.Y.O.B.
juangea wrote: Thu Jan 30, 2020 7:05 pm I would like to do this to show a different way of using OIDN by denoising different render components separatedly, in Cycles this delivers a much better result and we avoid loss of texture detail, but without AOV's that actually represent what composes the final picture we get I cannot assemble it
This is off-topic, but I want to point out that the trick you are referring to will not work in LuxCore with the currently available AOVs.
The trick is based on the fact that in Cycles, you can have AOVs that contain only the direct and indirect light contributions without albedo information, which are denoised, then the result is multiplied with the albedo AOV. It works because the light contribution alone usually doesn't have a lot of detail, so the human eye doesn't notice denoiser blur as much as when the albedo information is also affected by the denoiser.

So what we would need in LuxCore for such a trick to work is separate AOVs for the
  • direct
  • indirect
  • color
parts of the diffuse contributions (and the same for glossy and specular contributions).

Then you can add the direct and indirect portions, denoise them, and multiply the result with the color part (which doesn't need denoising).

Re: Clamping for AOV's not working

Posted: Thu Aug 13, 2020 1:41 pm
by Dade
I added the support for AOV clamping for the following AOVS: DIRECT_DIFFUSE, DIRECT_GLOSSY, EMISSION, INDIRECT_DIFFUSE, INDIRECT_GLOSSY and INDIRECT_SPECULAR

This is a INDIRECT_DIFFUSE without clamping:

noclamp.jpg

And this with strong clamping:

clamp.jpg

Re: Clamping for AOV's not working

Posted: Thu Aug 13, 2020 1:43 pm
by Dade
B.Y.O.B. wrote: Thu Aug 13, 2020 1:12 pm The trick is based on the fact that in Cycles, you can have AOVs that contain only the direct and indirect light contributions without albedo information, which are denoised, then the result is multiplied with the albedo AOV.
Oidn should still be able to denoise LuxCore INDIRECT_DIFFUSE, INDIRECT_GLOSSY and INDIRECT_SPECULAR AOVs so the idea to sum the not denoised:

DIRECT_DIFFUSE, DIRECT_GLOSSY, EMISSION

and the denoised:

INDIRECT_DIFFUSE, INDIRECT_GLOSSY and INDIRECT_SPECULAR

could still work :idea:

Re: Clamping for AOV's not working

Posted: Thu Aug 13, 2020 1:46 pm
by juangea
Hey BYOB, the original post is super old, we already discussed this in a different thread dddicated just to OIDN, I think that to get the better result we need a AOV separation similar to the Cycles one :)

But if Dade says it could work... we’ll see :)

Re: Clamping for AOV's not working

Posted: Thu Aug 13, 2020 1:49 pm
by Dade
juangea wrote: Thu Aug 13, 2020 1:46 pm But if Dade says it could work... we’ll see :)
With neural networks, the only way to know is to try, it depends of how they have been trained, etc. You should be able to try when the next build is ready.