Page 2 of 3
Re: Trouble with glass reflections
Posted: Thu Sep 17, 2020 12:05 pm
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.
Re: Trouble with glass reflections
Posted: Thu Sep 17, 2020 12:43 pm
by Asticles
Ok, I'm preparing it.
Re: Trouble with glass reflections
Posted: Thu Sep 17, 2020 2:20 pm
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.
Re: Trouble with glass reflections
Posted: Thu Sep 17, 2020 4:27 pm
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.
So, when it gets denoised, left side is too much blurry, specially the floor reflection (white area).
Regards
Re: Trouble with glass reflections
Posted: Fri Sep 18, 2020 1:05 pm
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:
and now:
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.
Re: Trouble with glass reflections
Posted: Sat Sep 19, 2020 8:41 am
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.
Re: Trouble with glass reflections
Posted: Sat Sep 19, 2020 10:45 am
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.
Re: Trouble with glass reflections
Posted: Mon Sep 21, 2020 8:12 am
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:
But Setting opacity of the glass to 0 and render with few samples to get the passes:

- opacity.png (19.84 KiB) Viewed 5469 times
Denoising the first noisy render with these other passes we get a much better image:
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
Re: Trouble with glass reflections
Posted: Mon Sep 21, 2020 10:31 am
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):
instead of (from OIDN documentation):
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
Re: Trouble with glass reflections
Posted: Mon Sep 21, 2020 11:52 am
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.