POV-Ray : Newsgroups : povray.general : Overlaping objects with different ior values Server Time
6 Aug 2024 02:22:16 EDT (-0400)
  Overlaping objects with different ior values (Message 39 to 48 of 48)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Micha Riser
Subject: Re: Overlaping objects with different ior values
Date: 24 Jul 2002 13:02:42
Message: <3d3eddb2@news.povray.org>
TinCanMan wrote:
> 
> Doing this, you essentially increase the number of surfaces as you can't
> have coincidental surfaces.
> 

An alternative would be to allow objects be (compleatly) inside another. So 
that the water object would have a list of its 'internal' objects. Tracing 
ray inside the water would then only test for these interal objects and the 
water container. Outside the water the interal objects would not have to be 
considered.

- Micha

-- 
http://objects.povworld.org - the POV-Ray Objects Collection


Post a reply to this message

From: Christopher James Huff
Subject: Re: Overlaping objects with different ior values
Date: 24 Jul 2002 13:31:25
Message: <chrishuff-DAB12C.12241724072002@netplex.aussie.org>
In article <3d3ed209@news.povray.org>, Micha Riser <mri### [at] gmxnet> 
wrote:

> > Another problem with this: transparent objects inside other transparent
> > objects, like a glass marble in a pool of water. It would also make the
> > pool of water more difficult.
> 
> Well, it could still be done by cutting the space for the marble out of the 
> water. But with too many cuts out the performance gain would be lost.

It wouldn't be a good solution. The interface between glass and water 
should be a single surface, with two they would have to either overlap 
or leave an air gap to avoid coincident surface problems. Overlap = bad, 
air gap = an entirely different situation from the one being simulated. 
Better to just say that if you are entering the marble you are exiting 
the water. But when you exit the marble, what do you exit into? Could be 
air, could be water...just check to see if the point is still "inside" 
the water object?

If you can guarantee that the marble is completely immersed, a ray could 
just check each surface against the last surface it hit to detect an 
exit, but if it pokes through the surface...similar to the "glass of 
water" situation.

Maybe a new type of "immersion" CSG would be helpful, some kind of 
half-merge: surface A (water) does not exist inside surface B (marble), 
but surface B does exist inside surface A.
immerse {
    FLUID_OBJECT
    IMMERSED_OBJECTS
}

Maybe separate ior entirely from the surfaces...say "this area of space 
has glass ior, this area has water, everything else has air". Whenever a 
surface is hit, check the ior at a tiny distance to each side. I don't 
really like this solution, but I think it would work.

Maybe at the CSG stage, the ior on each side of the surface could be 
computed and saved...

immerse {
    Water
    GlassCup
}

 ___ air ___
|g _|___|_  |
|l| |wat| | |
|a| |er | | |
|s| |___| | |
|s|_______| |
|___________|

A ray entering through the side of the glass and exiting either through 
the water (a) or the other side of the glass (b):
1: Start in air, hit the glass surface.
2: Hit the water surface, ignore because still inside glass object, but 
set "containing medium" to the water object.
3: Hit the glass surface again, exit to containing medium (the water).
4a: Hit the water. It is the containing medium, so exit into the next up 
medium (air).
4b: Hit the glass again, go from containing medium (water) to glass.
5b: Hit the water surface, inside glass so ignore, but exit containing 
medium to next up (air).
6b: Hit the glass surface, exit to containing medium (air).

This would require the immerse CSG, but it would work in every 
(realistic) situation I've thought of.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: Overlaping objects with different ior values
Date: 24 Jul 2002 13:45:24
Message: <chrishuff-E445B9.12381724072002@netplex.aussie.org>
In article <3d3edcb6@news.povray.org>, Micha Riser <mri### [at] gmxnet> 
wrote:

> AFAIR the discussions about this problem the suggested why to do this is 
> make the water overlap the glass. Because leaving a space between will 
> cause multiple reflections. However I don't know if the overlaping is 
> handled as wished in that case.

Which is exactly what I was talking about...


> It is in the nature of merges to overlap.Otherwise you could just as well 
> use union. It is even more in the nature of intersection memebers to 
> overlap ... otherwise you have a null object. So it would be natural to 
> assume at parsing time that merge/intersection do overlap and always issue 
> a warning when iors are different.

