Two clear volumes in face contact

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.
lighting_freak
Posts: 233
Joined: Thu Jan 18, 2018 6:02 pm

Re: Two clear volumes in face contact

Post by lighting_freak » Mon Apr 19, 2021 6:27 pm

Hello all,

thanks for taking care of me.
I know that artifacts happens with overlapping surfaces.
Dade wrote:
Mon Apr 19, 2021 6:12 pm
As I said in my previous post strange artifacts happens if two surfaces overlap.
Dade wrote:
Mon Apr 19, 2021 6:12 pm
You can not have overlapping surfaces, you have to use a single surface and appropriate interior/exterior volumes.
As you can see (in both models) , there are no overlapping faces in the models.
It's a single intermediate surface that has interior and exterior volume properly defined.

With kind regards.
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease

Jan
Posts: 36
Joined: Sun Jan 10, 2021 2:37 pm

Re: Two clear volumes in face contact

Post by Jan » Tue Apr 20, 2021 3:02 pm

Hi,

Is this better now?
test_scene corrected.jpg
I just followed Dade advice and appropriated all the interior/exterior volumes
Snap29.jpg
I guess you are right however that refraction and reflection were computed according to the ratio of the IORs of internal and external volume of the Object and independent of the IORs of other Objects. :geek:

BR
Attachments
Test_Scene_c.zip
(1.84 MiB) Downloaded 33 times

lighting_freak
Posts: 233
Joined: Thu Jan 18, 2018 6:02 pm

Re: Two clear volumes in face contact

Post by lighting_freak » Wed Apr 21, 2021 9:43 am

Hello,

the appearance looks better, but still not right.
The material edges look strange to me.
Also strange is that that the exterior needs to be defined even if it's idential with world volume (that should be air by default with IOR 1).
current_setup.jpg
Do we agree that the light path through the test system should look like this?
I mean the direction of the transmitted ray (not the green color).
light_path.jpg
The system seems to be defined correctly, is that right?
t2_mod.blend
(994.5 KiB) Downloaded 35 times
with kind regards
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease

Jan
Posts: 36
Joined: Sun Jan 10, 2021 2:37 pm

Re: Two clear volumes in face contact

Post by Jan » Thu Apr 22, 2021 12:49 pm

Hi,
lighting_freak wrote:
Wed Apr 21, 2021 9:43 am
the appearance looks better, but still not right.
The material edges look strange to me.
Also strange is that that the exterior needs to be defined even if it's idential with world volume (that should be air by default with IOR 1).
I'm not sure how to explain them but there are two things that needed to be followed first or we might not able to isolate it further. For the Objects Surfaces did you give them a 0.1mm spacing? Can you try and then compare it again to your reference Single Layer?
Dade wrote:
Mon Apr 19, 2021 6:12 pm
It is just 32bit floating point (lack of) precision as I have already explained lighting_freak multiple times in the past. You can not have overlapping surfaces, you have to use a single surface and appropriate interior/exterior volumes.
If after doing so and things didn't improve a bit then we can ask if this is a Monte Carlo Integration Sampling issue? Maybe the more layers you got the less precise the outcome is going to be since it's not computationally possible to sample all the light rays individually hitting, refracting and reflecting from the surface and maybe Critical Angles were overlooked.
lighting_freak wrote:
Wed Apr 21, 2021 9:43 am
Do we agree that the light path through the test system should look like this?
I mean the direction of the transmitted ray (not the green color).

light_path.jpg

The system seems to be defined correctly, is that right?
I agree if both the above rules are followed. No 0 gap and both exterior and interior volumes of the Object are defined and equal.

p.s. I have trouble rendering your t2_mod.blend. It's totally black.
Snap30.jpg
BR
Last edited by Jan on Thu Apr 22, 2021 1:24 pm, edited 3 times in total.

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

Re: Two clear volumes in face contact

Post by Dade » Thu Apr 22, 2021 1:17 pm

Jan wrote:
Thu Apr 22, 2021 12:49 pm
If after doing so and things didn't improve a bit then we can ask if this is a Monte Carlo Integration Sampling issue? Maybe the more layers you got the less precise the outcome is going to be since it's not computationally possible to sample all the light rays hitting, refracting and reflecting from the surface.
It is a ray tracing related issue: the ray will start from a surface but, sometime, it will not able to detect the intersection with the next surface. Floating point are like a "Lego" (the building block toys) space. Actually, it is even worse because the blocks have a variable size, they are smaller near the 0 and larger far from the origin.

Something that works at a scale X or position XYZ, will not work if scale up or translated far from the origin.

This is a rendering where you can literally see the floating point bits, near the origin:

Image

far from the origin:

Image

even father away:

Image

Quite insane, isn't it ?

Images courtesy of Matt Pharr article: https://pharr.org/matt/blog/2018/03/02/ ... space.html
Support LuxCoreRender project with salts and bounties

