PDA

View Full Version : glass/liquid question

LFGabel
05-05-2003, 03:55 PM
Ok.. I've been thinking about this and must be having an off day. I am modeling liquid in a glass, an want all the refraction to be accurate.

I know with glass, you need an air surface:

G = glass, A = Air, L = Liquid, --> = surface normal

G <-- | --> A <-- | --> G <-- | --> A <-- | --> G

This works for an empy glass, but how does it go for a glass holding liquid?

My first thought was:

G <-- | --> A L <-- | --> G <-- | --> L A <-- | --> G

Is this right?

-Lee

brtk
05-05-2003, 06:42 PM
I might be wrong but I would try this:

LFGabel
05-05-2003, 10:16 PM
I'm pretty sure the air surface is on the inside... but I'll try that..

Thanks.

-Lee

luka
05-06-2003, 03:33 AM
I think you have one to many glass surfaces.
<G+A>< L+A ><G+A>
Don't forget the meniscus (surface tension) of the liquid. For your surfacing try my glass srf

mattclary
05-06-2003, 06:23 AM
Brtk has it right. There is no air between the glass and the water, so you shouldn't create any. Refraction occurs when light passes from one medium to the next. You normally model the air to make this accurate, as the LightWave environment might as well be a complete vacuum. If you put "air" between the glass and the water, that would not refract realistically.

LFGabel
05-06-2003, 10:14 AM
G <-- | --> A L <-- | --> A <-- | --> L A <-- | --> G

It makes sense to me... anyone else?

-Lee

mattclary
05-06-2003, 10:45 AM
Not really. The way I interpret your diagram you are putting a layer of air between your liquid and your glass. Why would you do that?

Lightwolf
05-06-2003, 11:07 AM
Hm let's see:

<-G | A-> <-L | G-> <-G | L-> <-A | G->

following the ray in one direction only:
from left to right:
<-G | <-L | <-G | <-A |
from right to left
| A-> | G-> | L-> | G->
Looks good so far.

Further up, above the liquid, it should be:
<-G | A-> <-A | G-> <-G | A-> <-A | G->

Chers,
Mike

mattclary
05-06-2003, 11:33 AM
I get:

A | G | A | G | A through the top

A | G | L | G | A through the bottom

LFGabel
05-06-2003, 12:15 PM
For Lightwave to render glass realistically you need an air surface within the glass and liquid.

Throw physics out the window, it doesn't apply here. :) It has more to do with surfacing and the way Lightwave calculates refraction.

For instance, if you have a sphere that is solid glass, you surface the outside surface of the cube as glass, then you copy it, flip it and the filpped polys become your air surface. This is how it has always been done to get realistic glass refraction, and it particularly important when you have a container object (like a wine glass) and the refraction has to happen several times.

My question was regarding how to surface it when a container has a liquid that refracts as well.

Lightwolf, you made the same mistake I made with the liquid. The interior of the liquid should be an air surface, like this:

<-G | A-> <-L | A-> <-A | L-> <-A | G->

I've attached an image that hopefully will show the differences. The first two objects are completely solid (not a container). I think the last two objects look the best, due to the air surface being used.

-Lee

Lightwolf
05-06-2003, 12:21 PM
Originally posted by lfgabel
Lightwolf, you made the same mistake I made with the liquid. The interior of the liquid should be an air surface, like this:

<-G | A-> <-L | A-> <-A | L-> <-A | G->

In that case the information I got about how LW handles the ior must be wrong.
I asked (I think it was Arnie Cachelin), and the information I got was that LW stores the ior of the current medium during raytracing.
Oh well :(
Cheers,
Mike

LFGabel
05-06-2003, 12:30 PM
Well I could still be wrong. I'd trust Arnie over myself any day :)

But the render looks pretty good...

-Lee

mattclary
05-06-2003, 12:37 PM
I PMed Arnie asking him to take a gander. As long as you're happy how it looks, who cares if it's technically accurate. :)

Lightwolf
05-06-2003, 12:38 PM
Hi lgabel,