Ah, I see what you are saying now. That would apply to all non-unions, I 
think. And maybe different amounts of transparency as well as differing 
iors. And a "nowarn" flag to turn off the warnings for those cases where 
it is intentional.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: Overlaping objects with different ior values
Date: 24 Jul 2002 13:51:19
Message: <chrishuff-093E2E.12441124072002@netplex.aussie.org>
In article <3d3ed6fa@news.povray.org>, Micha Riser <mri### [at] gmxnet> 
wrote:

> But how would you combine the sample values to the final value? Average 
> would be much too dark. Sum of course depends on the number of samples.. 
> One would kinda have to estimate the number of all possible paths by 
> measuring the samples trace depth and then mulitplicate the average by that 
> number.

The sum should do the job...it would be darker than you would get by 
tracing all the paths, but ideally the paths that are skipped would have 
little contribution anyway. The first few samples are what would really 
determine the color, the "root" of the tree would fill in first, it is 
the furthest branches that would get left out. A simple scaling factor 
could compensate for that, maybe automatically depending on depth.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: Overlaping objects with different ior values
Date: 24 Jul 2002 13:53:54
Message: <chrishuff-EF37ED.12464124072002@netplex.aussie.org>
In article <3d3eda9b$1@news.povray.org>,
 "TinCanMan" <Tin### [at] hotmailcom> wrote:

> Here it is necessary to double up your surfaces so the surface of the water
> is slightly outside the surface of the glass. ie, the ray exits the glass
> into air and then into the water.  There is no way to avoid increasing the
> number of surfaces in this case if you want it to work correctly. For
> something completely immersed int the water (or glass for that matter) this
> isn't necessary (in case you think this is contradicatory to my previous
> post).

That is a different situation, where the fluid doesn't "wet" the glass 
and a layer of air is trapped between the two. That is a very easy case, 
POV definitely doesn't have any trouble with that one, but water doesn't 
usually do that.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Ron Parker
Subject: Re: Overlaping objects with different ior values
Date: 24 Jul 2002 14:45:45
Message: <slrnajtter.db0.ron.parker@fwi.com>
On Wed, 24 Jul 2002 12:38:17 -0500, Christopher James Huff wrote:
> In article <3d3edcb6@news.povray.org>, Micha Riser <mri### [at] gmxnet> 
> wrote:
> 
>> AFAIR the discussions about this problem the suggested why to do this is 
>> make the water overlap the glass. Because leaving a space between will 
>> cause multiple reflections. However I don't know if the overlaping is 
>> handled as wished in that case.
> 
> Which is exactly what I was talking about...

It's handled correctly except for the very rare case where a ray enters
the water object without leaving the glass object.  If your surfaces are
close enough together, that almost never happens and AA will fix it if it
does.

POV keeps a list of all interiors it's inside, and when it hits another face
that has the same interior, it removes that interior from the list.  If it
wasn't the last interior, though, the IOR doesn't change.  That effectively
makes the glass faces that are inside the water "disappear" from the point
of view of refraction/TIR, though of course any textures will still be 
computed.

-- 
#local R=rgb 99;#local P=R-R;#local F=pigment{gradient x}box{0,1pigment{gradient
y pigment_map{[.5F pigment_map{[.3R][.3F color_map{[.15red 99][.15P]}rotate z*45
translate x]}]#local H=pigment{gradient y color_map{[.5P][.5R]}scale 1/3}[.5F
pigment_map{[.3R][.3H][.7H][.7R]}]}}}camera{location.5-3*z}//only my opinions


Post a reply to this message

From: Christopher James Huff
Subject: Re: Overlaping objects with different ior values
Date: 24 Jul 2002 22:14:01
Message: <chrishuff-CFA82F.21065324072002@netplex.aussie.org>
In article <slr### [at] fwicom>,
 Ron Parker <ron### [at] povrayorg> wrote:

> It's handled correctly except for the very rare case where a ray enters
> the water object without leaving the glass object.  If your surfaces are
> close enough together, that almost never happens and AA will fix it if it
> does.

You mean where it just skirts the edge of the water object where it 
overlaps but doesn't touch the inner surface of the glass?


