POV-Ray : Newsgroups : povray.newusers : Refraction in transparent objects? Server Time
13 Nov 2024 20:32:15 EST (-0500)
  Refraction in transparent objects? (Message 1 to 9 of 9)  
From: Tim Gosnell
Subject: Refraction in transparent objects?
Date: 15 Jun 2000 13:39:54
Message: <394914EB.83C7F01C@lanl.gov>
Glass lover POVers:

I'm a new user (Mac OS) as of yesterday and I'm already encountering
what I think are nonphysical effects.

I have a scene comprising a simple horizon and a glass box with ior=1.5.
The top of the box  is tilted by 30 degrees toward the horizon. When
viewing the horizon through the box, the horizon line should shift
relative to the horizon line outside the box. But what results is no
shift at all. All the internal reflections and such are present (through
use of the finish modifier). Here's the code:

#include "colors.inc"


 camera {
  location <0, 1, -5>
  look_at  <0, 0,  5>
 }


box {
 <-1,0,0>, <1,3,.5>
 pigment { Clear }
 finish {       ambient 0       diffuse 0       reflection .1
specular 1       roughness .001    }
 interior{ior 1.5}
 rotate x*30
}

 plane {
 y, 0
 pigment{ checker color White color Blue}
}

plane { y,500
 pigment {color Cyan}

}
light_source { <0, 2, 3> color White}


Post a reply to this message

From: Tim Gosnell
Subject: Re: Refraction in transparent objects?
Date: 15 Jun 2000 13:59:40
Message: <3949198D.61B344B5@lanl.gov>
Nevermind!

That's what objects at infinity do!


Tim Gosnell wrote:

> Glass lover POVers:
>
> I'm a new user (Mac OS) as of yesterday and I'm already encountering
> what I think are nonphysical effects.
>
> I have a scene comprising a simple horizon and a glass box with ior=1.5.
> The top of the box  is tilted by 30 degrees toward the horizon. When
> viewing the horizon through the box, the horizon line should shift
> relative to the horizon line outside the box. But what results is no
> shift at all. All the internal reflections and such are present (through
> use of the finish modifier). Here's the code:
>
> #include "colors.inc"
>
>  camera {
>   location <0, 1, -5>
>   look_at  <0, 0,  5>
>  }
>
> box {
>  <-1,0,0>, <1,3,.5>
>  pigment { Clear }
>  finish {       ambient 0       diffuse 0       reflection .1
> specular 1       roughness .001    }
>  interior{ior 1.5}
>  rotate x*30
> }
>
>  plane {
>  y, 0
>  pigment{ checker color White color Blue}
> }
>
> plane { y,500
>  pigment {color Cyan}
>
> }
> light_source { <0, 2, 3> color White}


Post a reply to this message

From: Bob Hughes
Subject: Re: Refraction in transparent objects?
Date: 15 Jun 2000 14:16:03
Message: <39491d63@news.povray.org>
"Tim Gosnell" <gos### [at] lanlgov> wrote in message
news:3949198D.61B344B5@lanl.gov...
| Nevermind!
|
| That's what objects at infinity do!

I was about to post the same answer.
To see it right with non-infinite objects try this:

// BEGIN

 camera {
  location <0, 1, -5>
  look_at  <0, 1,  0>
 }

box {-1,1
 pigment { rgbf 1 }
  finish {ambient 0 diffuse 0 reflection .1 specular 1 roughness .001}
   interior{ior 1.5}
 scale <1,1,.5> rotate x*30 translate 1*y
}

box {-1,1 scale <20,.01,20>
 pigment{ checker color rgb 1 color rgb<0,0,1>}
  finish {ambient .5}
}

plane { y,500
 pigment {color rgb<0,1,1>}
  finish {ambient .5}
}

light_source { <0, 2, 3> , 1}

sphere {<-5,1,10>,1 pigment {rgb<0,1,0>}}
sphere {<0,1,10>,1 pigment {rgb<1,1,0>}}
sphere {<5,1,10>,1 pigment {rgb<1,0,0>}}

// END


Post a reply to this message

From: Tim Gosnell
Subject: Re: Refraction in transparent objects?
Date: 16 Jun 2000 15:46:58
Message: <394A8432.C5DE0D14@lanl.gov>
Thanks Bob!  I'll give your script a look.

I'm trying to model an object involved in a physics experiment. It starts
with a hollow shell of glass (of nonzero wall thickness), but the shell
is then filled with a lumpy layer of ice that coats the inside wall of
the shell. Inside the layer is just air. I'm having pretty good success
with this but I have some uncertainties about how some of the optical
physics is being handled. Are you a good person to ask about this?

