# [Bf-committers] ior

Frédéric van der Essen fred at mentalwarp.com
Sun Apr 3 20:12:40 CEST 2005

```Well  I mixed N and the IOR i think i was not well waked up :D
Anyway if your solution is physically correct i guess it would be hard
to implement
since the raytracing is only computed at interfaces, taking the IOR as
it was N = n2/n1
but here n1 is always 1

if you create a sphere with n=2 inside another one with n=2 you see
refraction on the inside sphere.
If the IOR value in blender is effectly the real IOR (n) then the system
can be considered as broken because
the inner sphere shouldn't be visible at all. If you consider the IOR
value in blender as N =n2/n1
then the system works correctly, but in this case it should be allowed
to have values lower than 1 to simulate
"holes" in the matter.

What you said is totally correct but from the artist point of view
setting a environment "n" value wouldn't be really practical
because it would affect every refraction in the scene.
And i guess that having a really physically correct raytracer that would
take in count the volumes would be quite difficult with open or
nonmanifold meshes
where it is difficult to guess whitch part is inside and whitch is not...

the way it works now is far from being physically correct but it is
flexible and easy to use.
but it can be a little misleading for those who want "realistic renders"
and try to use the IOR value that they find in books.

Daniel Barbeau wrote:

>>Of course it can !
>>the ior isn't lightspeed_in_void / Lightspeed_in_material !!!
>>this is the special case of an object standing in void.
>>
>>the real formula = lightspeed_in_first_material /
>>Lightspeed_in_second_material.
>>
>>if the light goes slower in the first than in the second, then the
>>ior is smaller than one.
>>
>>in the case of a bubble in water, the lightspeed is slower in the
>>water than in the air, so the ior is negative when the light
>>enters the bubble, and positive when the light goes out the bubble.
>>
>>
>
>three years without any optic courses at university... that stuff is
>far away.
>the only thing I remember is the n= c / v   law (here it's one of
>Descartes' law)
>and the sin i1 * n1 = sin i2 * n2 one, where i is the angle (the same
>as sin i1 / sin i2 = N, with N = n2 / n1)
>with the normal and n the ior. Then we transformed these relations to
>get where we wanted.
>
>So I'm a bit lost. Isn't a material's IOR (aboslute indices)
>calculated using air as a reference?
>(which is close to void, at least in the approximations we did)
>Then the inversions in the formulas occur logically following the
>course of the ray and the dioptre it goes through.
>The user, in Blender, sets absolute IORs for the materials not N =
>n2/n1
>
>So, the logical solution for me would be to place the camera in a
>world which has it's ior > 1... (1.33 for water)
>Then all the rest of the objects have there normal ior, thus bubbles =
>1.0 and I'm happy with that :]
>
>Is my case so desperate?
>Am I so completely wrong?
>
>;)
>
>Ciao
>Dani
>
>_______________________________________________
>Bf-committers mailing list
>Bf-committers at projects.blender.org
>http://projects.blender.org/mailman/listinfo/bf-committers
>
>
>

```