Jump to content

Grain Sim with Collision Geo that has changing topology


Nick da Silva

Recommended Posts

Hi all!

 

I'm trying to do a PBD sim of a character who's body turns into sand over time. My problem is that I'd like the sand as it falls to collide with the moving body but obviously the parts of his body that have turned into sand should no longer be collided with as they are no longer there. This poses a big problem that I have not found a solution for.

 

How do you have a collision object that's topology is changing over time? Houdini cannot interpolate between frames where the point count/order changes which makes complete sense but what is the alternative? Can anyone offer a solution or alternative approach for me?

 

In the attached file you can see the spread (in red) where the character is turning into sand. The parts that are not red need to remain as collisions.

 

Thanks so much!

Link to comment
Share on other sites

Have you even tried colliding with a mesh that has changing topology or are you just jumping to that conclusion? Just make sure you have sub-frame data and it shouldn't be a problem with the the Dop substeps.

Link to comment
Share on other sites

Hi David

 

Yes, I've done plenty of tests and none of them work. The sub frame interpolation freaks out because the point order is completely different from frame to frame. Then when it gets to the next integer frame it jumps back to the correct collision geo and there is plenty of penetration and the particles go crazy.

Link to comment
Share on other sites

You might try assigning the point number to an id attribute on each point of your collision geometry before any simulation. Then unlock the Collision Source SOP ("Allow Editing of Contents") and look for the compute_velocity node and turn on Match by Attribute. It's possible that parameter should be promoted to the top-level of Collision Source.

Edited by johner
Link to comment
Share on other sites

Ok, so I publically confess my stupidity. Thanks David and John for taking the time to help me :)

 

I was writing out my geo after modifying the topology but before converting it to VDB for collision. So I was being forced to use the timeblend to try to create the sub frames for me which is what was not working. So if I go back and remove the writing out of the geo and let it calculate the vdb all the way from the original geometry (which has consistent topology so the sub frames interpolate correctly). It's a silly mistake but I was trying to speed things up by writing out the data. Anyway, it seems to be working now. Hopefully this can help someone else from making the same mistake.

 

John. Thanks for the reply. I'll definitely look into that as another solution if I run into more problems.

Link to comment
Share on other sites

If you need to write out the geo like that, it is also possible to write out sub-frames, and not only integer frames. I don't have time to explain that right now though, so it's something you could research if someone else doesn't pitch in :)

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