PDA

View Full Version : rendering animating liquid in glass


H2
04-29-2009, 10:17 AM
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.

PurpleRainbow
05-01-2009, 08:27 AM
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

H2
05-02-2009, 12:20 PM
thanks thats exactly the kind of thing i was looking for I will give it a try.:thumbsup:

royter
05-04-2009, 02:46 PM
thanks thats exactly the kind of thing i was looking for I will give it a try.:thumbsup:

have u found it?
does it work?

H2
05-05-2009, 09:08 AM
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.

royter
05-05-2009, 02:35 PM
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?

H2
05-05-2009, 03:04 PM
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?


http://www.harinhirani.co.uk/wip/wine1.jpg

i-d
05-05-2009, 04:10 PM
Have you tried editing interface surface IOR to 1.33 or 1.55

since its obviously wrong here

H2
05-05-2009, 04:50 PM
yup I tried changing the IOR values for the interface material but it still doesnt appear correct.

davegreenwood
05-05-2009, 05:27 PM
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.

H2
05-05-2009, 05:40 PM
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

davegreenwood
05-05-2009, 06:50 PM
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.

Puppet|
05-06-2009, 06:59 AM
Here is the scheme how p_dielectric_interface works:

http://www.puppet.tfdv.com/p_dielectric_interface_work.jpg

Do you have same setup?

'Ignore Normal' should be Off.

Please share example scene (or send it to my mail).

H2
05-06-2009, 10:01 AM
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

davegreenwood
05-06-2009, 11:54 AM
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.

Puppet|
05-06-2009, 01:11 PM
to H2:

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

http://www.puppet.tfdv.com/p_dielectric_interface_result1.jpg

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.

H2
05-06-2009, 01:30 PM
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

Puppet|
05-06-2009, 02:15 PM
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

achoury
05-06-2009, 02:32 PM
Hi puppet
Using your scene without changing anything, but the render does not look the same:

http://www.postmyimage.com/images/imagesHdP20266.jpg

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

achoury
05-06-2009, 02:58 PM
with Beta10 the render look fine but still get this error:
// Error: Cannot find procedure "AEdie_int__modeReplace".
/rachid

H2
05-06-2009, 03:02 PM
Hi Paval I just opened your scene with the recompiled p shaders and it seems to be fine I get the same result as your image. I will do some more tests with it later and see how I get on. Thanks for all your help.

achoury: Thats the result you get before the bug fix beta 9

achoury
05-06-2009, 03:19 PM
Hi Paval I just opened your scene with the recompiled p shaders and it seems to be fine I get the same result as your image. I will do some more tests with it later and see how I get on. Thanks for all your help.

achoury: Thats the result you get before the bug fix beta 9

Using the same scene, double click on the node p_dielectric_interface, nothing happen, all work fine right?! now close the attribute editor and double click once again or just hit ctrl+a,
the error message will be visible again.
// Error: Cannot find procedure "AEdie_int__modeReplace".
/rachid

H2
05-06-2009, 03:34 PM
Yeh I been noticing that error but kind of been ignoring it ..

Puppet|
05-06-2009, 06:09 PM
Regarding error...
It's just GUI (AETemplete) error. It will effect only to updating drop down menu if you are using several p_dielectric_interface nodes.

You may ignore it or fix it. Just open AEp_dielectric_interfaceTemplate.mel file and replace double underscore with single one on line 28:

editorTemplate -callCustom "AEdie_int_modeNew" "AEdie_int_modeReplace" "object_mode";

Please share your images...

achoury
05-06-2009, 06:24 PM
Thank you Puppet :thumbsup:
/rachid

royter
05-06-2009, 09:47 PM
i installed the latest shader.
it renders fine but it doesn't give exactly the same result as with the 3 surfaces method:
(using mia_material) ... any ideas?

http://sor.typepad.com/.a/6a00d8350600cb53ef011570735b55970b-800wi

