Title
Soft Body Dynamics on the GPU using Shells
Abstract
The representation of deformable objects is a physics based animation topic employed in the fields of computational surgery and video games. This project's simulation is built with a particle system in which its elements are coupled through unidimensional elastic constraints. The result is aesthetically plausible, computationally suitable for interactive 3D environments and has been redesigned for massive parallel exploitation on the GPU achieving speedup.
Resources
IDE | Visual Studio 2013 |
Language | C / C++ |
Framework / Libraries/ API | OpenGl, GLM, CUDA |
GPU Debugging Tool | Nsight |
Thesis Word Processor | Latex |
Version Control | Git |
Methodology
Firstly, a 3D model file is loaded and every vertex is stored as a particle. Subsequently, layers of particles are projected in 3D using the surface vertex normals. An optimised network of springs and particles is then generated procedurally. The simulation runs through three phases in which the forces exerted to each particle are added up, then, the new positions of the particles are calculated and further corrected in base of the influence of springs and spacial boundaries.
A Mass-Spring Network
The mass-spring approach is a physics based architecture in which particles of an arbitrary mass are coupled using springs. Both simplicity and low cost make the mas-spring model very suitable for real-time applications. The evolution of the particle system is typically found by accumulating the internal and external forces (i.e. springs, damping, gravity and wind) and obtaining an acceleration through Newton's second law of motion. Nonetheless, manipulating directly the particle positions is more practical than applying forces (or impulses). For instance, Distance Constraints (high level abstraction of a spring) do not operate with forces. Instead, every update cycle, each constraint compares its current magnitude against its repose length and diminishes gradually the difference.
The Verlet Integration and the Position Based Approach
The core component of the soft body simulation is the particle system. The velocity-less Verlet integration offers the advantages of the Position Based approach. These have been exploited in three stages; Firstly, constraints are satisfied by gradually correcting the position of its two ends during the update cycle. Secondly, collisions are solved by projecting the intersecting vertexes to valid locations. Finally, particles can be clamped in a space location or attached to other objects.
Shells
A shell based soft body is constructed by projecting concentric layers of particles from the surface to the inner part of the model. The number of shells and distance between them is determined by the plausibility of the simulation once the soft body has been constructed.
|
|
The particles of each shell are then connected with elastic constraints following the 'structural, shear, bend' springs scheme employed traditionally to simulate cloth in real-time.
Coupling every shell to each other is a matter of shifting the index connections of one layer to every other shell. Objects built through this technique can be configured to achieve the desired relation of rigidity, realism and computational cost being also stable in large time steps.
GPU Design
The technique has been engineered for massive parallel exploitation migrating from an object oriented design to a collection of buffers stored on the GPU. In the parallel design, all the individual springs that a determined particle is a member of are transformed into a single list of nodes; the Adjacency List. Each particle is now responsible to satisfy its share of the constraint looping through every node of its own Adjacency List. With the new algorithm adapted for GPU computation a thread can be launched for each particle.
Collision Detection
Determining and solving the intersection of two deformable bodies is challenging, as firstly, it is a bottleneck in real-time simulations and secondly, concave angles require the implementation of very sophisticated techniques. The exploration completed in this project covers popular techniques for the narrow phase such as the Plane Equation and the Separation of Axis Theorem (SAT) as well as for the broad phase with the implementation of a Sphere-Tree. When two objects collide, the reciprocal interaction between them is achieved by solving the collision progressively. Despite the fact that the last version implemented is not sufficiently advanced to feature concave angles, the result obtained is enough to remove the concerns over whether the feedback of a shell towards the surface damages the collision detection process.
Results
Shell based soft bodies have been implemented successfully on CPU and GPU providing a set of parameters to adjust the relation between rigidity, realism, computational cost and time step. These parameters are spring stiffness, number of shells, size of the relaxation loop and distance between consecutive shells. The GPU speedup scales with the data set. However, the performance benefit has a starting point threshold that has also been identified. Finally, collisions have been solved between two shell-based soft bodies, proving that there is no interference between the simulation and the collision detection process.
gpu_softbodies_poster.pdf | |
File Size: | 1375 kb |
File Type: |