POV-Ray : Newsgroups : povray.advanced-users : How does POV-Ray handle IORs between two interfacing surfaces? : How does POV-Ray handle IORs between two interfacing surfaces? Server Time
29 Jul 2024 02:24:51 EDT (-0400)
  How does POV-Ray handle IORs between two interfacing surfaces?  
From: Retsam
Date: 2 Apr 2003 15:05:04
Message: <web.3e8b41bd8073fdf12a3ff2e70@news.povray.org>
Maybe someone with more in-depth knowledge of the source code for POV-Ray
can field this one.

I've been looking at the code, trying to figure out how POV-Ray handles a
refracted ray as it passes from one object to another, such as from a glass
bottle to the water in the bottle.

Assuming that I have a "water" object whose surface "exactly" matches the
inside surface of the glass, I would expect the ray to transition from the
IOR of the glass to the IOR of the water.

But from what I can tell from the source code, something bizarre will
happen.

The ray will first enter the glass from the outside, going from ior 1 to ior
1.57, for example.  Then, in the Trace function, depending on whether
Best_Intersection is the glass ending or the water starting, you will get
one of two outcomes.  If it's the glass ending, the ray will go from ior
1.57 to 1.0.  Then the next Trace intersection will be with the water,
going from ior 1.0 to ior 1.33.  Definitely wrong, as you will get TIR at
angles as small as about 40 degrees, instead of the larger 57 degrees or so
they should start at.

On the other hand, if the first intersection is with the water, it will go
from ior 1.57 to 1.33 (the ior at the interface = 1.57/1.33), then as it
leaves the glass, it will go from ior 1.57 to 1.33 again, sort of.  That
is, it will refract twice using the same relative iors.

Am I reading something wrong here?  I've been looking for code that handles
the coincident surfaces, but I cannot find it.

The only way I can see to get a realistic glass/water transition is to have
the glass be solid and just put water inside it.  But what about at the
surface of the water.  There would still be two transitions there.  When
leaving the water, you would get either water-glass and glass-air, or
glass-water and water-air, depending on whether it hit the end of the water
first or the end of the glass first.  Vice-versa for entering the water
from the surface.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.