Clamping for AOV's not working

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.
Post Reply
juangea
Donor
Donor
Posts: 332
Joined: Thu Jan 02, 2020 6:23 pm

Clamping for AOV's not working

Post 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 :)
Last edited by juangea on Mon Aug 10, 2020 1:52 pm, edited 1 time in total.
juangea
Donor
Donor
Posts: 332
Joined: Thu Jan 02, 2020 6:23 pm

Re: Clamping for AOV's not working

Post 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?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Clamping for AOV's not working

Post 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).
Support LuxCoreRender project with salts and bounties
juangea
Donor
Donor
Posts: 332
Joined: Thu Jan 02, 2020 6:23 pm

Re: Clamping for AOV's not working

Post 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 :)
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Clamping for AOV's not working

Post 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).
Attachments
light_aovs.blend
(808.05 KiB) Downloaded 144 times
diffuse direct
diffuse direct
diffuse indirect
diffuse indirect
diffuse color
diffuse color
Capture.PNG
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Clamping for AOV's not working

Post 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
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: Clamping for AOV's not working

Post 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:
Support LuxCoreRender project with salts and bounties
juangea
Donor
Donor
Posts: 332
Joined: Thu Jan 02, 2020 6:23 pm

Re: Clamping for AOV's not working

Post 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 :)
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Clamping for AOV's not working

Post 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.
Support LuxCoreRender project with salts and bounties
Post Reply