> POV keeps a list of all interiors it's inside, and when it hits another face
> that has the same interior, it removes that interior from the list.  If it
> wasn't the last interior, though, the IOR doesn't change.  That effectively
> makes the glass faces that are inside the water "disappear" from the point
> of view of refraction/TIR, though of course any textures will still be 
> computed.

I see...I think. ;-)
Seems slightly similar to my immersion CSG, only ignoring the ior 
instead of removing the entire surface, and quite a bit more general. 
I'll just have to try to implement it for my own tracer, then I'll 
understand it completely.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Mark Wagner
Subject: Re: Overlaping objects with different ior values
Date: 25 Jul 2002 00:56:15
Message: <pan.2002.07.25.04.55.38.836653.197@gte.net>
On Wed, 24 Jul 2002 12:49:10 -0400, TinCanMan quoth:

>> One thing that has been bothering me is the "glass of water" type
>> situation...I'm not sure POV handles it correctly or how to model it
>> correctly.
>>
>>
> Here it is necessary to double up your surfaces so the surface of the
> water is slightly outside the surface of the glass. ie, the ray exits
> the glass into air and then into the water.  There is no way to avoid
> increasing the number of surfaces in this case if you want it to work
> correctly. For something completely immersed int the water (or glass for
> that matter) this isn't necessary (in case you think this is
> contradicatory to my previous post).
> 
> -tgq
 
If you could create the glass without an inner surface (perhaps by using
clipped_by), you would get the most realistic performance, since the ray
would go directly from glass to water, without passing through a layer of
air.

-- 
Mark


Post a reply to this message

From: Ron Parker
Subject: Re: Overlaping objects with different ior values
Date: 25 Jul 2002 09:16:20
Message: <slrnajvuh5.2ut.ron.parker@fwi.com>
On Wed, 24 Jul 2002 21:06:53 -0500, Christopher James Huff wrote:
> In article <slr### [at] fwicom>,
>  Ron Parker <ron### [at] povrayorg> wrote:
> 
>> It's handled correctly except for the very rare case where a ray enters
>> the water object without leaving the glass object.  If your surfaces are
>> close enough together, that almost never happens and AA will fix it if it
>> does.
> 
> You mean where it just skirts the edge of the water object where it 
> overlaps but doesn't touch the inner surface of the glass?

Right.  A very rare case indeed.

-- 
#macro R(P)z+_(P)_(P)_(P+1)_(P+1)+z#end#macro Q(C,T)bicubic_patch{type 1u_steps
6v_steps 6R(1)R(3)R(5)R(7)pigment{rgb z}}#end#macro _(Y)#local X=asc(substr(C,Y
,1))-65;<T+mod(X,4)div(X,4)9>-2#end#macro O(T)Q("ABEFUQWS",T)Q("WSXTLOJN",T)#
end O(0)O(3)Q("JNKLCGCD",0)light_source{x 1}// ron### [at] povrayorg


Post a reply to this message

From: Christopher James Huff
Subject: Re: Overlaping objects with different ior values
Date: 25 Jul 2002 11:38:40
Message: <chrishuff-9B5702.10313425072002@netplex.aussie.org>
In article <pan### [at] gtenet>,
 Mark Wagner <mar### [at] gtenet> wrote:

> If you could create the glass without an inner surface (perhaps by using
> clipped_by), you would get the most realistic performance, since the ray
> would go directly from glass to water, without passing through a layer of
> air.

If you cut away the water surface, the ray never "enters" the water 
object. If you cut away the glass surface, it won't leave the glass 
object until it reaches the other side of the cup, if it exits through 
the top of the cup it will never become "outside" the cup.

As Ron Parker explained though, when there is an overlap the glass/water 
transition is handled as it should be and the ior of the redundant 
surface is ignored, so you don't need any special CSG. Still, there are 
two extra surfaces in the body of the glass...that just bugs me, having 
6 surfaces where 4 should be sufficient.

Maybe it would be possible to specify interior transitions on a 
per-surface basis...instead of a "water object" and a "glass object", 
the glass of water situation would be 3 separate surfaces: glass-air, 
glass-water, and water-air. The modelling would be more difficult...it'd 
probably only be worth it for a scene with a lot of glasses and bottles 
of liquids (a lab or bar?) or if it was somehow automatically generated 
(back to the immerse CSG?). Maybe a good trick for a real-time raytracer 
though.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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