H2
05-07-2009, 10:03 AM
Just started testing the shader with mia material, this is what I am getting.

I will try a few more tests.

http://www.harinhirani.co.uk/wip/wine2.jpg

H2
05-07-2009, 10:19 AM
With dielectric Material, the shading for interface seems to be quite similar on both apart from the reflection at the bottom which I think might be a bug?. Not sure what the strange artifacts are on the top surface of the liquid.

http://www.harinhirani.co.uk/wip/wine3.jpg

H2
05-07-2009, 10:48 AM
And with P_megaTK shader, interface is near identical minus the reflection.

http://www.harinhirani.co.uk/wip/wine4.jpg

radobe
05-16-2009, 12:07 PM
I tested the shader aswell and i got these strange artifacts in the liquid using the mia material X in conjunction with puppets shader too. It seems that they depend on the subdivision of the mesh, because when i apply a subdiv approximation and crank the settings up these artifacts change and become more detailed.

H2
05-17-2009, 09:51 PM
I have sort of abandoned this project now as I never really found a fully functional solution... :shrug:

royter
05-17-2009, 11:06 PM
me too.
i'm a bit disapointed because this is the only shader that let's you render animated liquid/glass interaction in Maya.
So if this doesn't work then we will never be able to render liqui/glass animations in Maya.
Hope that Nvidia will come up with a solution (just like they almost did with the production shaders)

Puppet|
05-18-2009, 07:19 AM
Thank you for testing.
Sorry, I have deadline last week and next couple of days. I'll try to fix shader soon.

H2
05-18-2009, 12:26 PM
No problem Paval, Thanks

Puppet|
06-02-2009, 02:07 PM
shaders_p 3.3 beta 11:
http://www.puppet.tfdv.com/download/shaders_p_e.shtml
I'd improve p_dielectric_interface shader. And looks like result is more close-by "3 surface" method now, but still is not ideal.
Also added new texture shader p_eye (work in progress)

stooch
06-03-2009, 02:04 AM
spasibo dorogoy. Im working on a movie and we got to match a wisky shot in a dudes hand. so ill be testing this tomorrow :)

stooch
06-04-2009, 09:53 PM
works great with dielectrics! thanks.

stooch
06-05-2009, 12:23 AM
is there anything special i have to do to get these to show up on the render farm?

its rendering fine locally but not when rendering with the farm. its a network install of maya so i figured it should pick em up with the nodes. but not so.

H2
06-06-2009, 12:38 AM
Hi Paval,

thanks for the shader update, ill test it out next week when i get the chance.

Is it compatible with mia material btw?

H2
06-11-2009, 09:15 AM
Hi Paval,

just managed to test it with the mia material. Works like a charm =)

Big thanks,

Harin

http://harinhirani.co.uk/wip/wine5.jpg

Puppet|
06-11-2009, 10:46 AM
Thanks for tests.

May I use this image for p_dielectric_interface documentation?
If yes, what should I add as signature? "Image by Harin Hirani"?

DariuszLacheta
06-11-2009, 12:46 PM
H2 looks cool!
it's animation? can you show it? :)

H2
06-11-2009, 02:07 PM
Hi Paval, sure you can use the image, "image by Harin Hirani" is kool by me aswell.

I will render out the animation tonight and post it here for anyone whos interested.

ovspianist
07-19-2009, 05:46 PM
Hey people i just bumped into the problem and thanks for these, will try some time.

noizFACTORY
07-20-2009, 08:35 PM
Oh great! Would you also be posting a 8.5 version as I'm stuck to that on a project that we're doing now?

-Sachin

ovspianist
07-21-2009, 02:08 AM
yeah me too!! our pipeline is based on 8.5 and now this is a real pain, i simulated the liquid in realflow with low poly glass and i got an unwanted sharp edge now...really annoying...

and our version doesn't have that shader p_dielectric_interface...

