Developing a new particle system

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Developing a new particle system

Postby Leadwerks » Tue Jan 21, 2020 6:39 am

I am setting out on the particle system of our new engine and I am not sure whether I should implement our own system based on raycasting or whether I should use Newton bodies. Here are the features I want:
[list=][*]Realistic collision with the world.
[*]Particle repulsion and attraction / cohesion (like liquids).
[*]Particle updates distributed over large number of cores.
[*]As realistic behavior as possible, using real values and scientific equations whenever possible.
[/list]

Would Newton physics be right for this, or should I build my own system and just send the collisions to Newton as impulses/ to add to physics bodies?
User avatar
Leadwerks
 
Posts: 539
Joined: Fri Oct 27, 2006 2:54 pm

Re: Developing a new particle system

Postby Leadwerks » Fri Jan 24, 2020 9:56 am

I decided to tie it closely to Newton. Here's what I did.
1. For each emitter, create a list of collideable Newton bodies that intersect the particle field bounds.
2. Split the particles up per emitter into the number of threads.
3. Launch all threads to update a some the particles.
4. In each thread, update each particle and test collision against the list of bodies for that emitter.
5. Wait for threads to finish.
6. Apply forces to all collided Newton bodies.

I also implemented a system to handle particle/particle repulsion and cohesion by entering all particles into a grid structure at the end of a frame and using that in the next frame to find neighboring particles. However, I have not yet figured out a good equation to get realistic behavior and this will need more work.

The initial results look quite good. Speed is much faster than I was expecting, with 4000 particles processing in 2 milliseconds on one thread. With more CPU cores you could definitely process a lot of particles, probably so many that the renderer would start to become the bottleneck.

User avatar
Leadwerks
 
Posts: 539
Joined: Fri Oct 27, 2006 2:54 pm

Re: Developing a new particle system

Postby Leadwerks » Fri Jan 24, 2020 10:04 am

Here's some slower-moving smoke-like particles:
User avatar
Leadwerks
 
Posts: 539
Joined: Fri Oct 27, 2006 2:54 pm

Re: Developing a new particle system

Postby Julio Jerez » Fri Jan 24, 2020 11:11 am

It is good you are trying your own solution. do not wait for us.

The idea of particle for physic is not exactly what people mean for graphics.
a particle in Newton is a Body that has mass but the inertial is infinite.
They make for a great number of simplifications.
a-it can only collide at one contact point at the center.
b-joints are only three dof at most.
c-the collision is point vs anything which makes generation by massive parallel functions.
c-the mass matrix is a 3x3 instead of 6 x 6 making up 4 time faster to calculate, and 8 time faster to resolve.

I just release 3.14 final and start 3.15
for 3.15 the the priorities are:

1-Get the HPC high performance computing solver translated to actual GPU.
I just finish the prototype of the solver.
this is a big deal, because the solver has to be 100% generic.
By Generic I mean it has to deal with rigid bodies contacts, bilateral joints, and particles bodies.
is does already rigid bodies contacts and bilateral joints, particle is a trivial to add.

2-complete some of the unfinished demos, The multibody vehicle, the full kinematic animated player and the self balancing biped. also adding Dave contribution of Ray cast / convex cast car.

3- adding the new dNewtonParticle Body. which will complement the iteration of the HPC solver.

in the pass I made few unrelated attend at particles. cloth, soft bodies and even fluid, but it always hit a road block when is time to integrated with the rest of rigid body solver.
this time I start by the basics, the particles entity will be defined and the type of joint that can connect them.
this will be all completed before we start tacking of special setup like: spring mass connected bodies, fluid, cloth or mesh less soft bodies.

this is a year round plan.
I am working on part one now.
Julio Jerez
Moderator
Moderator
 
Posts: 11155
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Developing a new particle system

Postby misho » Fri Jan 24, 2020 4:07 pm

Julio, awesome stuff. When ready, I will implement this for my rocket launch smoke effects, the way it is channeled through infrastructure away from the launch pad and such, also, perhaps all the water noise suppression system, actual rocket plume vapor, etc... :wink:
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 568
Joined: Tue May 04, 2010 10:13 am

Re: Developing a new particle system

Postby Leadwerks » Sun Jan 26, 2020 10:50 am

I think that is a smart approach. With the way CPU core counts are increasing, I think there will be a lot of opportunity for you here. People will be interested in seeing deeper physics interactions, and AMD and Intel will both be interested in showing off advanced particle physics without the need for an Nvidia GPU.
User avatar
Leadwerks
 
Posts: 539
Joined: Fri Oct 27, 2006 2:54 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron