Handling of relative refractive indices

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: 234
Joined: Thu Jan 18, 2018 6:02 pm

Handling of relative refractive indices

Post by lighting_freak »

Hi,

This is my situation...
I have a very glossy refractive surface. Its like a piano black finish.
This face uses the "use IOR" option with an IOR of 1.5. It's diffuse color is set to perfect black.
It's roughness is 0.001.

The exterior volume of this face is a clear acrylic volume, also using an IOR of 1.5.

In theory the ratio between those two indices becomes 1. So the resulting Fresnels becomes 0 for all incidence angles.
Is this behaviour integrated in lux core? I've the strange feeling that the calculated amount of Fresnel reflections is calculated against air (IOR 1) everytime.

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

Re: Handling of relative refractive indices

Post by Dade »

Glossy is not a transparent material so there is no refraction at all :?: Or are you mixing glossy with something else ?
Support LuxCoreRender project with salts and bounties
kintuX
Posts: 809
Joined: Wed Jan 10, 2018 2:37 am

Re: Handling of relative refractive indices

Post by kintuX »

Maybe Glossy Coating + something :?:
Could you please, post an image of an issue and a material, best would be a test scene to tackle with. ;)
epilectrolytics
Donor
Donor
Posts: 790
Joined: Thu Oct 04, 2018 6:06 am

Re: Handling of relative refractive indices

Post by epilectrolytics »

Dade wrote: Wed Apr 03, 2019 8:46 am Glossy is not a transparent material so there is no refraction at all :?: Or are you mixing glossy with something else ?
But an IOR setting can be activated (I assume this does activate angle dependent (fresnel) reflection).
The question is what happens when inside a volume with the same or a different IOR, how is the fresnel effect calculated?
ior.png
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Handling of relative refractive indices

Post by Dade »

epilectrolytics wrote: Wed Apr 03, 2019 3:18 pm But an IOR setting can be activated (I assume this does activate angle dependent (fresnel) reflection).
The question is what happens when inside a volume with the same or a different IOR, how is the fresnel effect calculated?
The related code: https://github.com/LuxCoreRender/LuxCor ... y2.cpp#L69

The IOR parameter only affects the glossy2 specularity and it doesn't use any external information (like inner/outer volumes IORs). So yes, the result is always the same no matter of the volume IOR you are inside.
Support LuxCoreRender project with salts and bounties
lighting_freak
Posts: 234
Joined: Thu Jan 18, 2018 6:02 pm

Re: Handling of relative refractive indices

Post by lighting_freak »

Hi,

Thanks for answering...
Well, the situation described by epilectrolytics is what I meant.
So yes, the result is always the same no matter of the volume IOR you are inside.
If this is really the case the result is wrong...
From my opinion you have to calculate the relative IOR before calculating the amount of reflected light.

IOR relative should be IOR of media 1 devided by IOR of media 2.
If result IOR is smaller 1 than use the value reciprocal.

Interesting question that comes up...
Does total inner reflection happen in case of having a smaller IOR on the reflective surface compared to the external media IOR?
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
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Handling of relative refractive indices

Post by Dade »

lighting_freak wrote: Wed Apr 03, 2019 8:28 pm Does total inner reflection happen in case of having a smaller IOR on the reflective surface compared to the external media IOR?
It does for glass.
Support LuxCoreRender project with salts and bounties
lighting_freak
Posts: 234
Joined: Thu Jan 18, 2018 6:02 pm

Re: Handling of relative refractive indices

Post by lighting_freak »

Hi,
It does for glass.
This means that one could have an light guide effect of a glass tube surrounded by some black acrylic cladding? At least for a very narrow (almost parallel) beam pattern it should work... I'll investigate that a bit...

Back to the main topic.
Do you think this fresnel behaviour could be fixed soon? Do I have to have separated faces (pointing to world volume AND those that point to the external volume) or will lux core determine this automatically?

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

Re: Handling of relative refractive indices

Post by Dade »

lighting_freak wrote: Thu Apr 04, 2019 1:55 pm This means that one could have an light guide effect of a glass tube surrounded by some black acrylic cladding? At least for a very narrow (almost parallel) beam pattern it should work... I'll investigate that a bit...
Yes but be careful with very near surfaces, it is a situation easily prone to numerical errors.
lighting_freak wrote: Thu Apr 04, 2019 1:55 pm Back to the main topic.
Do you think this fresnel behaviour could be fixed soon? Do I have to have separated faces (pointing to world volume AND those that point to the external volume) or will lux core determine this automatically?
I don't think that the glossy2 original index parameter was really intended for this purpose. You may have more success recreating the situation you are trying to simulated with volumes. I mean, if you are trying to have some kind of tiny surface coating, you could try to model both the geometry of the coating and the volume (however it may be very challenging for numerical precision as I wrote).
Support LuxCoreRender project with salts and bounties
lighting_freak
Posts: 234
Joined: Thu Jan 18, 2018 6:02 pm

Re: Handling of relative refractive indices

Post by lighting_freak »

Hi,

I'm not talking about small tiny surfaces. It's a plastic part that is made in 2 shot process. One shot is a clear polycarbonate and the second shot is a black acrylic...

This part is later on illuminated (through the clear element) by few LED

In real life the intermediate face of those two volumes appears simply black. The difference between those two IOR very little so fresnels are very little as well.

But in Luxcore it glows a lot. By far too much.

My first test defined this particular surface being perfectly black. That works for the glow, but it is not correct anyway... and very hard to apply on each area af a complex part.

Further more 3 shot process is also possible. Setup becomes even harder.

BR
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