Jan
Posts: 36
Joined: Sun Jan 10, 2021 2:37 pm

Re: Two clear volumes in face contact

Post by Jan » Thu Apr 22, 2021 2:06 pm

Thanks Dade. That's very enlightening :!: lighting_freak got very keen eyes :lol: Can this be improved by enabling cache or maybe issue with Space Partitioning to be more particular? Or maybe if we assign floating point decimal places base on distances from origin maybe it will smooth out the blocks noise? Just guessing for now. This stuff is still beyond my full comprehension but Tu Wien Rendering topics in YouTube helps a bit in understanding them.

User avatar
B.Y.O.B.
Developer
Posts: 4089
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Two clear volumes in face contact

Post by B.Y.O.B. » Thu Apr 22, 2021 3:37 pm

Jan wrote:
Thu Apr 22, 2021 2:06 pm
Can this be improved by enabling cache or maybe issue with Space Partitioning to be more particular? Or maybe if we assign floating point decimal places base on distances from origin maybe it will smooth out the blocks noise? Just guessing for now.
The linked article mentions a possible solution: rendering in camera space. It also mentions the drawbacks to rendering performance this causes, and why.

lighting_freak
Posts: 233
Joined: Thu Jan 18, 2018 6:02 pm

Re: Two clear volumes in face contact

Post by lighting_freak » Fri Apr 23, 2021 3:54 pm

Hello,

I've updated the scenes with a slit (air gap).
Both deliver the result that I would expect while having this air gap.

This is the result of the light path scene (hope this one works out of the box):
t2_mod_slit.jpg
t2_mod_slit.blend
(1000.47 KiB) Downloaded 32 times
This is the result of the two plastic parts:
test_scene_slit.jpg
Test_Scene_slit.blend
(1.22 MiB) Downloaded 35 times
However, I'm still looking for right setup, leading to right results, without such an air gap.

I read the posts about the world and the camera space.
Maybe I'm to stupid to get the point of it, but the geometry is not far away from the origin and the parts are not that small that this effects should appear, also the camera is only few meters away.
Jan wrote:
Thu Apr 22, 2021 12:49 pm
I'm not sure how to explain them but there are two things that needed to be followed first or we might not able to isolate it further. For the Objects Surfaces did you give them a 0.1mm spacing? Can you try and then compare it again to your reference Single Layer?
I hope this will help to isolate the issue.
Thank you for all the effort that you did.

with best regards
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease

Jan
Posts: 36
Joined: Sun Jan 10, 2021 2:37 pm

Re: Two clear volumes in face contact

Post by Jan » Sat Apr 24, 2021 2:06 pm

Maybe for the sake of performance and also Dade has said floating point numbers are like lego so IMO that means if you set distances to zero overlapping surfaces will have both negative and positive distances and also light rays from a surface do not travel backward and therefore the strange artifacts of light and dark.

Glad some progress have been made here! :) However I also got confuse when trying to figure out your original testscene.blend. I tried to replicate by flipping some Faces inside out and trace it with Laser but only to find out Refraction and Reflection stops working on some interfaces. :? Please kindly check.

Refraction and Reflection on the 2nd Glass Object below the First Glass Object no longer works if Faces are flipped. If Disable the 2nd Glass Object the issue will pass to the Third Glass Object below and so on.... If disable the 1st Glass Object 2nd, 3rd, 4th all will work normally.
strange.jpg


Work as expected when Faces are not flipped.
normal.jpg
Can anyone explain? :mrgreen:
Attachments
strange.blend
(935.49 KiB) Downloaded 28 times
normal.blend
(935.52 KiB) Downloaded 29 times

lighting_freak
Posts: 233
Joined: Thu Jan 18, 2018 6:02 pm

Re: Two clear volumes in face contact

Post by lighting_freak » Mon Apr 26, 2021 8:31 pm

Hello,
Jan wrote:
Sat Apr 24, 2021 2:06 pm
if you set distances to zero overlapping surfaces
There are no overlapping surfaces in that model.
One of the two faces that are shared by both volumes is deleted (or better said: has never been imported).

The remaining surface (marked in red) carries an interior and exterior volume as mentioned in this image:
VOLUME_Setup.jpg
Jan wrote:
Sat Apr 24, 2021 2:06 pm
Glad some progress have been made here!
Well now we know that everything works as it should if you don't have any volume contact situation.
My work really needs some solution for that - we're dealing quite often with such geomterical setups.

Is this setup right in general if one wants to handle this volume contact case?
I'll just like to share it again with more precide naming:
Test_Scene.zip
(1.67 MiB) Downloaded 32 times
Jan wrote:
Sat Apr 24, 2021 2:06 pm
Refraction and Reflection on the 2nd Glass Object below the First Glass Object no longer works if Faces are flipped
I think if you start flipping the face normals (see the arrows in the image) the algorythm will be confused with what is inside an outside of the volume.

With kind regards
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease

Post Reply