Particles Series 07 | TF - Move Particles with Forces

Hi all, 

In this video we see how to move our particles simulating real world physics from within the Transform Feedback shader. 

In order to do this we use the Second Law of Newton: F = m*a.
Where 'm' is the mass of the object (a single particle) and 'a' is the acceleration of that object.
If we consider the mass to be equal to 1 we can then say that the Force applied to an object is equal to how much that object accelerates (in a single frame).
If we sum together all the forces from the shader pass, we obtain the acceleration for the current frame.

We then sum the current acceleration to the velocity from the previous frame (iVelocity) and sum the result to the previous particle's position (iPosition).
We set the output velocity and position to the new values in order to keep the feedback loop.

Thank you for the support, see you soon!

Become a patron to

Unlock 248 exclusive posts
Be part of the community
Connect via private message