I have a simple simulation where particles fall into a hopper. They are Physx shapes with a physx collider. Everything is working correctly, but the simulation is taking way too long. I am using Tyflow Pro and it froze after 150 frames (each frame near the end was taking over 1 hr to calculate). I have the birth set to a Total of 200k particles. I have researched online and it looks like there is a way to have Tyflow stop calculating for particles which have slowed to an almost stop using a property test (velocity Magnitude <.1). However, it needs to be that the particle stops after it's been below this threshold for a number of frames, and then stops and is no longer calculated. Not sure how to get this set up with the Physx Switch. Also, It seems like there is a way to use Collision groups in the PhysX Shape operator to move these non-moving particles to a group to be ignored as well? I just need a way to really speed this up (I export to a tycache currently). I cannot wait 16 hours for a sim!
Any help greatly appreciated as I am new to Tyflow.
(03-19-2026, 01:48 PM)kkinross Wrote: Not sure how to get this set up with the Physx Switch.
Just use one of the test operators to send particles to new event.
For example, you can use property test, chose velocity magnitude, set if it's less then 0,1 (so he sends every particle with really low speed or zero velocity)
Then create New event, put there a stop operator and a PhysX Switch set as deactivate.
I often like to use surface test (set to volume inside), and I just create some boxes or simple primitives, and whatever it's inside these primitives I sent to new event with stop and PhysX switch - deactivate.
Now.. deactivate in PhysX switch, means it will be completely ignored by the PhysX so keep in mind, if some other PhysX particles fall on top of them, they won't bounce of it... but the sim will run faster.
If you put a "kinematic", then they will just be static, but will still use PhysX solver so other particles will collide with them.
Hope that helps.
Thanks. Giving this a try. I saw this method online but it just wasn't working right since some of the particles were freezing a bit too early. I was trying to build in a time test as well, so if they are at a velocity magnitude of <0.1 over 10 frames, then Switch to kinematic (so they are not calculated, but are still rigid bodies for the ones falling on top of them). Not working quite yet.
Well.... when you switch them to kinematic... I wouldn't say they are not calculated... , they are just frozen (or inherit some animation), but still fully calculated.
I am not sure what's the difference speed in calculation is between dynamic and kinematic, if there's any at all.
Sure... try it out and write if something is not working (and share screenshot, or max file).
(03-23-2026, 05:05 PM)d4rk3lf Wrote: Well.... when you switch them to kinematic... I wouldn't say they are not calculated... , they are just frozen (or inherit some animation), but still fully calculated.
I am not sure what's the difference speed in calculation is between dynamic and kinematic, if there's any at all.
Sure... try it out and write if something is not working (and share screenshot, or max file).
Thanks. Just trying to speed this thing up. when I am trying to simulate over 200k Physx particles, it's take incredibly too long (even on our fast machines). Up against a client deadline, so a bit nervous and trying other ideas.
(03-23-2026, 05:34 PM)kkinross Wrote: (03-23-2026, 05:05 PM)d4rk3lf Wrote: Well.... when you switch them to kinematic... I wouldn't say they are not calculated... , they are just frozen (or inherit some animation), but still fully calculated.
I am not sure what's the difference speed in calculation is between dynamic and kinematic, if there's any at all.
Sure... try it out and write if something is not working (and share screenshot, or max file).
Thanks. Just trying to speed this thing up. when I am trying to simulate over 200k Physx particles, it's take incredibly too long (even on our fast machines). Up against a client deadline, so a bit nervous and trying other ideas.
Sure, I've been in these situations million times.
It's hard to give advice on how to optimize, without seeing what is being simulated.
You can always animate some mesh (or couple of boxes (primitives)), to cover majority of PhysX particles that you are positive it will not move at all any more, and NEIGHTER some PhysXparticle will hit it (or it needs to hold some particles).
Use Surface test (volume inside), add these animating boxes, connect to new event where you only have stop operator and PhysX Switch deactivate.
tyFlow used to have PhysX sleep/awake options, but sleeping/waking in the PhysX library doesn't really work for anything other than simple gravity sims - this became an issue years ago where users would experience bizarre particle behavior when using the sleep/wake options in tyFlow in many situations. I raised the issues with NVidia and they didn't really show any interest in fixing the issues...so instead I removed sleep/wake functionality in tyFlow to avoid confusion. Instead you can just use a PhysX Switch operator to make particles kinematic if they go below a certain velocity threshold, and/or wake them up by switching them to dynamic using the same method (also make sure you use a Stop or Slow operator to zero their velocity/spin after you freeze them). It's not ideal since it's not an automatic process, but it works.
(03-24-2026, 01:56 PM)tyFlow Wrote: tyFlow used to have PhysX sleep/awake options, but sleeping/waking in the PhysX library doesn't really work for anything other than simple gravity sims - this became an issue years ago where users would experience bizarre particle behavior when using the sleep/wake options in tyFlow in many situations. I raised the issues with NVidia and they didn't really show any interest in fixing the issues...so instead I removed sleep/wake functionality in tyFlow to avoid confusion. Instead you can just use a PhysX Switch operator to make particles kinematic if they go below a certain velocity threshold, and/or wake them up by switching them to dynamic using the same method (also make sure you use a Stop or Slow operator to zero their velocity/spin after you freeze them). It's not ideal since it's not an automatic process, but it works.
Thank you!
|