rendering animating liquid in glass

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  04 April 2009
rendering animating liquid in glass

This seems to be a question that has been asked few times but without any solutions.

I know for static liquid in glass the method is simply to have 3 surfaces with different refraction values in order to get the liquid to refract to the edges of the glass and not see a gap. But how is this done with an animated mesh, say coming from realflow or one that is generated with nparticles?

I hope somone out there has a solution that can be done with mental ray, I have heard V-ray has a solution for this particular situation.
  05 May 2009
dielectric interface shader

puppet has a shader, dielectric interface, it is specialy for this kind of scenes - where there are 3 kind of surfaces, glass liquid and an interface. this shader automaticly hides liquid surface that is in glass surface and aplies ab interfece shader to glass surface that intersects liquid surface. all you got to do is to tell sahder wich object is liquid and wich one is glass.
  05 May 2009
thanks thats exactly the kind of thing i was looking for I will give it a try.
  05 May 2009
Originally Posted by H2: thanks thats exactly the kind of thing i was looking for I will give it a try.

have u found it?
does it work?
  05 May 2009
yes I had a did a little test with the shader yesterday and it seems to work. I will be trying it out with some realflow meshes today and see how it looks.
  05 May 2009
Originally Posted by H2: yes I had a did a little test with the shader yesterday and it seems to work. I will be trying it out with some realflow meshes today and see how it looks.

can you post the link plz?
  05 May 2009
here is a link to the puppet shaders,

I have been trying to use the shader today in a realflow setup and I dont seem to be getting the correct results.

I have 3 mia material shaders. glass IOR:1.5, liquid IOR:1.33 and the glass liquid interface IOR:0.88

Image on the left is how I expect it to look, this is done with 3 seperate meshes and applying the relevent shaders to each.

Image on the right is using the puppet shader and connecting the my shaders to the relevent slots, glass, liquid and interface. I have made sure the liquid mesh is intersecting the glass as the puppet shader requires. As you can see it doesnt look like how it should. I am guessing its because the normals for the interface are facing in the wrong direction and mia material doesnt have an option to ignore normals.

Does anyone have any experience using the p_dielectric_interface shader?

Last edited by H2 : 05 May 2009 at 03:25 PM.
  05 May 2009
Have you tried editing interface surface IOR to 1.33 or 1.55

since its obviously wrong here
  05 May 2009
yup I tried changing the IOR values for the interface material but it still doesnt appear correct.
  05 May 2009
Hi there, reverse the normals of the liquid object. Also, the noise you have in the right hand image... adjust the cut off threshold in the mia material, in the advanced refraction rollout. Try reducing the value from 0.01 to 0.001.

just having a look at this interesting shader myself...

  05 May 2009
Hey dave,

at the moment the normals for the liquid are facing outwards, reversing them is stopping them from refracting correctly. Ive also got the cutoff threshold at 0.001 for the glass material but still getting some noise not sure why that is.

  05 May 2009
hmm, well just trying this myself for the first time... I needed to reverse the liquid normal, but I was eye level with the surface so could not be certain that shaded correctly... Are you sure your liquid mesh is sound? Try with a simple poly shape before your realflow mesh. This shader performs a boolean, so needs to have the liquid sides within the mesh of the glass.

Good Luck
  05 May 2009
Here is the scheme how p_dielectric_interface works:

Do you have same setup?

'Ignore Normal' should be Off.

Please share example scene (or send it to my mail).
Pavel Ledin aka Puppet

Last edited by Puppet| : 05 May 2009 at 07:14 AM.
  05 May 2009
Hey paval thanks for the reply, I have set up the scene as shown in the diagram.

I have attached a simple scene not with the realflow mesh but jus a simple poly mesh which has the same problem.

I am using 3 mia materials in the setup but I have also tried it with the dielectric materials and they have the same issue.

I hope somone can figure this out!

Attached Files
File Type: zip (59.0 KB, 79 views)
  05 May 2009
Don't use color at max distance with the interface material, put the color in the standard slot, directly under the IOR value. I guess that makes sense as there is no distance at the interface...
And thanks Puppet, what a great shader

Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 09:14 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.