Jump to content

VDB shell collisions with FLIP


Recommended Posts

Hello, I am trying to make a shelled object with a thickness (so negative space outside and inside, but the thin shell is positive space for collisions) collide with a FLIP fluid sim. 
Essentially imagine an egg with some fluid inside. The fluid would stay inside until cracked. After that point the water spills out and the collisions of the shell are all accurate before and after the crack.

The problem im facing is that VDB creates only either a fully encased volume where anything thats inside the egg is negative and outside is positive or vice versa. I cant seem to make it recognize that the shell is the only thing it should be making a VDB volume out of and treating everything else as the outside.
I can turn on the invert sign on the collision for FLIP and it kinda works but then once the egg cracks it just all goes haywire. 

So Im not sure how to approach this. I have also tried to create two VDBs with slight offset and combine them with the multiply function. Which in volume slice shows as a narrow band but the FLIP particles dont seem to like it at all.

I have attached a simple file to show what's happening.

Water_test.hiplc

Link to comment
Share on other sites

One of the toughest things to collide with is a thin spherical surface. You have to use a lot of resolution to prevent holes. You can decouple particle separation from collision resolution. Even with very low values, you can see there are artifacts and holes that FLIP particles will leak through.

Untitled-1a.jpg.3fa12866053e0ec327cd99583c5d4b6d.jpg

What you can do is make your collision surface thicker. This will allow your simulation to run at a lower resolution, and patch gaps. Also, to avoid checking that Invert Sign checkbox, make a hole in the top of your collider, then flip is essentially resting inside a cup, not an egg. You don't have to render this modified geometry, but you can use it for collision.

flip_egg.gif.c7d0b1ef5ad7b1464268e7bdeaed853a.gif

 

Here's one with less reseeding and particle separation enabled with stick on collision turned on.

flip_egg.gif.5ce8fb90ea6e2bd519f1db88ee5431ba.gif

 

ap_Water_test.hiplc

Edited by Atom
Link to comment
Share on other sites

Ah I see! thank you very much! 

Sadly making the collision thicker is not really an option as I have around 100 of them all stacked together so the collision would intrude on others (its actually a medical animation for cells, not really eggs. The test scene was just an example).
I will try with making holes for the collisions! I was just hoping there would be an easy way to tell VDB that there is a thin shell, without having to create holes haha.


Thanks so much again for such a speedy reply! This will surely help
 

Link to comment
Share on other sites

11 hours ago, Atom said:

One of the toughest things to collide with is a thin spherical surface. You have to use a lot of resolution to prevent holes. You can decouple particle separation from collision resolution. Even with very low values, you can see there are artifacts and holes that FLIP particles will leak through.

Untitled-1a.jpg.3fa12866053e0ec327cd99583c5d4b6d.jpg

What you can do is make your collision surface thicker. This will allow your simulation to run at a lower resolution, and patch gaps. Also, to avoid checking that Invert Sign checkbox, make a hole in the top of your collider, then flip is essentially resting inside a cup, not an egg. You don't have to render this modified geometry, but you can use it for collision.

flip_egg.gif.c7d0b1ef5ad7b1464268e7bdeaed853a.gif

 

Here's one with less reseeding and particle separation enabled with stick on collision turned on.

flip_egg.gif.5ce8fb90ea6e2bd519f1db88ee5431ba.gif

 

ap_Water_test.hiplc

Ah it seems like it wont work after all.
I have made the hole at the top like you suggested and VDB now creates a shell for the liquid to collide which is great.
However I have this issue where the liquid doesnt seem to settle inside the shell before the shell gets broken. It just wants to infinitely compress into itself until it either clips through the collision geo or there is just a singular point of flip particles all stacked on top of each other.

Animation.gif.8f6f908fe25a7d367d98e6e9e86227b1.gif

I have tried to increase the collision separation as much as I could (both for the FLIP and the VDB) but it doesnt work. I tried turning on the separation in flip so they dont compress into each other but it doesnt work either. Any ideas as to why its compressing like this?
My collision volume is now 17 million voxels for this single sphere.
I have tried setting the substeps to minimum 5 and its still the same.

Animation_03.gif.d4a4bc7f223987fdc5add10d30cc1de2.gif

Animation_02.gif.dc72d0629a932526ad9b3e8997ad5b41.gif

ap_Water_test_02.hiplc

Link to comment
Share on other sites

To prevent the compressing of the fluid, leave the grid scale set to 1.0.

To prevent the fluid bounciness, leave viscosity enabled and adjust the value on the Physical tab of the FLIP Object. Closer to 0 is nearly no viscosity while values in the thousands can turn it to dough.

In this setup, I have discarded the vellumpost process thickener in favor of using a polyextrude on the pieces before they are simulated. This allows for an inner extrusion so you can stack your final spheres next to one another and still create a thicker collision surface. I have set up a group on the red piece to allow separate forces to affect only that piece of the fracture for art directed motions.

Remember, if you change the timing on the forces inside the vellum sim, you'll have to adjust the timing on the popwrangle, which activates vellum self collision, to match the new start keyframe on the popwind.

It's hard coded at frame #24.

if(@Frame>24){
    f@disableself = 0;  // Enable collision.
}

 

flip_egg.gif

ap_Water_test_03.hiplc

Edited by Atom
Link to comment
Share on other sites

52 minutes ago, Atom said:

To prevent the compressing of the fluid, leave the grid scale set to 1.0.

Thanks a lot for your fast replies! I dont mind the fluid bounce, but I'll keep the viscosity on.
The extrusion trick is definitely very helpful! I am not too familiar with Vex and why we need to disable self collision for those pieces but I'll take your word for it!

Okay so I dont know if its my houdini or something is wrong. I took your scene and disabled the vellum forces so it just stays in place as a sphere. I left everything else untouched and let the water just drop and settle. It immediately compresses into the sides of the wall. It sticks to the wall, giving the impression that there is fluid there, but its all compressed into itself making the middle hollow.

Here I have meshed the fluid to better show what's happening.

Animation_04.gif.cf272372dffa53a687a58deae89a110c.gif

Can you see how it all just quickly sinks into the walls, making this thin sheath of water at the walls? This is the problem I am having right now. The collision works great and everything is responsive, but the fluid just compresses into itself as soon as it has to settle down within that collision.

ap_Water_test_04.hiplc

Link to comment
Share on other sites

4 minutes ago, Atom said:

There is a running joke in the community that all simulations should be the size of the pig head. If you size up your sphere a bit and thicken the walls, the fluid holds its volume.

Oh my god thank you! I cant believe its so simple! 

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