Implemented a Pressurized Soft Body model based on "Pressure Model of Soft Body Simulation" by Matyka et al, 2003. Added abiility to have local deformation by manipulating surface springs.
Feb 2008
Soft Body Physics
Pressurized Soft Body with Local Deformation
@ programming > simulations

In the game Cloud Guardian, I used a Pressurized Soft Body (PSB) implementation to create the balloon, which is the main object that the player will see and interact with. It is based on the paper “Pressure Model of Soft Body Simulation” by Matyka et al. published in SIGRAD 2003 and implemented using Microsoft XNA 2.0.

The basic idea is to pump a gas into the balloon to maintain its shape and volume. Surface springs are used to create surface tension on the skin of the balloon. Local deformation is achieved by adjusting the rest lengths of the surface springs.

Video showing the balloon in action, with local deformations

This is the first prototype of the balloon and is not the actual version used in the game due to lack of control by the player.

Back To Top Back To Top

Technical Details

Pressurized Soft Body
The mesh of the balloon is first obtained and a spring is placed at each of the polygonal edges. These springs are there to maintain the surface shape of the mesh but they are unable to maintain its volume. Thus a gas is “pumped” into the balloon so that the pressure of the air inside acts against the triangles of the mesh for it to hold its shape and volume.

The pressure is governed by the Ideal Gas Law as PV = nRT, where n is the number of moles of gas, R is the universal gas constant of 8.314, T is the temperature in Kelvin, and V is the volume of the balloon. By assuming that n and T are constant, an inversely proportional relationship between P and V is obtained. This relationship causes the balloon to retain its volume as it is interacted with external forces.

Since the force due to pressure is just another force acting on the vertices of the balloon, the standard simulation algorithm can still proceed as usual. The only extra thing to do is add the pressure forces on each vertex, as shown in the image below. The direction of the force acting on each vertex follows the face normal, while the magnitude is calculated as pressure divided by face area.

Direction of forces due to pressure acing on vertices of a quad
Direction of forces due to pressure acing on vertices of a quad

Local Deformation
The game required the player to change the shape of the balloon, thus I had to find some way to have local deformations, on top of the inflation/deflation of the entire balloon.

I predefined 6 regions on the balloon (arranged in a hexagonal fashion) where there are good topological flow of edges. Sets of bump edges and spike edges are marked manually. The rest length of these springs are increased or decreased to achieve local deformations.

Balloon with local deformations
Balloon with local deformations

Back To Top Back To Top

Problems and Workarounds

A recurring issue in physically-based simulations is that it is hard to find the right constants that will give the look that we are looking for. This phase usually involves a lot of trial and error to find the appropriate values to plug into the variables, failing which the simulation tends to move unrealistically or even “explode”.

Another problem faced was when I was trying to inflate/deflate the balloon. I tried to change a variety of attributes such as the volume of the balloon and the stiffness of the springs. These attributes tend to change the forces acting on the vertices and thus result in a different behavior in the mesh after the inflation/deflation has taken place. For example, increasing the stiffness of the springs will cause the balloon to “deflate” because the springs exert more force to pull the vertices closer together. However, this causes the balloon to vibrate faster when perturbed, which is changing the original behavior of the balloon.

After a considerable amount of testing, I found out that a stable inflation/deflation can take place by changing the rest lengths of the springs. Although not physically possible in real life, it works very well for our balloon simulation and it is the method that I used for the early prototypes of the game.

Back To Top Back To Top

Skeel Lee Skeel Lee
Facebook Google+ Twitter Tumblr
YouTube Vimeo Flickr Pinterest
Senior FX TD / R&D
Digital Domain 3.0 (Previously at Sony Pictures Imageworks, MPC, Industrial Light & Magic, Double Negative)
LinkedIn IMDb GitHub Stack Overflow
I am a Senior Technical Director with strong interests in both tech and art. My life evolves round VFX, photography, software engineering, tools programming and generally anything that looks / sounds cool.
I have done a variety of CG programming, including fluid sims, muscles, soft/rigid bodies, raytracing etc. These knowledge complement the visual works that I do as a TD in VFX.
I was interviewed by The Straits Times in May 2014 for my VFX work in X-Men: Days of Future Past.