POV-Ray : Newsgroups : povray.general : Overlaping objects with different ior values : Re: Overlaping objects with different ior values Server Time
6 Aug 2024 04:20:28 EDT (-0400)
  Re: Overlaping objects with different ior values  
From: Christopher James Huff
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

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