well, my original question to arnie was a bit different actually.
the ior is actually the ratio from one surface type to another, in physics.
Am medium does not have an ior per se, but the boundary of two mediums does.
So, I was wondering if LW actually calculates the ratio, or expects the user (which would be dumb) to define the ratio manually. In the second case, the ior of <-G | L-> and <-A | L-> (the liquid ior) would be different.
But, since LW is aware of the medium the ray is travelling in, we're o.k.
I'm still puzzled at your air surface between the liquid and the glass. :(
Cheers,
Mike

LFGabel
05-06-2003, 01:15 PM
With an empty glass container, the surfaces go like:

<- G | A-> <-A | G->

This works well, (I think) because the glass surface is the outer surface.

It follows that if a object was made of liquid only (like rain drops) it would go like:

<- L | A-> <-A | L->

When liquid is in the container, the glass surface and the liquid surface should be facing outward. Therefore, you should just be able to stick the liquid into the glass container to get:

<- G | A-> <- L | A-> <-A | L-> <-A | G->

This is what I discovered works best from doing some research on the subject over the past day, along with feedback from you guys.

Does that make any sense?

-Lee

Lightwolf
05-06-2003, 01:25 PM
Hi ifgabel,
well, to be frank, not really.
It helps if you go through all surfaces, step by step.

mattclary
05-06-2003, 01:38 PM
Look, the only reason you put air polys on an object is because LW needs to know the change in the IOR. Without the air, no refraction is really going to occur. The air itself is not magical, it's simply a simulation of reality. You give it the IOR that real air has. SO, if you have liquid in a glass, there is NO air between it and the glass. If you set the proper IOR for the glass and the liquid, you DON'T need an air poly between the two. Lightwolf, I think you are agreeing with this, right?

Lightwolf
05-06-2003, 01:41 PM
mattclary,
I hereby officially declare that I agree with you in this matter.
Hey, we agree for once, great :D
Cheers and good night, I'm off,
Mike

mattclary
05-06-2003, 01:42 PM
:)

LFGabel
05-06-2003, 02:20 PM
From what you guys are saying, for a container holding liquid, it should not be:

<- G | A-> <- L | A-> <-A | L-> <-A | G->

but this:

<- G | <- L | A-> <-A | L-> | G->

While this will work for solid closed objects, like a sealed glass sphere with a liquid core, it won't work for a container that is open on one end and isn't completely filled up... At least that's what I've found.

Anyway.. I think this subject has been beaten to death now.

Thanks.

-Lee

Arnie Cachelin
05-06-2003, 06:51 PM
I agree too. as the ray passes through a surface, it wants to know the IOR of the material it is passing into, so as it goes from glass to liquid, the surface facing into the glass should have the IOR of the liquid. No added 'air' should be there, unless there are bubbles in the liquid, clinging to the sides. Naturally many of the most important liquids known to man have bubbles.

Also, I believe the IOR is defined as the ratio of the speed of light in a material to the speed of light in a vacuum, so it is pretty much an absolute number, but the amount of refraction at the boundary of 2 materials is just the ratio of the 2 IORs, or the 2 light speeds, since c cancels out.

This could be a good thread in which to discuss U.S. foriegn policy or Luxology, since it isn't infected yet:
Who is most evil:

George W. Bush
Dick Cheney

LFGabel
05-06-2003, 08:04 PM
It seems that I was partially talking out of my ***... :D

You're right... no air!

Thanks!

-Lee

mattclary
05-07-2003, 05:46 AM
Thanks for the response, Arnie!

wizlon
05-07-2003, 06:19 AM
Ifgabel, how does your render of liquid in a container look without the extra air surface, better or worse?

LFGabel
05-07-2003, 11:23 AM
What I couldn't really see in the test images I posted earlier is the distinct edge where the glass and the liquid touched. This shouldn't happen, confirmed by looking at a glass of water on my desk.

Without that air layer, there is no edge and it looks even more realistic.

-Lee