optimize collisions in a particle system

julienrobert's icon

I need to do a particle system with about 800 spheres. The patch runs quite well while collisions are off (55 fps), but I soon as I turn it on, it slows quite a lot (13 fps).

I need to optimize my patch to make it run smoothly.

I don't need to detect the collisions between each sphere, I just need the collisions between the spheres and the 3 walls. Is there a way to avoid the patch to calculate the collisions between the spheres of the jit.phys.multiple? It would save a lot of CPU I guess...

Max Patch
Copy patch and select New From Clipboard in Max.

cheers

My system: Max 6.1.6, iatkos 10.8.5, Intel Core i7 3770K 3.50GHz Quad-Core,VGA GeForce GTX670 FTW 4GB GDDR5

diablodale's icon

try using the @filterclass and @filters attributes. You can control what physics bodies participate in collision calculations. See reference for details.

julienrobert's icon

thank you Diabodale

Actually, I though I needed that option, but it is not solving my problem since I still need the spheres to bounce between them. I just don't need the collisions information about them colliding between them. So, I guess, I'm going to need to look to another way to do it as you suggested me in that post… https://cycling74.com/forums/particles-ofprocessing-vs-max6