Jump to content
Sign in to follow this  
Nick da Silva

Grain Sim with Collision Geo that has changing topology

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!

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Thanks so much! That's interesting. I've been using the collision source node to create my collision geo. Yours seems to work just fine with the primitive count changing even on sub frames.

Edited by Nick da Silva

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

Thanks David. Using the hou.frame() python expression I was able to write out the sub frames as well and it works great!

 

Really appreciate your help!

Edited by Nick da Silva

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×