Puppet|
07-22-2009, 07:05 PM
Looks like I could port some shaders for Maya 8.5.
But with some limitations:
1. Only for Windows (32/64)
2. Only Maya 8.5
3. Followed shaders can't be ported: p_MegaTK, p_MegaTK_pass, p_HairTK, p_HairTK_shadow, p_SpotTK, p_PointTK, p_DirectTK, p_buffer_writer, p_math_output, p_OpenEXR_saver and p_physical_lens_dof. To much recode for port.

So, if you want I can add to shaders_p 3.1 followed shaders from 3.3beta11: p_dielectric_interface, p_CSG, p_eye

noizFACTORY
07-22-2009, 07:21 PM
Looks like I could port some shaders for Maya 8.5.
But with some limitations:
1. Only for Windows (32/64)
2. Only Maya 8.5
3. Followed shaders can't be ported: p_MegaTK, p_MegaTK_pass, p_HairTK, p_HairTK_shadow, p_SpotTK, p_PointTK, p_DirectTK, p_buffer_writer, p_math_output, p_OpenEXR_saver and p_physical_lens_dof. To much recode for port.

So, if you want I can add to shaders_p 3.1 followed shaders from 3.3beta11: p_dielectric_interface, p_CSG, p_eye

Thats awesome of you Pavel. Thanks a ton!

-Sachin

poorawaste
07-22-2009, 08:08 PM
shaders_p 3.3 beta 11:
http://www.puppet.tfdv.com/download/shaders_p_e.shtml
I'd improve p_dielectric_interface shader. And looks like result is more close-by "3 surface" method now, but still is not ideal.
Also added new texture shader p_eye (work in progress)

Is there a Mac OSX version of this? Can you post the link please. Thanks

Puppet|
07-22-2009, 08:28 PM
OK, here is shaders_p 3.1.3 for Maya8.5 for win32 and win64
http://www.puppet.tfdv.com/download/shaders_p_e.shtml
Really it's 3.1.2 version with p_CSG, p_dielectric_interface and p_eye shaders from 3.3 beta 11.
Sorry, it's not tested yet, because I have no Maya 8.5 installed.


For Mac OSX available only 3.3 beta 9. Because I have no Mac and can't recompile it.

noizFACTORY
07-22-2009, 09:28 PM
OK, here is shaders_p 3.1.3 for Maya8.5 for win32 and win64
http://www.puppet.tfdv.com/download/shaders_p_e.shtml
Really it's 3.1.2 version with p_CSG, p_dielectric_interface and p_eye shaders from 3.3 beta 11.
Sorry, it's not tested yet, because I have no Maya 8.5 installed.


For Mac OSX available only 3.3 beta 9. Because I have no Mac and can't recompile it.


Thanks a ton for the blazingly fast response Pavel! This will be the first thing I check out at work in the morning! :thumbsup: :thumbsup:

noizFACTORY
07-23-2009, 08:01 AM
The shader works like a charm Pavel! Though I have some refraction artifact from the glass that I've pointed out in the attached image. When I change the interface shader's IOR, the artifact changes too.

The mess that you see on the top of the realflow mesh is due to the interpenetrations so thats got nothing to do with the shader.

[http://sachinmukti.com/uploads/rnd/wip/del.JPG

-Sachin

Puppet|
07-23-2009, 10:21 AM
Are you sure that your liquid mesh is completely inside glass mesh? (no air between, on the corner)

noizFACTORY
07-23-2009, 03:23 PM
Are you sure that your liquid mesh is completely inside glass mesh? (no air between, on the corner)
Aaah! That must be it! I remember tweaking the bottom vertices of the glass' floor to avoid penetration with the liquid. Great, I'll try that for sure.

Thanks again Pavel!

-Sachin

UPDATE: It was indeed the problem of the glass mesh not intersecting the liquid. It works nicely now. Thanks again Pavel for this awesome shader!

-Sachin

CGTalk Moderation
07-23-2009, 03:23 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.