Trouble with glass reflections

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

Re: Trouble with glass reflections

Post by Dade »

Asticles wrote: Thu Sep 17, 2020 11:43 am Actually, it is hybrid glass.
With hybrid glass and no cache, the surfaces inside the box should render as fast as the one out side.

Can you post stripped down scene with just walls, lights and glass ? So we can all work on the same base line.
Support LuxCoreRender project with salts and bounties
Asticles
Donor
Donor
Posts: 171
Joined: Thu Jan 11, 2018 8:52 am
Location: Barcelona, Spain
Contact:

Re: Trouble with glass reflections

Post by Asticles »

Ok, I'm preparing it.
Asticles
Donor
Donor
Posts: 171
Joined: Thu Jan 11, 2018 8:52 am
Location: Barcelona, Spain
Contact:

Re: Trouble with glass reflections

Post by Asticles »

Here it is.

https://we.tl/t-uCTEHBmdjc

Note that there are 3 things to consider:

a)The reflections on the glass get few samples (this is my principal concern).

b)Everything behind the glass isn't denoised properly because glass is not ignored in denoiser passes.

c)Everything behind the glass seemed to get less samples. Now I'm using hybrid glass.

Regards.
Asticles
Donor
Donor
Posts: 171
Joined: Thu Jan 11, 2018 8:52 am
Location: Barcelona, Spain
Contact:

Re: Trouble with glass reflections

Post by Asticles »

This is a sample from the above file, 3600 samples.

Look at the glass zone on the left, it is noiser than the right one. Also, look at the lower left side, where the floor reflection is, which is really undersampled.
3600samples_noise.jpg
So, when it gets denoised, left side is too much blurry, specially the floor reflection (white area).
3600samples_denoised.jpg
Regards
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Trouble with glass reflections

Post by Dade »

I have looked into this scene and the problem is that glass reflection is really under sampled. In this case, the reflection is sampled only in 3%-10% of the cases.

I added a cap (25% and 75%) to (Arch)Glass transmission/reflection sampling in order to work around this problem. The cap is a bit arbitrary (but I don't see a better solution at the moment).

This was a 100 samples/pixel before:

nolimit.jpg

and now:

limit.jpg

This should help.

However there is also a denoiser problem on glass that is out of our control. A work around could be to render the image at higher resolution, denoise and than scale down (may be also mixing a raw and denoised image).

I have also to say that, with GPUs, you can just brute force solve the problem by rendering a very high samples/pixel count.
Support LuxCoreRender project with salts and bounties
Asticles
Donor
Donor
Posts: 171
Joined: Thu Jan 11, 2018 8:52 am
Location: Barcelona, Spain
Contact:

Re: Trouble with glass reflections

Post by Asticles »

Hi, thanks for your support.

So these values are hard coded?

Can this be adjusted by user?

Is there any way to find the correct ones (via AOV passes, for example)?

And, why not disable glass materials to be visible in normal and albedo maps by choice?

Regards.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Trouble with glass reflections

Post by Dade »

Asticles wrote: Sat Sep 19, 2020 8:41 am So these values are hard coded?
Yes, the caps (not the sampling distribution) are hard coded.
Asticles wrote: Sat Sep 19, 2020 8:41 am Can this be adjusted by user?
Because most users will do a mess.
Asticles wrote: Sat Sep 19, 2020 8:41 am And, why not disable glass materials to be visible in normal and albedo maps by choice?
Both AOVs are noise free after the first sample, check. Demoisers have their own set of problems, they do not always work.
Support LuxCoreRender project with salts and bounties
Asticles
Donor
Donor
Posts: 171
Joined: Thu Jan 11, 2018 8:52 am
Location: Barcelona, Spain
Contact:

Re: Trouble with glass reflections

Post by Asticles »

Well, I've managed to achieve something.

This is original denoised image given a number of samples, with the albedo and normal pass:
tdenoise1.jpg
ta1.jpg
tn1.jpg
But Setting opacity of the glass to 0 and render with few samples to get the passes:
opacity.png
opacity.png (19.84 KiB) Viewed 3558 times
ta2.jpg
tn2.jpg
Denoising the first noisy render with these other passes we get a much better image:
compo.png
tdenoise2.jpg
So, what I suggest is to have the option to disable the glass from the normal and albedo passes, on the material.

Dade, can this be done?

Thanks
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Trouble with glass reflections

Post by Dade »

Asticles wrote: Mon Sep 21, 2020 8:12 am Dade, can this be done?
My very first implementation was handling glass that way (from OIDN documentation):

Image

instead of (from OIDN documentation):

Image

However people preferred the current solution because the old one was introducing noise in the albedo AOV (i.e. requires more samples to be able to have any meaningful denoise solution).

You can dig in old OIDN thread to find all the discussion:

viewtopic.php?f=5&t=872&start=200#p9652
viewtopic.php?f=5&t=872&start=230#p9795
Support LuxCoreRender project with salts and bounties
Asticles
Donor
Donor
Posts: 171
Joined: Thu Jan 11, 2018 8:52 am
Location: Barcelona, Spain
Contact:

Re: Trouble with glass reflections

Post by Asticles »

Well, I would clearly make a switch to use one or other option inside the material, because it makes a great difference depending on the situation.
Ofc, albedo and normal should be distorted by refraction.

Edit: I prefer much, much, much more that first solution (oidn documentation) and spend a bit more samples to clear the noise, to render 200% size images and wait much more time to get the denoiser working with the behind glass objects.
Also, that implementation (recomended by oidn devs) is much more accurate.

Regards.
Post Reply