Jump to content

shader issues with pouring water into a glass


~nature~

Recommended Posts

Hi,everyone,

I'm not very experienced with shader issues and really need your help here :P

When we pouring water into a glass,the water surface keeps changing all the time,that is at the beginning,the water only interact with the air,then interact with both air and glass,the part of the water which interacts with the glass won't be constant until the water calm down finally.

The problem here is that during the phase when the water interact with both the air and the glass,in terms of the water,the eta or the relative IOR is different and keeps changing across the whole water surface. how can I implement such different IOR in the water shader,should I assign the water-glass and water-air shader to different part of the water surface respectively? but in this situation how can I separate the water to air part and the water to glass part dynamically to assign the specific shader?

Or I only need one shader across the surface? maybe implement such different IOR in one shader or just considering only one IOR?

Thanks very much in advance,any suggestion here is invaluable for me :P

Edited by ~nature~
Link to comment
Share on other sites

The most obvious solution might be to have three different shaders: water, glass, and then a shader for the water/glass contact surface, all with appropriate IORs. In any case the problem is not so much on the shader side, but with dynamically separating the interacting water and glass surfaces. The Cookie SOP is not very reliable or predictable, so I can see that causing all kinds of headaches in animated scenes.

I'm actually kind of in the same boat right now, except I don't really need to deal with this for my project. I can get away with static liquid, but it would be nice to solve the problem and have some peace of mind. If anyone has done some liquid-pouring-into-glass type animations I'd love to hear how you went about it.

Link to comment
Share on other sites

The most obvious solution might be to have three different shaders: water, glass, and then a shader for the water/glass contact surface, all with appropriate IORs. In any case the problem is not so much on the shader side, but with dynamically separating the interacting water and glass surfaces. The Cookie SOP is not very reliable or predictable, so I can see that causing all kinds of headaches in animated scenes.

I'm actually kind of in the same boat right now, except I don't really need to deal with this for my project. I can get away with static liquid, but it would be nice to solve the problem and have some peace of mind. If anyone has done some liquid-pouring-into-glass type animations I'd love to hear how you went about it.

Hi,DaJuice,thanks for your reply. :P

I've just came to one solution,not tried yet,but it should work theoretically :P :the glass is chosen for the isolation instead of water,and the glass is divided into two parts,with outside assigned the glass shader normally but inside with such special glass shader which can dynamcally feel the water's contact.

for the levelset fluid,it can be easily determined by the SDF sign,if not yet contact,the value is > 0,otherwise <=0 (maybe add some threshold to it).

for SPH method,it can be converted into SDF by appending iso offset sop to particle fluid surface sop.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...