Using Cloth Simulation and Delta Mush Deformer for Skin Collision in Animation

Posted in Tips and tricks on 07 July 2016

I'd like to present the results of a study I conducted recently:

Story

Working on my animated short film, I'm constantly updating a to-do list to get a decent final result. Recently, one particular topic has been keeping me up at night — I just remembered that to correct skinning errors on animated characters you either have to sculpt a bunch of blend shapes, write scripts for them, or rely on a muscle system built into your DCC package.

I then turned to Maya, which has had a muscle system for ages.

Maya Muscle System

Maya provides several deformers for managing soft- and hard-tissue interactions, including smart-, self- and multi-object collisions. Even though they're not exactly high-performance, they get the job done.

Maya multi-object collision

Unfortunately, using any of Maya's Muscle System tools would tie me to a $185/month subscription for the whole duration of the project, which would be outrageous. There is a lite version of Maya available for indie game devs — Maya LT — which only costs $30 a month, but it doesn't come with the Muscle System.

Maya vs Maya LT comparison

So I had to improvise and develop a simple, straightforward solution to this problem in a DCC of my choice.

Basic Muscle Using a Cage or an Envelope

Alas, Softimage doesn't come with a built-in muscle system. The good news is that any object can be cage-deformed or skinned to any other object in Softimage, so creating "muscles" would be as simple as placing spheres and capsules around the rig, parenting or constraining them to bones, and adding a cage deformer on top of a skin envelope. Then all you do is animate the shapes of those muscles based on bone positions or rotations.

Cumbersome, but doable.

You can then take it further and add a dynamic jiggle to your muscle objects using ICE Verlet Integration.

Cage deformed torus

It doesn't handle collisions between the muscles and the skin, though. Muscles deform on collision in real life, and since they also have skin attached to them you get skin collision management "for free." So we need to figure out how to make those muscles collide with the rest of the rig.

Softimage ICE

Anyone familiar with Softimage ICE would say, "Just use ICE to do this." Unfortunately, I'm no Technical Director, and my knowledge of ICE is limited. It would take me quite a while to build an ICE tree that manages collisions between objects the way Maya's Muscle System does. Hell, even when you look through Softimage ICE sample scenes, the only solution that comes close to doing this is bi-directional mesh-to-mesh deformation (or dent). It doesn't use normals to calculate point positions and requires you to explicitly specify the axes along which the object should deform.

bi-directional ice deformation

I do believe it's possible with the help of Verlet Integration, but recreating something as complex as Maya's Muscle System in ICE or Fabric Engine is a project unto itself — and not an option in my case.

After a bit of digging, I did discover a free ICE-powered muscle system called VorleX Muscle available for Softimage. I gave it a try. While it's powerful, the only type of collision it supported was unidirectional muscle-object deformation — colliders didn't deform, only the muscle did. So no muscle-to-muscle deformations here either...

Soft Body Simulation

Another way to achieve artist-directed collisions is to add soft-body dynamics on top of an existing object's animation, which — believe it or not — is perfectly possible in Softimage if you're willing to bite the bullet and use the legacy toolset. There's an article on the Softimage wiki explaining how to do it.

This method has some serious drawbacks, though:

  • Legacy animations are single-threaded.
  • Animation-driven bi-directional interaction between two soft bodies is notoriously difficult to set up, and even if you manage to do it, you'll get strange behavior when the soft bodies actually collide.
  • I find legacy soft body simulation not very flexible (get it?) when it comes to body properties. Specifically, there's no way to add an internal pressure–like force, which is a problem when one soft body squashes the other like a wobbly rubber ball. You simply can't build a believable muscle like that.
  • Legacy simulations can be and often are quite unstable. And that's frustrating as hell.

Softimage legacy soft body simulation

To sum up: I tried this method and failed miserably. I'm not touching the XSI legacy simulation system ever again.

Blend Shapes

Well, when all else fails, the last resort is to sculpt blend shapes and interpolate between them. It's tedious and requires a bit of scripting. Besides, you would have to do it for each character separately. If you have a team of artists, it's fine. But if you're solo and have a deadline looming, or simply can't afford to spend too much time on the project — things get ugly.

Another Way

After all those failed attempts, I thought to myself: "If creating object-to-object deformations is so complicated and sculpting blend shapes is so time-consuming, why not look for another way?" Like something that would do this for you automatically (more or less) and still produce a decent result.

I got to work and, after a series of experiments, finally managed to develop a method that lets you create somewhat believable skin collisions for animation — one that's very easy to set up and use: a combination of cloth simulation and a Delta Mush deformer.