Best,
Tim

Bob Hughes wrote:

> "Tim Gosnell" <gos### [at] lanlgov> wrote in message
> news:3949198D.61B344B5@lanl.gov...
> | Nevermind!
> |
> | That's what objects at infinity do!
>
> I was about to post the same answer.
> To see it right with non-infinite objects try this:
>
> // BEGIN
>
>  camera {
>   location <0, 1, -5>
>   look_at  <0, 1,  0>
>  }
>
> box {-1,1
>  pigment { rgbf 1 }
>   finish {ambient 0 diffuse 0 reflection .1 specular 1 roughness .001}
>    interior{ior 1.5}
>  scale <1,1,.5> rotate x*30 translate 1*y
> }
>
> box {-1,1 scale <20,.01,20>
>  pigment{ checker color rgb 1 color rgb<0,0,1>}
>   finish {ambient .5}
> }
>
> plane { y,500
>  pigment {color rgb<0,1,1>}
>   finish {ambient .5}
> }
>
> light_source { <0, 2, 3> , 1}
>
> sphere {<-5,1,10>,1 pigment {rgb<0,1,0>}}
> sphere {<0,1,10>,1 pigment {rgb<1,1,0>}}
> sphere {<5,1,10>,1 pigment {rgb<1,0,0>}}
>
> // END


Post a reply to this message

From: Bob Hughes
Subject: Re: Refraction in transparent objects?
Date: 16 Jun 2000 16:30:39
Message: <394a8e6f@news.povray.org>
"Tim Gosnell" <gos### [at] lanlgov> wrote in message
news:394A8432.C5DE0D14@lanl.gov...
| Thanks Bob!  I'll give your script a look.
|
| I'm trying to model an object involved in a physics experiment. It starts
| with a hollow shell of glass (of nonzero wall thickness), but the shell
| is then filled with a lumpy layer of ice that coats the inside wall of
| the shell. Inside the layer is just air. I'm having pretty good success
| with this but I have some uncertainties about how some of the optical
| physics is being handled. Are you a good person to ask about this?

In a word, no.  Mainly because I think someone that has a good knowledge of
both optics and the POV-Ray inner workings is needed to answer questions
regarding this sort of thing.  It has always been said though that POV-Ray is
not to be considered a truly accurate system to work with far as science and
reality goes.  Says so some place in the docs I believe.
The major consensus about the type of thing you are doing seems to be to have
the separate parts intermingle their surfaces for the best results, since this
can prevent an "air" layer from occurring at each ray intersection.  I think
however this idea applies to intersection with a non-transparent object such
as a drinking glass set upon a tabletop whereas the transparency of several
surfaces such as you are doing could be an altogether outcome.  Example of the
overlapping method: the tracing ray goes through outer surface of glass, outer
surface of ice, inner surface of glass, inner surface of ice and then through
air and back out in reverse order.  So the thing to do perhaps is to use CSG
'merge' but then you lose the inner surfaces altogether and get only a outer
glass surface then inner ice surface.  Anyhow, it's something I don't know
about as far as mimicking reality and which method to choose over one or the
other.  I've always gone for what looks right at the time and if you have any
real object to compare to you'll no doubt be better off.

Bob


Post a reply to this message

From: Ron Parker
Subject: Re: Refraction in transparent objects?
Date: 16 Jun 2000 17:48:45
Message: <slrn8kl8nd.1s9.ron.parker@linux.parkerr.fwi.com>
On Fri, 16 Jun 2000 15:29:27 -0500, Bob Hughes wrote:
>The major consensus about the type of thing you are doing seems to be to have
>the separate parts intermingle their surfaces for the best results, since this
>can prevent an "air" layer from occurring at each ray intersection.  

The consensus is wrong.  Neither way works correctly; we really need to fix
the coincident surfaces problem to do it right.  I posted an article to cgrr
a few weeks ago detailing my observations.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Warp
Subject: Re: Refraction in transparent objects?
Date: 18 Jun 2000 11:23:52
Message: <394ce987@news.povray.org>
Ron Parker <ron### [at] povrayorg> wrote:
: we really need to fix the coincident surfaces problem to do it right.

  Can it be fixed?

  Let me guess: Calculate the intersection of the ray with the surfaces and
then see if there's another intersection at a distance less than epsilon.
Then take the average (?) of the color of the surfaces and treat both
intersection as if they were just one.
  Something like that?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: Refraction in transparent objects?
