A glass of water with the new glass2 material

Discussions about LuxRender's materials, and how to make the most of them.

Moderator: coordinators

Re: A glass of water with the new glass2 material

Postby jeanphi » Fri May 25, 2012 6:54 am

Hi,

The correct way is to not have touching faces: you should model the interface between the dish and the medium as a single separate mesh and exclude that part from the dish mesh and from the medium mesh (see above examples).

Jeanphi
jeanphi
Developer
 
Posts: 6624
Joined: Mon Jan 14, 2008 7:21 am

Re: A glass of water with the new glass2 material

Postby Legion » Fri May 25, 2012 7:06 am

Then the meshes for the dish and medium will carry holes at the interface which will be filled by the separated mesh? Do I have this right? Wouldn't open meshes (no enclosed volume) cause strange results? I am rendering at the moment, so I'll give it a try later on :)
Legion
 
Posts: 10
Joined: Wed Mar 11, 2009 12:05 pm

Re: A glass of water with the new glass2 material

Postby jeanphi » Fri May 25, 2012 7:38 am

Hi,

I think you got it right. As long as the meshes edge are in contact and the volumes are associated correctly, there shouldn't be any issue.

Jeanphi
jeanphi
Developer
 
Posts: 6624
Joined: Mon Jan 14, 2008 7:21 am

Re: A glass of water with the new glass2 material

Postby B.Y.O.B. » Fri May 25, 2012 1:55 pm

User avatar
B.Y.O.B.
 
Posts: 1912
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

Re: A glass of water with the new glass2 material

Postby Legion » Sat May 26, 2012 12:35 pm

I searched around a bit and studied some tutorials on making a glass of water and I noticed that some guys let the normals of the water volume pointing outside towards the glass and some make it the other way around. Is it regardless of wether the normals point in oder out, as long as it is consistent and the volumes are completely right? Or is a light ray "guided" by the normals? I did some tests and I am not sure about the results.
This is my first version without glass2:
SkizzeA.1.png

In this version the contact areas are separated as jeanphi proposed. The normals of the medium pointing into the dish
Glass2.jeanphi.png

I also tried to make one mesh containing all elements and worked with multimaterials. Here the normals of all faces touching the medium are pointing into the medium, except for the medium/air interface:
Glass2.multimat.png

I think the second version by jeanphi looks good, especially at the top medium/dish interface. What do you think?
But I have no idea why the medium gets so dark. I rendered it without the dish. One the one hand with all normals pointing outwards
M_SurfN_out_CylN_out.png
and on the other hand with the normals pointing inwards (not the upper surface)
M_SurfN_out_CylN_in.png
to see if this has any influence. The value of "apsorption at depth" of the medium is greater than the maximal distance a light ray has to travel (along the camera axis) and the absorption color is bright red.
Legion
 
Posts: 10
Joined: Wed Mar 11, 2009 12:05 pm

Re: A glass of water with the new glass2 material

Postby J the Ninja » Sat May 26, 2012 12:41 pm

Legion wrote:I searched around a bit and studied some tutorials on making a glass of water and I noticed that some guys let the normals of the water volume pointing outside towards the glass and some make it the other way around. Is it regardless of wether the normals point in oder out, as long as it is consistent and the volumes are completely right? Or is a light ray "guided" by the normals? I did some tests and I am not sure about the results.
This is my first version without glass2:
SkizzeA.1.png

In this version the contact areas are separated as jeanphi proposed. The normals of the medium pointing into the dish
Glass2.jeanphi.png

I also tried to make one mesh containing all elements and worked with multimaterials. Here the normals of all faces touching the medium are pointing into the medium, except for the medium/air interface:
Glass2.multimat.png

I think the second version by jeanphi looks good, especially at the top medium/dish interface. What do you think?
But I have no idea why the medium gets so dark. I rendered it without the dish. One the one hand with all normals pointing outwards
M_SurfN_out_CylN_out.png
and on the other hand with the normals pointing inwards (not the upper surface)
M_SurfN_out_CylN_in.png
to see if this has any influence. The value of "apsorption at depth" of the medium is greater than the maximal distance a light ray has to travel (along the camera axis) and the absorption color is bright red.


The normals tells the ray what volume it is entering and leaving. If it strikes the front of a face, (light ray going in the opposite direction of the normal) Lux sees the ray as entering the interior medium defined for that face. If it strikes the back face, it is considered to be exiting into that faces exterior. So if you have the normals backwards, you can just switch the mediums around and it will still be right. You want to set it so a ray crossing the mesh that represents the water-glass boundary sees that it is exiting the glass and entering the water, so if the water has its normals out, you want water as the interior and glass as the exterior. If the normals are facing into the water, you have to either flip the normals or switch the mediums around.
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2249
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: A glass of water with the new glass2 material

Postby Legion » Sat May 26, 2012 3:34 pm

All right, I think I got it :) I flipped the normals of all "interfaces" outside and it looks great. The hand-drawn sketches in another thread and in the documentation of Mitsuba confused me, because there the normals are drawn inwards. Thanks for your help!

@B.Y.O.B.: Saw this file some days ago, but until today I had no account ;)
Legion
 
Posts: 10
Joined: Wed Mar 11, 2009 12:05 pm

Re: A glass of water with the new glass2 material

Postby Legion » Tue May 29, 2012 7:51 am

Allright, back in the lab I can render the improved model. I think the medium got a lot more realistic. But what can I do against all the reflections at the cut surface? Maybe thats how it would look like, but its disturbing ;)
Attachments
Schale2_Glass2.blend
(1.48 MiB) Downloaded 14 times
SkizzeC.02b.png
SkizzeC.01c.png
SkizzeA.1.png
Legion
 
Posts: 10
Joined: Wed Mar 11, 2009 12:05 pm

Re: A glass of water with the new glass2 material

Postby A-man » Tue May 29, 2012 8:12 am

Those reflected cut surfaces look like bad booleans normals, but it could very possibly be just how it looks. You could try assigning a mirror material to just those faces, then that way they will all reflect and create a uniform look. The fluid looks good, but your surface tension seems really really low (huge curve from the highest to the lowest point). I suppose that could be the case if your real world size is < 1cm :) It looks great though if that is the effect you are looking for!
Studio XPS 9100 | 2.8 Ghz Intel 930 | 12 GB RAM | Radeon 7970 3GB
User avatar
A-man
 
Posts: 691
Joined: Sat Apr 24, 2010 4:24 pm

Re: A glass of water with the new glass2 material

Postby Legion » Tue May 29, 2012 11:17 am

Great idea, I would never have thought of that because I tried to make it very realstic. A glossy material works perfect and I don't have to take care of my environment. Actually I didn't "bool" the mesh. I just deleted half of it and filled the holes, so normals are fine.
SkizzeC.01e.png

Some of these dishes are coated for optimal growth. So, the medium does "climb" higher as you would expect (sometimes an annoying thing).I could steepen the curve, but its just for a workflow demosntration ...
Legion
 
Posts: 10
Joined: Wed Mar 11, 2009 12:05 pm

Previous

Return to Materials Help

Who is online

Users browsing this forum: No registered users and 3 guests