WebGPU Cloth Simulation 02 - Real-time Cloth Physics Simulation Techniques (PBD, XPBD, Small Steps)

Position-based Cloth Simulation Techniques (PBD, XPBD, Small Steps)

https://matthias-research.github.io/pages/

1. Traditional Simulation Approaches (Particle System)

The traditional approach to simulating dynamic objects has been to work with forces. At the beginning of each time step, internal and external forces are accumulated.

Newton’s second law of motion relates forces to accelerations via the mass. So using the density or lumped masses of vertices, the forces are transformed into accelerations.

Newton’s second law of motion relates forces to accelerations via the mass. So using the density or lumped masses of vertices, the forces are transformed into accelerations. Any time integration scheme can then be used to first compute the velocities from the accelerations and then the positions from the velocities.

However, in computer graphics and especially in computer games it is often desirable to have direct control over positions of objects or vertices of a mesh because:

    - Direct control over object positions allows developers to ensure that gameplay feels responsive and actions are precise.

    - Direct manipulation of objects ensures that these sequences play out exactly as intended, regardless of any underlying physics simulations.

    - Direct control can be used to resolve collisions predictably by adjusting positions to avoid interpenetration or to enact specific collision outcomes like a character being pushed back or an object breaking.

    - In some cases, especially with numerous objects or complex interactions, using direct position control can be a more performance-efficient approach than running a full physics simulation.


2. Position-Based Dynamics (PBD) - Matthias Muller (Nvidia), 2006

PBD works directly on positions which makes such manipulations easy. In addition, with the position based approach it is possible to control the integration directly thereby avoiding overshooting and energy gain problems in connection with explicit integration. 
Advantages:

    - Position based simulation gives control over explicit integration and removes the typical instability problems.

    - Positions of vertices and parts of objects can directly be manipulated during the simulation.

    - The formulation we propose allows the handling of general constraints in the position based setting.

    - The explicit position based solver is easy to understand and implement

Reference: https://matthias-research.github.io/pages/publications/posBasedDyn.pdf


3. Extended Position-based Dynamics (XPBD) - Matthias Muller (Nvidia), 2016

Limitations of PBD:

 - Behavior is dependent on the time step and iteration count of the simulation. Specifically, constraints become arbitrarily stiff as the iteration count increases, or as the time step decreases.

 - This coupling of parameters is particularly problematic when creating scenes with a variety of material types. Raising iteration counts to obtain stiffness on one object may inadvertently change the behavior of all other objects in the simulation.

 - PBD does not have a well defined concept of constraint force, and as such it has mostly been limited to applications where accuracy is less important than speed, and where simulations are secondary effects.


XPBD addresses the problems of iteration and time step dependent stiffness by introducing a new constraint formulation that corresponds to a well-defined concept of elastic potential energy.

Reference: https://matthias-research.github.io/pages/publications/XPBD.pdf


4. Small Steps in Physics Simulation - Nvidia, 2019

Perform a single large time step with n constraint solver iterations is less effective than computing n smaller time steps, each with a single constraint solver iteration. Based on this observation, the Small Steps approach is invented to split every visual time step into n sub-steps of length Δt/n and to perform a single iteration of extended position-based dynamics (XPBD) in each such sub-step.

Result:

    - When compared to a traditional implicit integrator with large time steps we find constraint error and damping are significantly reduced.

    - When compared to an explicit integrator we find that our method is more stable and robust for a wider range of stiffness parameters.

    - This result holds even when compared against more sophisticated implicit solvers based on Krylov methods.

Example: High resolution cloth consisting of 150k particles, and 896k spring constraints draped over a Stanford bunny. With 1 sub-step and 30 XPBD iterations the simulation takes 12.4ms/frame but shows visible stretching (left). With 30 sub-steps, each performing only 1 XPBD iteration the simulation takes 13.5ms/frame but shows significantly less stretching and higher material stiffness (right). In both cases we have performed collision detection once per-frame.

Reference: https://matthias-research.github.io/pages/publications/smallsteps.pdf





Comments