Date: 19 Jun 2000 09:40:08
Message: <slrn8ks98r.2ei.ron.parker@linux.parkerr.fwi.com>
On 18 Jun 2000 11:23:52 -0400, Warp wrote:
>Ron Parker <ron### [at] povrayorg> wrote:
>: we really need to fix the coincident surfaces problem to do it right.
>
>  Can it be fixed?
>
>  Let me guess: Calculate the intersection of the ray with the surfaces and
>then see if there's another intersection at a distance less than epsilon.
>Then take the average (?) of the color of the surfaces and treat both
>intersection as if they were just one.
>  Something like that?

In the general case, no, it can't really be fixed.  Probably the best we
could do is treat them as consecutive surfaces, but keep track of what order
they were evaluated in and always evaluate the same two surfaces in the same 
order everywhere (actually, they'd be evaluated in reverse order if the ray
started inside of them, but that's not too hard to deal with.)

The refraction problem can be solved more easily, though, without actually
solving the coincident surfaces problem.  It might even look physically 
correct.  It's just not what I'd call "right."

Anyway, this is getting out of .newusers territory.  Redirected to .general.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Tim Gosnell
Subject: Re: Refraction in transparent objects?
Date: 19 Jun 2000 14:30:47
Message: <394E66D8.4356C04F@lanl.gov>
Thanks to all for the thoughtful responses to my inquiry; I have a few
thoughts/encouragements/ideas to offer on this problem:

First of all let me say how charmed I am by the capabilities and potential
that POVray exhibits and by the spirit of its developers and guardians in
making this tool available to everyone.   To me, this program represents a
rare coincidence of art, technology, and science where individual
practitioners possessing no more than modest personal resources can make a
difference.  At the same time, the collectivist character of the enterprise
is a wholly new strategy for creating new knowledge. It is a perfect
example of what I believe may evolve in other disciplines; it would be as
if a Nobel prize were awarded to an distributed activity that generated
brilliant results rather than to an individual.

I would also like to encourage the POV community to consider continuing
upgrades to the physical correctness of the algorithms. Mainly this is
because I believe the full range of applications of the program have yet to
be tapped; with continued advances in computing power the kinds of problems
amenable to POV solutions will only expand. I think this is important
because part of the intellectual excitement I feel about this program
involves the unravelling of what optical features have an influence on how
we perceive the world and which do not. What features must be modeled?
Must they be physically based? Can some be ignored?  Do some need only to
be represented empirically? Is there a visual analogue to psychoacoustics,
a subdiscipline pertinent to audio reproduction? At the very least, it is
as though the same process undertaken by Renaissance painters in their
attempts to accurately represent the world are being addressed again in a
totally new context.

As a solution to the problems that Bob,  Ron, and Warp bring up,  I should
mention that I use a profoundly capable (and profoundly expensive)
scientific nonsequential ray tracer as part of my work. It is not useful
for generating computer graphics, but includes the ability to model such
effects as angle-dependent Fresnel reflection, attenuation, multilayer
optical coatings, scattering, polarization, interference, and diffraction.
The way in which "coincident surfaces" are handled is simple and powerful:

Every surface is characterized by an "interface" modifier which allows one
to specify the result of a ray intersection with that surface. For example,
a block of glass would have a specification that included the index of
refraction outside the surface and the index of refraction inside the
surface. What counts as inside and outside can be determined naturally by
virtue of the topology of the object, or it can be defined by the existence
of a surface normal vector. Note that this differs from the POV-Ray
approach which attaches a refractive index to the interior of an object and
otherwise is ignorant of any surrounding/enclosing material. If in the
block example one wanted to insert into the interior a spherical ball with
a different index of refraction, one just gives an interface specification
that includes the ior of the glass block and the ior of the ball. In this
way, refraction of a ray hitting the block is determined by the interface
specification of that surface (e.g., ior=1 outside, ior=1.5 inside). If the
ray then strikes the interior ball, the interface specification ( e.g.
ior=1.5 outside, ior=1.3 inside) then gives the correct refraction (and
Fresnel reflectivity/transmission!). Any other surface properties
(roughness, etc) can be included as part of the interface specification. If
instead you *really* do want to model the effect of one transparent surface
pushed up against another, you would simple create two overlapping (or
nearly overlapping) surfaces each with their own interface specifications.
Implementing these ideas in POV-Ray would clearly require some new
functions ( I see a first attempt has evidently been made in pulling out
the "interior" command from the texture command), but I think this would
make understanding the program behavior--when transparent objects are
involved--a lot simpler.

I'd be delighted to help out in contributing to getting the physics set up
if this is attractive to the programmers.

Thanks to all again,
Tim


Post a reply to this message

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