Page 1 of 3
Physically correct Glass of water
Posted: Mon Jul 07, 2008 2:41 pm
by MS
I have read the whole thread by Thomas An. about refraction of light.
http://www.maxwellrender.com/forum/viewtopic.php?t=2906
The thread is pretty old now. (ALPHA - 1.1.33 - May 20, 2005) Are there any changes? Can anyone explain how MR calculates index of refraction of “nested” materials (eg. Air-Glass-Water-Glass-Air)?
From school I remember Snell's law very well but I am not sure how to implement it in MR…
I performed some test and basic calculation. I found that only way I can get the “physically” correct result is as follows:
To use solid closed objects, to have “double sided” polygons on medium intersections.
Drawing:
Render OK:
If I used setup suggested by Thomas (to remove polygons on intersection glass and water) I always got strange result. Even I change face normals (it has no impact at all).
Render NG:
Drawing:
Render Reverse normals NG:
Can anyone from NL help to solve this question (how to model “physically” correct glass of water)?
I did not take into account situation on water level, where the order of materials is Air-Water-Glass-Air. I want to test it later.
Suggestions and questions are welcome.
Posted: Mon Jul 07, 2008 3:37 pm
by def4d
Interesting question, that old thread should be refreshed and resumed for the 1.7, if someone could do that?

Posted: Mon Jul 07, 2008 4:33 pm
by hyltom
I don't think you have used the right procedure to test Thomas method. Instead of removing the polygons on the intersection of the glass and the water, you should enclose the water inside the glass...well I'm not sure it's the correct way, but this is how i understand Thomas method.
Posted: Mon Jul 07, 2008 5:48 pm
by MS
hyltom wrote:Instead of removing the polygons on the intersection of the glass and the water, you should enclose the water inside the glass
I think my test simulates R1 beam on Thomas test. At point A the beam enters glass (glass IOR), then at point B water (water IOR), at X1 leaves water to glass, at X2 it leaves glass. Four membranes at light travel. And I got strange result with it.
Maybe I am wrong, I just do not know, how to do it right way.
Posted: Mon Jul 14, 2008 11:20 pm
by KurtS
a 15 minute rendering of a bottle with water using Thomas' method:

Re: Physically correct Glass of water
Posted: Tue Jul 15, 2008 12:06 am
by Thomas An.
MS wrote:The thread is pretty old now. (ALPHA - 1.1.33 - May 20, 2005) Are there any changes?
Some things that are different now ( although the overall result is the same as before in regards to liquid+glass):
1. A ray passes through a solid only if it encounters opening and then closing normals of the
same mesh. Unlike in the past you can no longer have separate meshes (now you have to merge them to be considered a solid)
2. Rays passing through a stray single plane (non solid) will always cause refraction regardless of the direction of its normals (unlike in the past).
The method of the old thread still works in 1.7 as long as you keep the glass as a solid (I can say it with certainty for dielectrics only ... I am not yet sure what is happening with SSS)
Re: Physically correct Glass of water
Posted: Tue Jul 15, 2008 12:13 am
by Thomas An.
MS wrote:

The above drawing has an error:
All glass normals need to be flipped to point in the opposite direction (outwards). Also, from left to right, vertical surfaces 1 and 4 need to be merged into one ... and vertical surfaces 2 and 3 also need to be merged into one.
Posted: Tue Jul 15, 2008 8:52 am
by MS
KurtS wrote:Thomas does not suggest to model the glass as an open mesh, what makes you think that?
There are three materials in Thomas's diagram:
Black - glass - can be colored glass
Red - liquid
Green - glass - white - over the liquid level
It makes me to think that the glass (the black one) is open mesh. Probably I am wrong.
As I quickly read answers from yesterday evening in this thread, there are some little changes in "closed mesh" etc. I will study and update my tests.
Thanks for your reply.
Re: Physically correct Glass of water
Posted: Tue Jul 15, 2008 9:02 am
by MS
Thomas An. wrote:
Some things that are different now ( although the overall result is the same as before in regards to liquid+glass):
1. A ray passes through a solid only if it encounters opening and then closing normals of the same mesh. Unlike in the past you can no longer have separate meshes (now you have to merge them to be considered a solid)
I see. Maybe this causes the strange results I got. I will test and post new tests.
Thank you Thomas!
Thomas An. wrote:The above drawing has an error:
All glass normals need to be flipped to point in the opposite direction (outwards).
You are right. The drawing is wrong. I was so confused with rendering result, so I made errors also in drawing. In the model there are
all glass normals pointing out of the glass.
Posted: Tue Jul 15, 2008 9:22 am
by Thomas An.
MS wrote:There are three materials in Thomas's diagram:
Black - glass - can be colored glass
Red - liquid
Green - glass - white - over the liquid level
It makes me to think that the glass (the black one) is open mesh. Probably I am wrong.
The green surface represented an
option ... I think it was mentioned somewhere deep in the thread, but I neglected to make it clear in the diagram.
During the alpha days it was possible to have open messes and still get proper dielectrics. The idea was to start with a solid glass, but if it was deeply colored you might opt to detach the top surface and keep it clear and colorless so that it doesn't affect the color of the liquid while you are looking from the top.
It turns out the benefit of having the green portion detached was negligible anyway ... and so in practice we always use just two solids. One for glass and one for the liquid.
Posted: Tue Jul 15, 2008 11:17 am
by pipcleo
in the above diagram where is the inner surface of the glass below the water line exactly?
or is there not one ? only the water object
Can you blow up that image to show exactly whats happening on the over lap ?
Maybe remove the water object to make it clear ?
Sorry but this is slightly confusing
Posted: Tue Jul 15, 2008 1:37 pm
by JorisMX
perhaps a very simple water in boring ikea glass scene would help solving the mysteries about this topic?
Posted: Tue Jul 15, 2008 2:28 pm
by KurtS
modeled directly after Thomas' diagram:
I forgot to ad smoothing in Studio, this is the reason for the radiant caustics to the left.
Posted: Tue Jul 15, 2008 3:05 pm
by pipcleo
like this ?
[URL=
http://imageshack.us]

[/UR
Posted: Tue Jul 15, 2008 3:08 pm
by Fernando Tella
Nop, just erase the inner glass profile (yes, it is going to be a solid block of glass).