Page 1 of 2

Handling of relative refractive indices

Posted: Wed Apr 03, 2019 5:31 am
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

Re: Handling of relative refractive indices

Posted: Wed Apr 03, 2019 8:46 am
by Dade
Glossy is not a transparent material so there is no refraction at all :?: Or are you mixing glossy with something else ?

Re: Handling of relative refractive indices

Posted: Wed Apr 03, 2019 12:00 pm
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. ;)

Re: Handling of relative refractive indices

Posted: Wed Apr 03, 2019 3:18 pm
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

Re: Handling of relative refractive indices

Posted: Wed Apr 03, 2019 3:42 pm
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.

Re: Handling of relative refractive indices

Posted: Wed Apr 03, 2019 8:28 pm
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?

Re: Handling of relative refractive indices

Posted: Wed Apr 03, 2019 10:00 pm
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.

Re: Handling of relative refractive indices

Posted: Thu Apr 04, 2019 1:55 pm
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

Re: Handling of relative refractive indices

Posted: Thu Apr 04, 2019 3:03 pm
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).

Re: Handling of relative refractive indices

Posted: Fri Apr 05, 2019 6:08 am
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