POV-Ray : Newsgroups : povray.general : Confused about how Merge deals with overlap region Server Time
27 Nov 2024 12:42:57 EST (-0500)
  Confused about how Merge deals with overlap region (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Mike
Subject: Confused about how Merge deals with overlap region
Date: 7 Nov 2008 19:35:00
Message: <web.4914dde8df3cdb23c6b158600@news.povray.org>
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?

Thanks,
Mike


Post a reply to this message

From: Dan Connelly
Subject: Re: Confused about how Merge deals with overlap region
Date: 7 Nov 2008 21:10:56
Message: <4914f530$1@news.povray.org>
Mike 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?
> 

To my understanding, you never want the program to "pick one", or the results are
unpredictable, typically manifested with pixel-level spot patterns.  Merged structures
with different internal media should be non-overlapping.

Merge works best with overlapping structures when a single internal media field is
applied to the aggregated merged meta-object.

Dan


Post a reply to this message

From: Mike
Subject: Re: Confused about how Merge deals with overlap region
Date: 7 Nov 2008 21:55:00
Message: <web.4914fed612932d0bc6b158600@news.povray.org>
The problem is that I basically am creating a model in which I have an egg crate
pattern interface between two different liquids.  I used isosurface to create
the two different regions.  Just putting them on top of each other (or close to
eachother) does not work properly (I see the interface even if I make the two
regions have the same ior).  I actually have scratched my head a while trying
to make the interface "disappear" when the two regions have the same ior as it
should.  I noticed that if I overlap by a very little amount it seems to work
perfectly.  Actually, if it randomly chose a ior it might be fine since it is
such a tiny region.  I would just like to know what it is doing.  Maybe it
chooses which ever is listed first or something, depends on how the merge
routine is written I guess?

-Mike


Dan Connelly <djc### [at] yahoocom> wrote:
> Mike 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?
> >
>
> To my understanding, you never want the program to "pick one", or the results are
unpredictable, typically manifested
 with pixel-level spot patterns.  Merged structures with different internal media
should be non-overlapping.
>
> Merge works best with overlapping structures when a single internal media field is
applied to the aggregated merged m
eta-object.
>
> Dan


Post a reply to this message

From: Kenneth
Subject: Re: Confused about how Merge deals with overlap region
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

From: Nicolas George
Subject: Re: Confused about how Merge deals with overlap region
Date: 8 Nov 2008 08:28:40
Message: <49159408$1@news.povray.org>
"Mike"  wrote in message
<web.4914dde8df3cdb23c6b158600@news.povray.org>:
> 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?

As far as I understand how ray-tracing works, we have two effects:

- Refraction is a property of the volume object, but its effect is only
  applied when the ray encounters the boundary of the object.

- The in the merge operation, the internal boundaries just do not exist.

If we consider a light ray that first goes in and then comes out, there are
two points where refraction happens, and each time the effect will depends
on the IOR of the part of the object where the point is.

If the light ray goes in and comes out on the same part of the merge, then
the refraction will behave just as if this part was alone.

If the light ray goes in and comes out on different parts, then the
refraction will happen with different IOR, which is physically impossible.


Post a reply to this message

From: Dan Connelly
Subject: Re: Confused about how Merge deals with overlap region
Date: 8 Nov 2008 08:36:39
Message: <491595e7@news.povray.org>
Excellent!  Something to bite into, rather than vague generalities...  Examples are
good.

I generated mutually exclusive regions with cgi.

========================================================
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 pigment_1 =
     pigment{ color rgbf <.5,.5,1,1> }

#declare pigment_2 =
     pigment{ color rgbf <1,.5,.5,1> }

#declare ior_1 = 1.3;
#declare ior_2 = 1.0;

#declare r1 = <-.4,1.3,0>;
#declare r2 = <.4,1.3,0>;

#declare sphere_1 =
sphere{
   0,1
   translate r1
}

#declare sphere_2 =
sphere{
   0,1
   translate r2
}

#declare region_1 =
   difference {
     object { sphere_1 }
     object { sphere_2 }
     texture { pigment { pigment_1 } }
     interior { ior ior_1 }
   }

#declare region_2 =
   difference {
     object { sphere_2 }
     object { sphere_1 }
     texture { pigment { pigment_2 } }
     interior { ior ior_2 }
   }

#declare region_12 =
   intersection {
     object { sphere_1 }
     object { sphere_2 }
     texture {
       pigment {
	average
	pigment_map {
	  [0.5 pigment_1]
	  [0.5 pigment_2]
	}
       }
     }
     interior {
       ior ior_1 + ior_2
     }
   }

// consider two options: 1 and 2
#declare option = 1;
#if (option = 1)
   union {
     object { region_1 }
     object { region_2 }
     object { region_12 }
   }
#end
#if (option = 2)
   merge {
     object { region_1 translate -r1 scale 1.0001 translate r1}
     object { region_2 translate -r2 scale 1.0001 translate r2}
     object { region_12 scale 1.0001 }
   }
#end

============================================================

These two cases give much different results.

Dan


Post a reply to this message

From: Dan Connelly
Subject: Re: Confused about how Merge deals with overlap region
Date: 8 Nov 2008 08:53:44
Message: <491599e8$1@news.povray.org>
Dan Connelly wrote:

> #if (option = 2)
>   merge {
>     object { region_1 translate -r1 scale 1.0001 translate r1}
>     object { region_2 translate -r2 scale 1.0001 translate r2}
>     object { region_12 scale 1.0001 }
>   }
> #end


Whoops.... I wanted overlapping regions.  This is better:

#if (option = 2)
   merge {
     object { region_1 }
     object { region_2 }
     object { region_12 scale 1.0001 }
   }
#end


Post a reply to this message

From: Stephen
Subject: Re: Confused about how Merge deals with overlap region
Date: 8 Nov 2008 08:55:52
Message: <d56bh4h8q7p3rgiq5p8hbqmhulpp1t7ekq@4ax.com>
On Sat,  8 Nov 2008 05:05:53 EST, "Kenneth" <kdw### [at] earthlinknet> wrote:

>"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. 

I did the same and here is the animation.
The spheres on the left have separate textures. The yellowish one has an IOR of
1.2 and the pink one has an IOR of 2. The spheres on the right have the IOR 2.0
texture applied to the Merge and the yellowish one has an IOR of 1.2 and the
pink one has no texture.

http://www.geocities.com/mcavoy.stephen/videos/Merge03_0000.mpg

I am running another animation using an orthographical camera to see the
difference,

-- 

Regards
     Stephen


Post a reply to this message

From: Kenneth
Subject: Re: Confused about how Merge deals with overlap region
Date: 8 Nov 2008 20:20:00
Message: <web.491639ac12932d0b78dcad930@news.povray.org>
Nicolas George <nicolas$george@salle-s.org> wrote:

> In the merge operation, the internal boundaries just do not exist.

> If the light ray goes in and comes out on different parts, then the
> refraction will happen with different IOR, which is physically impossible.

Yes. Yet POV-Ray is still able to produce *something* at the boundary between
the two IORs--which looks like a surface--without throwing up its hands and
crying "Uncle!" I find that intriguing in itself. It would be interesting to
know just what this 'composite IOR' is (if that's the right word for it.) No
wonder Mike is seeing such odd things with his egg-crate pattern!

This is a good exercise!

Ken W.


Post a reply to this message

From: Nicolas George
Subject: Re: Confused about how Merge deals with overlap region
Date: 9 Nov 2008 13:52:09
Message: <49173159@news.povray.org>
"Kenneth"  wrote in message
<web.491639ac12932d0b78dcad930@news.povray.org>:
>						    It would be interesting to
> know just what this 'composite IOR' is (if that's the right word for it.)

There is no equivalent "composite IOR". What happens is that the light ray
should have been bent inside the object but was not.

You may be able to interpret things in terms of real world physics, but that
will just give something awkward. Right now, I see two ways:

- Imagine there is a boundary between the two IORs, but that that boundary
  is always orthogonal to the light ray, thus not bending it. I am not
  really sure that the condition actually defines a surface, and it would
  probably not fit the border condition anyways.

- Imagine that the outside part of the object has a different IOR. That can
  account perfectly for the light rays that pass through the object, but
  that brings back the problem to the light rays that do not.

There is the same problem for light rays between a light source and an
object: if they go through a transparent object with IOR, the IOR is
ignored.

The bottom line is that ray tracing can not perfectly simulate real world
physics.


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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