Render material bug - internal refraction IOR=1 cause trouble

Hello,

when I create a Rhino custom materials (simple plastic) and convert them to V-Ray materials, I get a not fully functional material because Rhino internally uses IOR 1 for the unused refractive layer. This value is probably from the old days when Rhino itself did not use this parameter. Please set the value to classic 1.6.

Best-
Micha

hi Micha,

can you send a test object that doesn’t convert properly? I could not repeat this issue on my end.
I’m getting a plastic with IOR 1.5

You see the problem if you disable the reflection IOR and V-Ray is using the IOR of the refraction.

You have to set the Custom material to 100% transparency to alter the IOR. Then it converts that value to the refraction IOR in a Vray material… at least it does here.


Your description of “Rhino custom materials (simple plastic)” caused a little confusion I think. The Plastic material type has an IOR value of 1.5 while the default Custom material type has a default value of 1.

Thank you, but I don’t actually want to repair the IOR for every material. It would be nice if the default value for the refraction IOR was always 1.6 and not 1. Then clean V-Ray materials would be created after the conversion, as they usually are.

Why don’t you simply use the built in plastic presets if you’re planning to convert it to a Vray material later?

Not all of my clients own V-Ray and they create a basic material setup with right colors and I need to convert it to a V-Ray setup for the final visualization.

I made the attached script, which seems to work to set the IOR for materials of selected objects to 1.6
However, for some reason, after conversion, the reflection IOR in the V-Ray material is checked and set to 20. I have no clue where this comes from. Maybe @Nikolay knows?
EDIT: the below script now works and gives 1.6 for IOR
set_IOR.py (1006 Bytes)

Oh, thank you for your efforts. In the long run, I find script solutions for things that actually only need to be repaired in Rhino not so appealing, because you:

  • you have to remember that there was a script for the bug
  • you have to install the script with every new Rhino major version and hope that it still works

Why not just set the IOR for refraction to a standard value typical for glass and be done with it? The fact that the value is 1 is only due to the history of Rhino’s development, isn’t it?

An IOR of 1 means that there is no change in the direction of the beam between the vacuum and the medium. But that is an extremely rare case - does it even exist? A value of ~1.5 is more common.

I had hoped that this little thing could simply be fixed with a Rhino update. Simply refraction IOR 1.5 always. What’s the problem with that?

For a non transparent material I find it only natural to have IOR set to 1 on conversion. I would imagine other users rely on that in their use cases. I would find it weird if it were different.

1 Like

V-Ray always uses a refraction index of 1.6, even if no refraction is used, and it is no less logical because a solid is not a vacuum :wink: Isn’t IOR 1 rather illogical?

Let’s imagine an opaque plastic that becomes only slightly transparent. The IOR does not jump from 1 to 1.5.

image

Hi,

this is by design. You get 20 if fresnel reflections are disabled

1 Like

@micha, in case it helps, I’ve updated the script above, that should now prepare custom materials for better conversion.
Your request is really a niche problem, that’s why I prefer solving this with a script. If VRay thinks the default needs to be 1.6 when converting the material, it could decide to interpret values of 1 as 1.6

1 Like

I had asked V-Ray support for exactly that and they referred me to the McNeel team to set the IOR to 1.6. And I thought to myself, why not, setting the value in the code from 1 to 1.6 is certainly no big deal. :sweat_smile: