POV-Ray : Newsgroups : povray.general : Confused about how Merge deals with overlap region : Re: Confused about how Merge deals with overlap region Server Time
30 Jul 2024 16:27:24 EDT (-0400)
  Re: Confused about how Merge deals with overlap region  
From: Kenneth
Date: 8 Nov 2008 05:10:01
Message: <web.4915648112932d0b78dcad930@news.povray.org>
"Mike" <win### [at] hotmailcom> wrote:
> I have two transparent objects that I have merged together.  I am a bit confused
> how it is  dealing with the fact that the two objects have different refractive
> indices.  Does it just pick one and if so which one?
>

That's an intriguing question.

I ran a test scene with two partially-merged transparent spheres, each with a
different IOR, and the visual results are not easy to fully understand or
describe. The IOR at any point seems to depend on which sphere--or sphere
surface-- the camera ray 'sees' first. But the resulting IOR doesn't look like
an either/or situation; kind of a combination, depending on which sphere
surface you see. Since IOR is really only a surface phenomenon, that makes
*some* sense. Looking straight-on at the 'dividing line axis' of the two
spheres, each partial sphere shows only its own IOR. But as the camera moves
around, things get strange.

What I did notice is that max-trace_level maxes out (even at 255!) using a
merge, while an intersection doesn't. (Again, this depends on where the camera
is in relation to the two spheres, AND on the difference between the two IORs.
Interesting!)

Here's my own test code, which is easy to play around with.

Ken W.

---------
global_settings {max_trace_level 255}

camera {
  perspective
  location  <-6, 2, -10> // change x to 0 or +6
  look_at   <0, 1.3,  0>
  right     x*image_width/image_height
  angle 18
}

light_source {
  <0, 0, 0>
  color rgb <1, 1, 1>
  translate <-30, 30, -30>
             }


sky_sphere {
   pigment {
      radial
      frequency 100
      color_map{
       [0.0 rgb 0]
       [0.5 rgb 0]
       [0.5 rgb 1]
       [1.0 rgb 1]
                }
           }
           }

plane {
  y, 0
  pigment { checker
       rgb 1
       rgb 1.5
     }
      }

#declare sphere_1 =
sphere{0,1
 pigment{color rgbf <.5,.5,1,1>}
 interior{ior 1.3} // switch the IORs of the two spheres to see result.
      }

#declare sphere_2 =
sphere{0,1
 pigment{color rgbf <1,.5,.5,1>}
 interior{ior 1}
      }

merge{ // or intersection
object{sphere_1 translate <-.4,1.3,0>}
object{sphere_2 translate <.4,1.3,0>}
}


Post a reply to this message

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