Cloth Skin Simulation

The idea of using cloth simulation for skin is anything but new. Syflex devs posted a tutorial on how to do this over a decade ago.

Syflex cloth skin

What they didn't cover in the tutorial, though, was self-collisions — and for good reason: used this way, they'd often cause serious simulation flickering at collider intersections.

cloth skin collision intersections and flickering

You could, of course, fix this with a basic Smooth deformer, but the amount of smoothing needed to get rid of those flickers would obliterate any (if not all) surface detail on your mesh.

Mush It up

Back in 2014, guys from Rhythm & Hues Studios presented their proprietary deformer at SIGGRAPH. They called it "Delta Mush".

In a nutshell: local mesh detail (the per-point offset between each vertex and its position on a smoothed copy of the original mesh) is precomputed and stored. Then the "to-be-fixed" deformer is applied, and right after that the mesh gets smoothed again using the same algorithm. This wipes away all newly introduced surface changes, including any unwanted artifacts from the deformer. Finally, the stored offsets are reapplied, restoring the original surface detail.

You can get the paper here.

And here's the presentation:

As you can see, this is exactly what we need to fix simulation flickering. They actually show it in the video above. Shocking!

Even better: there's not one, but two Delta Mush implementations for Softimage — one by Miquel Campos (a purely ICE-powered set of compounds) and Guillaume Baratte's C++ implementation, which is much faster and lets you attenuate the effect with a weightmap. Thanks guys!

Moreover, the Syflex cloth engine built into Softimage works like this: when cloth gets pinched between two objects, it still tries to avoid self-intersections, as long as you strike the right balance between the friction value on the colliding objects (the base envelope, for example) and the one on the self-collision node. Those are just force nodes after all.

XSI ICE Syflex cloth collision nodes

Armed with these tools, I set out to experiment and, after a series of attempts, managed to more or less achieve what I'd been looking for: automated, full-body self-collision handling for soft-tissue envelopes.

Does It Work?

Judge for yourself.

Granted, the result isn't perfect (most automated things in 3D rarely are) but it's fast to set up, and chances are viewers won't even notice that the collisions aren't physically accurate. Hell, you can almost get away with a simple quaternion envelope with no corrective shapes as a base for the simulation, as long as you don't approach extreme bone angles. That way you won't have to mess with muscles or corrective blend shapes for envelope collisions, which is good, especially when working on background characters.

This method hasn't been production-tested yet, but when the time comes, I'll definitely integrate it into my character pipeline and share the results.

To Summarize

The method has its pros and cons, like most things in life.

The good:

  • Quick and easy to set up.
  • Works on any soft-tissue deforming object and calculates collisions across the whole mesh.
  • Can serve as a base for quickly creating blend shapes. For example, you could use this method to create one blend shape with extreme poses for all joints, then divide it into clusters that are driven by the appropriate joints — or drive different areas of the blend shape using a weightmap.
  • Not too slow to solve, even for the whole body (the example mesh I used in the video solves at about 0.3–0.5 fps with all collisions and the Delta Mush deformer active).
  • The denser the mesh, the better the deformation quality (well, duh!).

The bad:

  • Solve speed depends heavily on the density of the mesh (as with any cloth or soft-body simulation). The smoother you want the simulation, the higher you have to set the damping value, which can considerably increase the number of required computations.
  • This method isn't (in theory) suitable for extreme close-ups because of how the simulated cloth unwraps and relaxes after extreme poses. You can actually notice this in the video — look for slight skin jittering under the armpit as the arm joint rotates back to its bind pose. In most cases, you'll only see it if you're looking at the actual mesh in the viewport, but on characters with tattoos you might get some warping and jittering of the skin textures.
  • Regions with extremely high local polygon density can be a problem. For example, this method won't work for fingers or the face because their local mesh density is much higher than that of the rest of the body. So you'll need to solve the body separately from the head, hands, and feet, then merge them back together for seamless whole-body smoothing before rendering.
  • To compensate for the mesh volume loss caused by the Delta Mush deformer, you will need to paint a weightmap or two. You might also need to pin the cloth skin to your envelope here and there to make sure the simmed skin doesn't get too far from the original skinned mesh during simulation. Not a big con, but it's there.

delta mush weightmap

syflex pin point cluster

What's Next

For now, I'm happy with the results and will move on to other tasks and studies that should ultimately lead to a finished animated piece.

What do you think of this method? Any thoughts, advice, or criticism would be appreciated.