Particles passing through animated collider

   1057   10   0
User Avatar
Member
56 posts
Joined: March 2022
Offline
Hello,

I've created a basic scene to show the problem I'm having. When static, the collider works just fine. When animated, the collider seems to not work at all. I saw a post about this with a flip sim that said I should compute velocity and increase substeps to help with an animated collider but this didn't work for my scene. The particles are still escaping.

I'm sure there is a simple fix for this. Please let me know!


Cheers,

Attachments:
Collision_Results.mp4 (10.1 MB)
Particles_Moving_Collider.hiplc (516.6 KB)

User Avatar
Member
2537 posts
Joined: June 2008
Offline
Sometimes it is easier to just give your collider some thickness than trying to solve the math with substeps that will slow down your simulation.
Edited by Enivob - Dec. 18, 2023 17:24:50

Attachments:
particle_moving_collider.gif (211.4 KB)
ap_Particles_Moving_Collider.hiplc (521.1 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
56 posts
Joined: March 2022
Offline
Hi Evivob!

Thanks for looking into this for me. In the file you provided it looks like the particles are being spawned onto the inner surface of the collider rather than inside it and bouncing off it. I'd say this is from the "Invert Sign" setting which I believe should be off when the collider has thickness.


See my example here where I've added thickness and turned off Invert Sign. I really need the particle sim to look like this but have the particles stay inside the collider.
Edited by R_Stewart - Dec. 18, 2023 19:03:25

Attachments:
Thick_Collider_Results.mp4 (1.1 MB)

User Avatar
Member
46 posts
Joined: April 2016
Offline
Hi,
control Min Substeps ans Max Substeps on POP Solver. I also changed Division Method parameter to By Size on Static Object dop and set Division Size - 0.01, set relative reference from this value to Voxel Size on vdbfrompolygons1, DOP Network substeps - 1.
It works now.

Attachments:
Particles_Moving_Collider_01.hipnc (519.1 KB)

User Avatar
Member
8555 posts
Joined: July 2007
Offline
since you are not using FLIP, there is no need for volume collisions, especially if that means rebuilding them every substep
just use surface collisions and no substeps

Attachments:
Particles_Moving_Collider_fix.hipnc (517.5 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
56 posts
Joined: March 2022
Offline
Ah Tamte! This is working perfectly on the test file and on my more complicated project file.

Thanks again you are the master!
User Avatar
Member
56 posts
Joined: March 2022
Offline
Sorry I spoke too soon. In my project the particles are passing through the mesh.

Is there anytyhing I can do to make the collider more accurate? I think the mesh is moving quite fast, shaking around actually. Also there is a smoke force advecting the particles.

Let me know any tips on this.

Thanks!
User Avatar
Member
56 posts
Joined: March 2022
Offline
Hi Tamte,

I've uploaded a simple scene to match my project here. [drive.google.com]

If you have time please take a look and let me know how to keep these particles inside the collider. There is an .abc for the dancer which is the collider object.

Thank you sir!


RS
User Avatar
Member
8555 posts
Joined: July 2007
Offline
the default particle radius for collision is 0.02 if you don't specify f@pscale, which you didn't
in your scene that's quite large, thicker than a finger

the first particles that leave the collider are from the chin, just because the inner mouth geo pushes on them from inside against the chin so something has to give

then they naturally escape through other parts when they get squeezed or pinched by geo smaller than the particle

so first of all add POP Property, enable Uniform Scale and set to smaller number like 0.002 or 0.001
then you can display particles as lit spheres or disc to see their scale

you will still get escaped particles especially through fingers as at some frames the fingers go through each other so if there are any particles they may be trapped and pushed out
so its important that your collider doesn't have penetrations and ideally no thin parts like folded eyelids etc, so you will need to create a better collision geo and cleanup the intersecting part of the anim if you want to rely on swept collision that surface collision method uses
also try not to subdivide your geo, its reasonably dense as is for detail it has so subdividing just unnecessarily slows it down


you can of course have additional wrangle that pushes particles inside of the collider's SDF, but for that you would again need to pay the price of generating SDF every frame, which you can of course cache
so if you can't cleanup your collision geo and animation that can be an option
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
117 posts
Joined: Aug. 2017
Offline
You need something Like This or?
You can isolate any group to name and bind in Code ,experiment with Code , use any pop Nodes ..



sep

vector avg ;
int pts[] = nearpoints(0,@P,0.1);

foreach(int pt;pts){
    vector nearpos = point(0,'P',pt);
    vector d = @P-nearpos;
    float dist = length(d);
    dist = fit(dist,0,0.1,1,0);
    avg += normalize(d)*dist*dist;
    }
//@v = 3 *avg/len(pts);
//@P += @v *@TimeInc;
//@v = 0;

project
int prim ;vector uv;
xyzdist(1,'@name=gh',@P, prim,uv);
vector  nml = normalize(prim_normal(1,prim,uv));
v@nn = nml;

@v += (@force)*@TimeInc;

@v -= dot(@v,nml)*nml;
//@v -= rand(@ptnum)*@v;

@P += @v*@TimeInc;
vector v = primuv(1,'v',prim,uv);
@P += v/24.0;
vector pos1 = minpos(1,'@name=gh',@P);

@P = lerp(pos1,@P,ch('k'));

Attachments:
Het2fgddsda.gif (3.2 MB)
vg.jpg (68.2 KB)

Conservation of Momentum
User Avatar
Member
56 posts
Joined: March 2022
Offline
@Tomas Thank you so much. I wasn't able to fully contain all of the particles but I simply deleted any particles that left the mass of the dancer. I was able to achieve the result I was after.

@cncverkstad that's another level! I do need to learn more VEX.
  • Quick Links