rendering animating liquid in glass


#1

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.


#2

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. :lightbulb


#3

thanks thats exactly the kind of thing i was looking for I will give it a try.:thumbsup:


#4

have u found it?
does it work?


#5

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.


#6

can you post the link plz?


#7

here is a link to the puppet shaders,

http://www.puppet.tfdv.com/download/shaders_p_e.shtml

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?


#8

Have you tried editing interface surface IOR to 1.33 or 1.55

since its obviously wrong here


#9

yup I tried changing the IOR values for the interface material but it still doesnt appear correct.


#10

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…

cheers
Dave.


#11

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.

Harin


#12

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
Dave.


#13

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).


#14

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!

Harin


#15

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:thumbsup:

Dave.


#16

to H2:

Thank you for scene.
Looks like it was a bug. I have fixed it (but need for more tests):

But it’s p_MegaTK instead of mia_material.
If you interest, you may view my scene.
In your original scene you have CRAZY reflect/refract depth value! 8 12 16 will be enough.

Possible p_dielectric_interface have one more bug… (it’s reflection of the stem), but I’m not sure.

What OS are you using? I can compile new version for you.


#17

Hi Paval,

thanks for taking a look at the scene, sorry about my crazy depth values lol. I was changing alot of values when I was trying to figure out the issue forgot to change them back… ill see if i can work out whats going on with that reflection of the stem, could be another bug like you said.

I am on windows xp 64 bit

thanks

Harin


#18

Please try beta 10 here:
http://www.puppet.tfdv.com/download/shaders_p_e.shtml

Please let me know is it works for you or not


#19

Hi puppet
Using your scene without changing anything, but the render does not look the same:

and I get an error each time I double click on the shader p_dielectric_interface

// Error: Cannot find procedure “AEdie_int__modeReplace”.

and the Output Window show this warning msg

PHEN 0.4 warn : p_dielectric_interface shadow shader will produce correct shadows only with “segments” shadow mode!

so I changed the Shadows mode to segments, but still get the same render!
any clue?
/rachid


#20

with Beta10 the render look fine but still get this error:

// Error: Cannot find procedure “AEdie_int__modeReplace”.

/rachid