Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > Raytracing rendering software > Re: Refracted r...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 7 Topic 558 of 588
Post > Topic >>

Re: Refracted ray

by Miles Bader <miles.bader@[EMAIL PROTECTED] > Dec 6, 2007 at 01:31 PM

Hn <Hn@[EMAIL PROTECTED]
> writes:
>>    glass air
>>    glass water
>>    glass ice
>>
>> depending on where a ray is.  Today I use a list of medium being
>> traversed but I can't seem to be able to exit a material directly
>> into another one..
>
> Can you use a stack? Push the old IOR's as you enter a new medium (from
> the 'front' ), then pop them back when you exit a medium (from the back)

I suspect he's already using a stack (the "list of medium being
traversed"), but the problem is often it's convenient to be able to have
"objects" which aren't properly nested.

E.g.,
                              R
                             /
      ---+       +----------4-+        +---
         |       |    I    /  |        |
         +-------+--------3---+--------+
          \      |       /    |       /
          |      +------2-----+       |
          |            /              |
          |          W/               |
           \         /               /
           +--------1----------------+
                   /
              G   .
                 .
         -------0-----------------------

I being the ice cube, W the water and G the glass.  The ray R traverses
various interfaces at points 1 - 4.

You can handle the G->W at point 1 transition using the method I
previously mentioned (since that interface is probably static), and the
W->I interface at point 2 because it's an "entering" transition, but
what do you do at point 3 and 4?

That would seem more amenable to treating the list of "active" media as
a set than as a proper stack -- e.g., when you make an "exit"
transition, go back through the history of the ray, and find the
innermost medium which hasn't been exited.

So at point 3, you have a ray history like:

   0: enter G, from IOR = 1
   1: exit  G
    + enter W   (special handling because it's a dual interface)
   2: enter I, from IOR = W's IOR
   3: exit  W

[The "from IOR" at each "enter" point is just whatever IOR was current
at that point.]

I is the innermost active medium, so you'd use W's IOR as the new
current IOR.

At point 4, you have additionally:

   4: exit I

So no medium is active, and you'd just use 1 as the new IOR.

[I suppose the overlap between the ice cube and the water isn't quite
proper, but it's very convenient from a scene-definition point of view
to be able to do that kind of thing...]

-Miles
--
My spirit felt washed.  With blood.  [Eli ****n, on "The Passion of the
Christ"]
 




 7 Posts in Topic:
Refracted ray
"mc" <mc_roa  2007-12-05 18:15:24 
Re: Refracted ray
Miles Bader <miles@[EM  2007-12-06 08:29:38 
Re: Refracted ray
"mc" <mc_roa  2007-12-05 16:45:41 
Re: Refracted ray
Hn <Hn@[EMAIL PROTECTE  2007-12-06 03:10:35 
Re: Refracted ray
Miles Bader <miles.bad  2007-12-06 13:31:01 
Re: Refracted ray
Miles Bader <miles.bad  2007-12-06 13:42:06 
Re: Refracted ray
Hn <Hn@[EMAIL PROTECTE  2007-12-07 02:46:46 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 23:20:15 CST 2008.