IOR node

jameswillmott

NewTek Developer
I've been practicing my coding lately, here's the result. Nothing overly fancy, just a simple node that has a dropdown of some common indices of refraction, to save you having to look them up all the time.

Hope someone makes use of this. Enjoy.

The node installs itself under the Constant menu group.
 

Attachments

  • Jw_ior.zip
    23.5 KB · Views: 445

Simon

Member
Nice idea James, thanks v much. And you have my favourite refractive index - beer. Mmmmm refractive.

May I suggest you have two of the drop downs in it with two outputs, seeing as you nearly always use two ref indexes at a time.
 

Simon

Member
Yes a choice of beers would be nice! :)

Oh I'm thinking just label them RI one and RI two and perhaps even RI three (rendering a glass of liquid) only because I'm really lazy and to save adding more than one of the nodes. Or surface one, surface two and air? Either way it's a good idea for an node!

Simon.
 

jameswillmott

NewTek Developer
Small update.

There are two dropdowns now. Ambient refers to the IOR of the medium the Camera is inside, Material is the IOR of the surface. Relative IOR calculates the new index of the interface based on the IORS of both media involved. Inverse IOR is the same but in the other direction ( ie. Material -> Ambient )
 

Attachments

  • Jw_ior.zip
    23.9 KB · Views: 376

Thomas M.

New member
Nice node. But it seems that there is a bug. I used your node as an input for the Fresnel node from Denis. When I copied the surface to another object, the preview in the Frsenel node was messed up. Actually I didn't render, but at least the preview didn't look right. Couldn't even fix it by reconnecting, so I don't know. Probably you could give it a try.

Cheers
Thomas

And please try to put in even more presets. Great!
 

Simon

Member
Hi James,

How would you use the outputs for relative m/a and inverse a/m? Just wondering what their purpose was unless I'm missing something obvious.
 

jameswillmott

NewTek Developer
If your camera is in a medium other than air, use m/a. Use a/m for the 'air' polygons.

You'd do this if you're doing a scene completely submerged in... beer, for example. :D Set Ambient to Beer, and use m/a for front refraction of things like airbubbles, the opposite glass face etc , and a/m for the backsides of those things that are completely submerged.
 

Simon

Member
Whooaa a scene completely submerged in beer, I thought that was the thing of legends.

That's got me thinking now (and slightly confused). If I was making an underwater scene and my camera was underwater within a medium of approx 1.3 then the ambient is 1.3. I would have thought that the outside of my air bubble would need to have a RI of 1.0? Do you mean it should in fact be (m/a) or (1/1.3)? Actually I suppose that makes sense because LW wouldn't know what RI the camera was in :confused:
 

jameswillmott

NewTek Developer
LW assumes the camera is in a vacuum, so you have to divide the IOR's of any material by the IOR of the material it is submerged in.

Ambient(Water) = 1.3 Material(Air) = 1.0

Air bubble outside ior = m/a = 1.0/1.3
Air bubble backface = 1.0

I think...
 

Red_Oddity

New member
I've always been a bit confused about all this...(and sorry for derailing your initial question a bit)

What would that mean for IOR in and out surfaces for say a glass filled with water with submerged icecubes.
IOR Glas in = 1.5
IOR water in = 1.333
IOR icecube in = 1.3
IOR Air = 1.0003

What does that makes the IOR outs for all materials?

Does that mean that the IOR out for glas to water is 1.5/1.333,
the IOR out for the water to ice = 1.333/1.3 or is the IOR out for the water = (1.5/1.333)/1.3?
 
Top Bottom