Simulation Topics

Physically Based Simulation

At its core, Ziva VFX is a physically based simulator. As input, it takes a complete description of the physical setup of the scene, such as materials, tissue volumes, bone motion, attachments between objects, gravity, etc. This is what you must provide when setting up a scene with Ziva VFX. From that input, it computes the motion of tissues and cloth based on the laws of physics. This is a fully-coupled interaction of all properties of the system at once.

Technical Details

The elastic materials are modelled with the finite element methods (FEM). For a more technical introduction to FEM, see http://www.femdefo.org.

The solver uses implicit time integration with all force terms formulated implicitly. Implicit integration can handle stiff materials and attachments with large timesteps. Large deformations and nonlinear materials are supported. The solver supports simulating: (1) deformable dynamics of soft tissues and (2) quasi-statics. More information is available in the Integrators section.

Simulation Objects

Bones

Bones are externally animated Maya meshes of any geometry and purpose. The Ziva solver does not simulate the bones or modify their motion in any way. The bones may deform and/or be animated using any Maya technique. The “bone” surfaces are not restricted to represent biological bones, but can be the result of any transformation or deformation in your Maya session (skin cluster, keyframe animation, loaded from an Alembic bake, or any Maya deformer).

One common use is to import bones from a previously baked simulation run. This makes it possible, say, to bake the result of a previous simulation as a deformable “bone”, and then constrain the next simulation layer to it, using Attachments. In this way, one can progressively generate an animation, by layering the muscles, fat, skin, etc. Each of these layers can be a separate solve, with the result of the previous layer treated as a deformable bone for the next layer.

Cloth

Cloth models thin objects - such as sheets, cloth and membranes - with a triangle mesh, and is simulated using the Ziva solver. It is suitable for simulation of fascia and skin, but may not be appropriate for clothing because it lacks a self-collision model.

Tissue

Tissues are three-dimensional solid deformable objects. They can be used to simulate biological solids (such as muscles, fat, or skin), as well as non-biological materials (such as jello, rubber tires, foam blocks, and steel beams). Since version 1.4, tissues support rest scale and pressure (see Cloth above).

Subtissues

A subtissue defines material properties, muscle fibers, and attachments within another tissue. A subtissue does not appear as its own tet mesh in the physical simulation. This can be useful for a few different applications. The right way to think of subtissues are as an inclusion in the parent tissue.

While material properties are normally smoothly interpolated through the volume of a tissue, one can use a subtissue to specify a discontinuous change in material properties. For example, one use of subtissues is to specify material properties within the interior of a mesh, such as creating a stiff knot in the middle of a muscle.

Subtissues can also be used to model muscles embedded in passive tissue. For example, an entire arm could be simulated as a single tissue, with the individual muscles acting as subtissues. Their contractions and different stiffnesses will affect the single parent tissue without simulating separate tet meshes.

Subtissues can be used to group together adjacent muscles into a single simulation object. This could provide a performance improvement if it uses fewer tets. It could also make rigging easier, as collisions and attachments between these muscles do not need to be setup. Since they are in the same object, that is all implicit. They will not slide relative to each other or penetrate.

Attachments

The tissues, cloth, and bones can be connected (constrained) to each other with attachments. Any type of object can be attached to any other type of object, with the exception of bones to other bones. Bone-to-bone attachments are not included because bones are not simulated by Ziva VFX, and hence such attachments would have no effect. Each attachment can be fixed (pinned) or sliding (free to move over a surface).

When attaching between two bodies, the order matters. The first object is the source and the second object is the target. When an attachment is created between two bodies, the vertices of the source object “reach out” to the target object and attach to the closest point on the target.

The damping attribute controls how much the attachment between two bodies can oscillate. Zero damping creates no damping force for an attachment, allowing it to oscillate. A non-zero damping results in the damping force decaying the oscillation of an attachment, which in turn helps the connected tissue reach equilibrium quicker.

The stiffness attribute controls how much the attachment between the bodies can stretch. The stiffness can be further attenuated by painting the attachment weight between 0-1 on the source mesh. For sliding attachments, painting on the target mesh controls where the attachment is allowed to slide. It will not slide to an area painted with zero weight.

In practice, one often wants to attach a set of model vertices to another model. This can be achieved by painting an attachment weight of 1 at these vertices and a 0 weight at all the other vertices. In order to facilitate this process, the user can select the vertices using the Maya UI, select the other object, and create an attachment. The attachment weights will be painted automatically.

A demonstration of attachments is available in the Built-in Demos under Attachments.

Goaling Attachments

Goaling attachments exist to make a mesh “A” follow an arbitrary animation of a goal mesh “B” with the same mesh connectivity. The motion of the goaling mesh “A” is solved with the Ziva solver.

Typically, the animation for the goal mesh “B” will be generated by artists using any Maya technique; for example, keyframe animation or standard skinning. The Ziva goaling attachment is then used to add physics to the animation of the goal mesh “A”, providing a compromise between physics and artist directability.

The goaling mesh A must be a Ziva tissue, and the goal mesh B must be a Ziva bone. The two meshes must have the same number of vertices, ordered in the same way. The strength of the goaling can be adjusted using the zGoalAttachment.strength attribute, which adjusts the tradeoff between following physics versus the goaled bone motion. This attribute can be painted spatially, making it possible to turn off goaling in selected regions, or weaken/strengthen it arbitrarily.

A demonstration of goaling is available in the Built-in Demos under “Goaling, Self-Collisions, Ziva Cache and Spatially-Varying Materials” (which demos a fish).

Collisions

To enable collisions, there is a collisionDetection attribute on the zSolver node. There are also per-body collision attributes on the zTissue, zCloth, and the zBone nodes. Like attachments, collision response can be fixed or sliding.

Two bodies can only collide if at least one of them has collisionVolume turned on. Unless a mesh is closed and watertight, the collisionVolume attribute doesn’t make sense and shouldn’t be turned on. If it is turned on for a non-watertight mesh, it might not work properly.

When two bodies collide, the effective collision stiffness is a blend between the setting from the two objects. When a sliding contact interacts with a fixed contact; the interaction will be “fixed”.

Collisions are processed on a per vetex basis, the vertices of the collision mesh test to see if they have collided with any triangle of other meshes. Contacts are persistent. Once a collision has been detected, a contact is created. This contact will remain until the penetrating vertex exits the geometry from the side it came in.

The simulation performs an initial penetration test before running the first frame of simulation. Vertices found to be penetrating collision geometry will have contacts created for them as if they had previously collided with that geometry. This prevents small initial penetrations from being ignored by the collision detection system. Initial penetration detection creates contacts by finding the closest point on the collision geometry to the penetrating vertex. This means that very deep initial penetrations or vertices penetrating very thin tissues could result in erroneous initial contacts.

If the collision mesh is coarse, it is possible for triangle edges to visibly pass through each other without any vertex hitting a triangle. This can be remedied by enabling Collision Subdivision. Doing so will create additional collision testing points along the edges of the triangles of the collision mesh. The collisionPointSpacing attribute controls the maximum distance between collision points along a triangle edge. Collision Subdivision data is pre-computed at the start of the sim. As a consequence, the CollisionsPointSpacing attribute is not keyable. Be aware that setting this parameter too small can easily generate a tremendous number of points, which will slow the solver down significantly.

Contacts can be rendered in the Maya viewport, so the collision spacing can be seen. In order to visualize contacts in the viewport you need to set showCollisions to “contacts” and select the tissue or bone you want to see collisions for. Selecting the zSolver node will show all contacts in the simulation.

landmark map, collision point spacing

without subdivision, two cubes are allowed to penetrate since no vertices of either mesh intersect with any triangles of the other. With subdivision turned on, points are added along the edges of the triangles and the two cubes collide properly.

It is possible for parts of a tissue to get snagged by another collision mesh. Setting the maxContactLength attribute in the zSolver node to any value other than zero will cause any penetration contact of more than the specified length to be removed from the simulation. this tool allows users to remove potentially undesirable contacts from their simulation. If maxContactLength is set to zero, all contacts will remain until they are properly resolved by the simulation.

A demonstration of collisions is available in the Built-in Demos under “Self-Collisions, Ziva Cache and Delaunay Tet Mesher” and “Collisions.”

Integrators

Since v1.5, Ziva VFX supports multiple numerical integration schemes to evolve the state of elastic bodies from the current to the next timestep. The integrator choice is controlled by the integrator attribute on the zSolver node. The choices differ in the trade-off between stability and ability to compute accurate dynamics (such as wave propagation, oscillation, bouncing and jiggliness).

There are four supported integrators:

  • BackwardEuler: The implicit Backward Euler is a stable integrator that generates very little dynamics. This was the integrator used in Ziva VFX versions prior to v1.5, and is the default integrator. Sometimes it is called BDF1 in numerical math literature. Use this integrator if you need stability, and are willing to compromise on having accurate, lively soft body dynamics.


  • BDF2: This is a second-order accurate integrator that gives good stability and much more dynamics than BackwardEuler. BDF2 stands for “Backward Difference Formula of Order 2”. Use BDF2 in any situation where you want good dynamics. Although BackwardEuler can in principle progressively generate more dynamics (i.e., more secondary motion) as the number of substeps is increased (controlled by zSolver.substeps), this quickly becomes computationally very expensive. For a fixed computational budget, BDF2 generates much more dynamics than BackwardEuler. While testing on complex creatures, it was observed that BDF2 can generate the same amount of dynamics (meaning, visually similar dynamic effects) as BackwardEuler with half of the computation time. This gain can be very significant for creatures whose tissues are expected to jiggle and oscillate.


  • TR-BDF2: This is a predictor-corrector integrator popularized in papers by Prof. Klaus-Jurgen Bathe from MIT. It is a hybrid scheme that combines an energy-preserving scheme (implicit Newmark; also called the “trapezoid method”, hence “TR”) and BDF2. This integrator gives even more dynamics than BDF2, at the cost of some stability. In some tests, better generation of fat creases and folding was observed when using TR-BDF2 as compared to BDF2, for the same computational budget.


  • QuasiStatic: with this integrator, bodies have no momentum and remain in a state of elastic equilibrium as dictated by the attachments, collisions and gravity. Bodies will bend or stretch, but will have no dynamics. This integrator is useful in situations where dynamics is not desirable; for example, to generate blendshape targets.

    Note

    The quasi-static integrator requires that the creature is attached to bones, so that the static equilibrium can be meaningfully defined and computed. Suppose you have, for example, a scene with a single tissue that is not attached to anything in the scene. Then, under BackwardEuler, BDF2 and TR-BDF2, the tissue will fall under gravity. With QuasiStatic, however, the behavior is undefined, and this may result in arbitrary tissue positions and solver instabilities. When using the quasi-static integrator, all tissues and cloth objects in the scene must be sufficiently attached to bones. For example, when modeling a creature, the muscles and skin need to be attached to the skeleton of the creature. It is not necessary that each muscle is individually attached to some bone; some muscles can be attached just to other muscles. However, collectively the entire muscular system must be sufficiently constrained to the bones so that it cannot simply “fly off”. For anatomical simulation, this limitation does not pose a problem, as biological tissues will typically have many attachments.

    Note

    The integrator can be changed at each timestep if needed. This is achieved by keyframing the zSolver.integrator attribute. For example, one workflow is to use QuasiStatic during a simulation run-up, and then switch to any other integrator when reaching the actual first desired frame. This ensures that the simulations are launched with zero velocity.

    Note

    BDF2 and TR-BDF2 produce much more dynamics than BackwardEuler. If you would like to match the pre-v1.5 behavior with BDF2 or TR-BDF2, you can decrease zSolver.substeps, or increase zSolver.stiffnessDamping. BDF2 and TR-BDF2 generally need a smaller number of zSolver.substeps to achieve the same level of dynamics as BackwardEuler, which decreases overall simulation time.

    Comparison of integrators.

    Comparison of integrators on a 1D damped spring example. It can be seen that TR-BDF2 tracks the exact solution most closely, followed by BDF2 and BackwardEuler.

Real World Units

Ziva VFX uses real-world scientific units for most parameters:

Attribute

Units

Length

Meters [m]

Time

Seconds [s]

Mass

Kilograms [kg]

Material Stiffness

N/m 2 = Pa = kg/(s 2 m)

Fiber Strength

N/m 2

Attachment Stiffness

N/m 3

Density

kg/m 3

Real world values for many materials are available, and can be found in places such as on Wikipedia and other sources.

Elastic Materials

A material refers to the physical properties of a tissue or cloth. This includes simple properties like mass density, which affects mass and inertia. It also includes more complicated material properties such as the relationship between strain (displacement) and stress (elastic forces). The general form of the relationship is determined by the material type, whereas the overall magnitude of the forces that the material experiences under the deformations is controlled by the stiffness and other numerical parameters. Ziva VFX provides a choice of elastic material types for tissues: StVK, neo-Hookean, co-rotational and anisotropic. For cloth, there is only one model type present. These material types are common in computer graphics and engineering.

Stiffness

The stiffness of a tissue or a cloth is controlled by adjusting the Young’s modulus parameter on the zMaterial node. This is the standard approach for measuring the stiffness of real-world objects in science and engineering. The values for many real materials are available.

For example:

Material

Young’s Modulus [N/m 2]

gelatin

1.0 * 10 0 = 1

brain

0.5 * 10 3 = 500

liver

0.7 * 10 3 = 700

breast tissue

0.9 * 10 3 = 900

fat

3.0 * 10 3 = 3,000

smooth muscle

5.0 * 10 3 = 5,000

skeletal muscle

1.2 * 10 4 = 12,000

cartilage

2.0 * 10 4 = 20,000

rubber

1.0 * 10 7 = 10,000,000

wood

0.6 * 10 9 = 600,000,000

tendon

1.0 * 10 9 = 1,000,000,000

plastic

1.5 * 10 9 = 1,500,000,000

bone

1.4 * 10 10 = 14,000,000,000

walnut shell

1.5 * 10 10 = 15,000,000,000

steel

2.0 * 10 11 = 200,000,000,000

diamond

1.0 * 10 12 = 1,000,000,000,000

Material Types

StVK Material

A Saint Venant–Kirchhoff (StVK) material generally gives good visual results, and is our default material. This material becomes more and more stiff as it stretches, which is often useful in practice as it reduces excessive stretching. StVK and NeoHookean materials have an additional parameter: compression resistance. This important parameter controls the tissue’s volume preservation under large deformations. See more comments below, under Volume Preservation.

Neo-Hookean Material

Neo-Hookean materials do not become progressively stiffer under stretching, unlike StVK. This is a popular class of solid materials in engineering. They are often used to model rubber.

Co-Rotational Material

The co-rotational material is a linear tissue material capable of resolving large rotations, as well as a small amount of deformation applied on top of the rotations. One can apply large deformations too, but the material will visibly stretch/compress with little resistance (linearly), and without preserving volume. This material is very popular in computer graphics and engineering, and is used in many research papers and commercial systems. In comparison to StVK, this material is about 10% faster, but StVK generally looks better under large deformations.

Anisotropic Material

An anisotropic material is a tissue material that is weaker (or stronger) in a plane orthogonal to the given specified anisotropic direction. The anisotropic direction can vary spatially, and is specified via the muscle fiber field. The relative strength of the orthogonal direction (transverse anisotropy) is specified in the zTissue node, and can assume any positive real value. A value of 1.0 gives an isotropic material, values less than 1.0 gives materials that are weaker in the orthogonal direction, whereas values greater than 1.0 give materials that are stronger in the orthogonal direction.

features2 image

A tissue sphere is suspended under gravity and attached to two bones (the two cones). Both the isotropic and anisotropic materials use the same scene parameters. The anisotropic material is 20x weaker in the direction orthogonal to the red fiber field (red). As a result, a visible bulge forms in the anisotropic material.

Cloth Material

The cloth in Ziva VFX is based on the “Baraff-Witkin” cloth model (as described in “Large Steps in Cloth Simulation” by D. Baraff and A. Witkin at SIGGRAPH 1998), but with a Ziva proprietary model for the bending energy which significantly improves simulation stability. The cloth material is controlled by prescribing its tensile, shear, and bending strengths. The neutral bending angle can either be zero (flat) or the angles in the input mesh.

Layering and Blending Materials

Spatially-varying materials

Spatially-varying materials in Ziva VFX are modeled analogously to image composition.

All of the material properties defined on the zMaterial node (e.g. stiffness, volume preservation, and density) can be made to vary across the elastic object. This is done by using multiple zMaterial nodes on the same object (see Figure). Each zMaterial node defines a uniform homogeneous material, but the paintable zMaterial.weights is used as an ‘alpha mask’ to composite the material layers together. The earlier materials in the dependency graph are effectively over-written by later materials when the weight map is non-zero. The first zMaterial on each object must have weights=1, because there is no lower material layer to blend with.

For example, to make a solid ball whose left side is 10x stiffer than the right side, assign the default Young’s modulus to the base material (zMaterial1). Then, create a new material (zMaterial2), and assign 10x stiffer Young’s modulus to it. Then, paint the value of 0.0 onto the right side of the sphere for zMaterial2.weights, but leave the weights as 1.0 on the left side of the sphere.

The spatially-varying maps are painted on the triangle-mesh surface via zMaterial.weights. These surface maps are smoothly extended into the volume before simulation begins, and then transferred onto the tetrahedral mesh. If the tet mesh resolution is significantly lower than the size of the painted features, then those features will not be visible in the simulation.

While the material values may vary across each object, individual objects must be assigned only one material type (e.g. StVK, co-rotational, NeoHookean or Anisotropic). Different objects in the scene can have different types.

A demonstration of spatially-varying material is available in the Built-in Demos under “Spatially Varying Materials.”

Volume Preservation

Volume preservation is visually important for the simulation of solids (tissues). There are multiple ways to control tissue volume preservation.

First, there is the Poisson’s Ratio parameter on the zMaterial node. Poisson’s ratio defines the relative change in volume due to stretching, and successfully controls volume preservation under small deformations. Mathematically, it does not apply to large deformations, although it is often used in practice for that purpose. Values near 0.5 cause the simulated material to act unnaturally stiff, so it is not recommended to set the Poisson’s Ratio too high (a good rule of thumb is to stay below 0.45).

One can also preserve volume under large deformations via the volume conservation parameter on the zMaterial node. The higher this setting, the more the tissue preserves volume. The volume conservation parameter is independent of Young’s modulus, and typical effective values may be 10 2 to 10 7 times larger than the Young’s modulus.

Alternatively, the compression resistance parameter on the zTissue node can be used to prevent compression, but permit expansion. The compression resistance strength scales with the Young’s modulus (stiffness) and typical effective values are in the 1000’s or 10,000’s.

Note

Large values for compression resistance may cause simulation instabilities, requiring more substeps or Newton iterations to resolve. The volume conservation setting is typically more stable.

Using volume conservation or compression resistance makes it possible to simulate very soft materials. For example, try decreasing the Young’s modulus to a very small value. With a sufficient level of volume conservation or compression resistance, you should see soft, goop-like behavior.

Ziva VFX provides two physically-correct tools to manipulate the volume of tissues (and cloth): Muscle Growth and Rest Scale. Volume preservation is always applied after these volume manipulations have been applied. In other words, the volume that will be preserved is the volume of the tissue after rest scale and muscle growth have been taken into account.

Muscles

Muscle Fibers

Adding a muscle fiber (the zFiber node) to a tissue allows it to contract like a real muscle. When excited (excitation > 0), the muscle will contract along the direction of its fibers, which are shown in the viewport. The fiber direction is controlled by painting the endpoints to 0 and 1 on the endpoint map. The fibers flow smoothly between the endpoints. The strength of the muscle controls how much it contracts, and can be painted across the surface of the mesh.

A fiber will not contract past the contractionLimit. If contractionLimit is set to 0.5, then the muscle will only be permitted to contract to half its length. The elastic material will resist contracting down to 0.5, and its actual contracted length will be greater than half the initial length. If contractionLimit is set to 1.0, the muscle will not contract at all, but excitation will make the material more stiff.

The excitation of each zFiber can be key-framed, allowing muscle contraction to be directly and artistically controlled. For a semi-automatic muscle excitation, a “line-of-action” can be added to each zFiber node. The line of action requires one or more curves as input, and it excites the muscle when the curve gets shorter. This still requires animating the curve with traditional rigging techniques, but then key-framing the excitation is unnecessary (though still possible). We find that a simple skin cluster is sufficiently good for rigging the line-of-action curve. The initial creation of a very simple curve can be done automatically with the zLineOfActionUtil command.

More than one fiber node can be added to the same tissue. They can all have different parameters and be excited independently.

Muscle Growth

The muscle growth feature makes it possible to grow or shrink muscles in the direction perpendicular to the muscle fiber, using what is essentially a plastic deformation of the muscle’s elastic rest shape. This can be used to make muscles bulkier or leaner. The key difference when compared to muscle fibers is that as the muscles enlarge or shrink using muscle growth, they don’t become stiffer like they do when using muscle fibers.

One application of muscle growth is to make muscle bulging more pronounced during muscle excitation. Suppose that exciting a muscle doesn’t quite give you the muscle shape that you want. You can then add or subtract from the contracted shape by setting muscleGrowthScale to a value greater than 1.0 or lower than 1.0, respectively. This gives you additional control over the muscle shape in its contracted state.

Another application is to author (model) characters whose muscles are leaner or bulkier than your baseline character. Suppose that you have already rigged a baseline Ziva character. You can keyframe-animate the muscleGrowthScale attribute from 1.0 to, say, 1.5 over a few frames and then run the ZivaVFX simulation. Because muscle growth respects collisions, the result after the simulation stabilizes is a plausible character whose muscles are 50% bulkier. Next, you can save the resulting geometry to disk, and transfer the existing Ziva rig onto it using zBuilder. This will result in a brand new character with bulkier muscles. In the same way, you could also make the muscles leaner.

A third application is to simulate muscle growth or shrinkage during the animation itself. By keyframe-animating muscle growth, you can, for example, animate the transformation of a character into a super-muscular hero character.

Muscle growth is set as a multiplicative scaling factor. Its value must be greater than zero. Value of 1.0 means no growth. A value greater than 1.0 will cause the muscle to grow perpendicularly to the fiber, while values less than 1.0 cause muscle shrinkage.

Muscle growth and excitation on two muscles.

Muscle growth and excitation, applied to two muscles. Muscle growth can be used to enlarge or deflate the muscle shapes, without making the muscle stiffer. This example uses relatively large growth values (2.0 and 0.5) to demonstrate the effect; in practice, we expect the usage of values closer to 1.0, such as, say, 1.2 or 0.8.

Muscle growth respects the envelope, the painted fiber strength field, and any subtissues. If there are multiple fibers on a tissue with muscle growth enabled, the growth effect is properly compounded (i.e. two identical fiber fields will cause double the muscle growth). Muscle growth does not use the muscle fiber excitation. Otherwise, one could not use fiber excitation and muscle growth independently. Muscle growth and muscle fibers are independent features, and can be applied and controlled separately.

Muscle growth can be used in conjunction with a line of action, so that line of action modulates the amount of muscle growth. This is done using the useLoaForMuscleGrowth attribute. When useLoaForMuscleGrowth is on, the muscleGrowthScale is internally modulated with the line of action value, using the formula muscleGrowthScaleloaValue.. In particular, when loaValue is 0.0, this results in an effective scale of 1.0, i.e., there is no muscle growth. When loaValue is 1.0, this results in an effective scale of muscleGrowthScale (i.e. the muscle growth applies its full effect). If useLoaForMuscleGrowth is on, but there is no line of action connected, then loaValue is taken to be 0.0. This means that the effective scale will be 1.0, and therefore muscle growth will be turned off, regardless of other settings. If useLoaForMuscleGrowth is off, then the line of action is not used for muscle growth, whether connected or not. In such a case, the muscleGrowthScale value, envelope and the painted fiber strength field will be used as explained above, without any consideration for any line of action.

Tetrahedral Meshes

The simulation of tissues internally operates on tetrahedral (tet) meshes. The tet mesh acts as a ‘cage’ that controls how the muscle can deform, and is critical to the simulation.

Lattice Tet Meshes

Our primary tet meshing approach is based on an adaptively refined regular lattice. This is controlled through the zTet node that’s created with every tissue.

A higher resolution tet mesh will allow more detailed deformations, but will run slower. The single parameter ‘tet size’ sets the global maximum size of a tet anywhere in the volume. Starting with default parameters, changing ‘tet size’ is a natural place to start tweaking the resolution.

The resolution can also be spatially-varying across the surface and through the volume. To adjust the resolution across the surface of a tissue, paint the ‘weights’ map and adjust ‘surface refinement’. These are multiplied together to smoothly vary the target tet size across the surface. Note that this smooth target is rounded to an integer subdivision level (a precise formula is given in the zTet node documentation).

Note

The default surface refinement ‘weights’ are zero everywhere on the mesh, which disables surface refinement and gives a tet mesh of uniform surface resolution. If you want to use surface refinement, paint the ‘weights’.

The resolution on the interior of the volume is a blend between the global ‘tet size’ and the surface resolution. ‘Refinement propagation’ controls how much the surface resolution influences the interior.

Three example volume meshes showing the effect of "surface refinement" and "refinement propagation" on tet meshing

The effects of “surface refinement” and “refinement propagation” on the tet mesh, for a 2D example. The circle represents the triangle mesh surface of the tissue. The grid represents the generated tet mesh. (A) Surface refinement set to zero, and refinement propagation are set to zero. (B) Surface refinement set to two, and refinement propagation set to zero. (C) Surface refinement set to two, and refinement propagation set to half. This example is in 2D with quad-meshes. The behaviour with 3D tet meshes is analogous.

The tet mesh can cover different parts of the volume of the given surface by changing the ‘fill interior’ parameter. The style should be chosen to best cover the region that is intended to be solid material. The “Empty Cavities” option is most likely the correct choice, but it requires watertight input meshes to work. It does not make sense with arbitrary meshes full of holes and intersections (for which “Filled Cavities” is probably the correct choice). The “Surface Only” option covers only the input triangle mesh. This is sometimes useful, but switching to cloth is often the more appropriate choice.

Three example volume meshes showing the effect of "fillInterior" on tet meshing

The effects of “fill interior” on the tet mesh, for a 2D example. The circle represents the triangle mesh surface of the tissue. The grid represents the generated tet mesh. (A) Surface Only. (B) Filled Cavities. (C) Empty Cavities. This example is in 2D with quad-meshes. The behaviour with 3D tet meshes is analogous.

Delaunay Tet Meshes

Delaunay refinement is an alternative approach to creating tet meshes, available through the zDelaunayTetMesh node. This strategy is less controllable and less reliable than the lattice-based tet meshes, but produces tet meshes that exactly match the shape of a given triangle mesh. This property is sometimes useful, but is not required for a high-quality simulation. We only recommend using this feature if you’re sure you need it.

The input to this node must be a quality manifold surface mesh. Meshes produced by the zIsoMesh node generally form good inputs to the zDelaunayTet node. The refinementQuality parameter controls the amount of mesh refinement. Valid values are between 0 and 1. A value of 0.0 means no refinement, whereas 1.0 means high-quality refinement. It is recommended to keep this parameter at a value of 0.8 or higher.

To use IsoMesh and Delaunay tetrahedralization for a tissue, you can follow these steps:

  1. Select the tissue (e.g. myTissue) and then choose the Ziva Tools➞Create Isosurface Triangle Mesh menu item. This creates myTissue_isoMeshShape and zIsoMesh1. Modify parameters on zIsoMesh1 to achieve the desired shape and resolution.

  2. Select myTissue_isoMeshShape and then choose the Ziva Tools➞Create Delaunay Tet Mesh menu item. This creates myTissue_isoMesh_tetMeshShape and zDelaunayTetMesh1. The mesh myTissue_isoMesh_tetMeshShape looks the same as myTissue_isoMesh on the outside, but its interior is filled with tets.

  3. Select the tissue (myTissue) and the tet mesh (myTissue_isoMesh_tetMeshShape) and then choose Ziva➞User Tet Mesh.

  4. Run the simulation to view the results. On a simple setup with two spheres, as in the Tutorials, you can expect results as shown:

Delaunay Tet Mesh image

Embedding Meshes into Tissues

The tissues in our system are simulated as tetrahedral meshes. When you generate a tissue, its triangle mesh is automatically embedded into the generated tet mesh. Additional Maya triangle meshes can be embedded into our tissue tet mesh as well. This allows one to easily update the simulation (say, if the triangle model is refined at a later stage in the production). Our attachments, collisions and space-varying coefficients are authored on triangle mesh geometry. Our solver then transfers these values to the tissue tet mesh. As a result, editing volume data is no more difficult than painting the weights for a skinCluster.

Physical Effects

Damping

Damping is the mechanism by which objects lose energy and slow down. Our plugin provides three kinds of damping, they are adjustable in the solver and attachment node. “Stiffness damping” primarily dampens high-frequencies (rapid vibrations, in space and/or time). It is useful to increase stability without damping the simulation too much. “Mass damping” is a non-physical damping, somewhat like being under water. It slows all motions equally. The “mass damping” is normally set to zero, and a small amount of “stiffness damping” is recommended in order to keep the simulation stable. “Attachment damping” dampens the oscillation caused by attachment, thus achieving energy dissipation more realistically. It helps return the dynamic simulation (backward Euler, BDF2, TR-BDF2) to equilibrium quickly. Attachment damping is applied to each attachment respectively.

Inertial Damping

Inertial damping is a non-physical effect used to enhance stability or handle non-physical inputs. It prevents tissues from ‘feeling’ inertia due to large-scale motions (including all affine modes: e.g. translation, rotation, shear, and scale). Tissues with inertial damping have no momentum from these modes, and effectively act quasi-static. However, they exhibit normal dynamics for higher-frequency components. Small-scale deformations still have all of their inertia, so elastic waves travel through objects normally. Using this, tissues can be subjected to extreme acceleration without flying apart. Inertial damping is very different from the mass and stiffness damping available on the zSolver node. It can be enabled on the zTissue node, but it is recommended to be turned off until needed.

Fields

External forces can be applied to Tissue and Cloth objects using Maya Fields. You can use this functionality, for example, to model wind forces. Any field that can be modeled using Maya Fields can serve as external forces.

Based on the size and material properties of your objects, you will likely have to adjust the Magnitude attribute of the Fields in your scene. For example, with a default PolySphere converted into a Tissue with default properties, an Air field requires a Magnitude of approximately 1,040,000 to counteract the acceleration due to gravity in the Ziva solver.

Pressure

Pressure (zMaterial.pressure) applies external pressure to the surface of Cloth or Tissue objects. The pressure acts in the direction normal to the triangle mesh of the Cloth or Tissue, and the magnitude of the effect can be painted spatially.

For example, pressure can be applied to cloth (fascia) that wraps over muscles, which will cause it to fill in any little valleys between the muscles. This will make the muscle geometry more pronounced. A similar effect can be achieved using tissues without any cloth objects. Model a layer of fat over the muscles as a tissue with an inner wall (the fascia) and an outer wall (the skin). Then, paint the pressure to zero on the skin and paint a negative pressure on the inner wall. This will cause the fat layer to shrink inwards and envelop the muscles. In many cases, such direct usage of pressure on tissues eliminates the need for cloth, and can significantly reduce the simulation time and model complexity.

Pressure is given in units of \(N / m^2\). A value of 0.0 means no pressure. Positive values mean that the pressure is trying to compress the volume enclosed by the cloth or tissue, and negative values correspond to expansion. It is common to use relatively large values (for example, 100.0). As one point of reference, the extra pressure felt by an object at the bottom of a shallow (~1m) swimming pool would be approximately 10,000 \(N / m^2\).

Pressure can be animated over time using zCloth.pressureEnvelope or zTissue.pressureEnvelope. This can be used, for example, to ramp up the effect over a few frames, rather than activate it abruptly in one frame.

Surface Tension

This feature (zMaterial.surfaceTension) adds a force that tries to minimize the surface area of an object while respecting elasticity and other forces. It can be applied to tissues or cloth. Effectively, this shrinks the object across its surface, but not in the interior. For example, if it is applied to an elastic cube, it will turn it to a spherical shape. This feature can be used in conjunction with pressure for tissues for shrink-wrapping a layer of fat around muscle geometry. The difference between pressure and surface tension is that pressure will suck the fat layer into the valleys between the muscles, whereas surface tension will make the fat layer stretch across the gaps in the muscle shapes. Usually, pressure and surface tension should be used together, perhaps by varying amounts on different locations on the model. In both cases, the effects can be painted to only affect the inner wall of the fat layer.

It is possible to set surface tension to negative values. This will cause the triangle mesh to expand.

Surface tension can be animated over time using zCloth.surfaceTensionEnvelope or zTissue.surfaceTensionEnvelope.

Comparison between pressure and surface tension

Comparison between pressure and surface tension. This scene has 1 star-shaped bone (grey) and 1 circular cloth (green). Left: undeformed configuration. Middle: Pressure is applied to the cloth, pushing it in towards the bone. Right: Surface tension is applied to the cloth. Unlike with pressure, the cloth does not enter into the “gaps” in the bone, but instead forms a small planar region spanning the “peaks” of the bone.

Rest Scale

Rest scale (zMaterial.restScale) causes a cloth or tissue to shrink or enlarge uniformly in all directions. This is accomplished by scaling the “rest shape” of the object by the given amount, causing the object’s internal elastic forces to deform the object into that scaled shape. For tissues, the entire volume enclosed by the tissue triangle mesh is shrunk/enlarged, not just the boundary.

This parameter can be painted spatially. A value of 1.0 means no scaling, which is the default. To shrink the cloth or tissue, set zMaterial.restScale to a value less than 1.0, for example 0.8. To expand it, use values above 1.0.

Rest scale can be animated over time using zCloth.restScaleEnvelope or zTissue.restScaleEnvelope. A value of 1.0 means that the scaling effect is fully applied, whereas 0.0 means that it is turned off. In-between values partially apply the effect. Negative values reverse the effect, and values greater than 1.0 exaggerate the effect.

This feature can be used to grow or shrink parts of the character, and is generally used for animation or modeling purposes. For example, it can be used to easily make the ears of an elephant 2x larger, producing organic growth that is aware of collisions, gravity and other simulation parameters. A demonstration of cloth restScale and pressure is available in the Built-in Demos under “Cloth Rest Scale and Pressure.”

The difference between surface tension and rest scale is that the surface tension applies only on the surface of the object, whereas rest scale applies everywhere in the volume of the object. It is possible to paint the rest scale on the surface, and the values will be propagated into the interior. The rest scale will be applied using the propagated values everywhere inside the volume. This difference is very important for tissues. When simulating a creature’s fat compressed against the muscles, we usually do not want to shrink the fat everywhere in its volume; instead, we only want shrinkage on the interior wall of the fat. This is where surface tension comes in handy: paint it to zero on the skin, and paint it to a positive value on the interior wall.

Comparison between rest scale and surface tension.

Comparison between rest scale and surface tension. Rest scale applies everywhere inside the volume of the object, whereas surface tension shrinks the object’s surface. Surface tension does not directly affect the interior of the object, other than indirectly via the elasticity of the object. Note that in the surface tension result, the central squares are almost undeformed.

Animatable Inertial Frame

The solver node can be transformed/animated using its translate, rotate and scale attributes. If the solver node and the bones of a creature are transformed in unison, the space that the tissues or cloth are being solved in will rigidly transform with the solver, canceling any inertial effects due to bone motion. This is useful for moving simulations away from the origin without incurring inertial effects.

Isosurface Triangle Mesh Creation

It is possible to create well-conditioned triangle meshes using the Isosurface Triangle mesh generator. This is done by using a level-set-based approach and 3D Delaunay meshing. The input is an arbitrary Maya polygonal mesh that does not need to be closed, manifold or well-formed. It can have cracks, duplicate faces, T-vertices, etc. The output is a 3D triangle re-meshing of the same surface, or an offset surface. For the offset, both positive, zero and negative values are supported. The re-mesher can also remesh triangular meshes that do not enclose any volume (in which case the provided offset must be greater than zero).

features3 image

A long muscle meshed with the isomesher.

All the angles in the output triangulation are greater than or equal to 30 degrees (unless manifoldness of the output surface is enforced, discussed below). The output of this node is a Maya mesh. As such, it is independent of the Ziva solver, and can be used for any purpose in Maya.

The re-mesher does not assume that the input mesh is manifold or well-formed. It can work with arbitrary “polygon-soup meshes”, including one-sided surfaces and surfaces with holes. The remesher can be used to fill holes in non-watertight geometry, and to create a good-looking surface matching the input geometry. In the context of the Ziva plugin, the remesher can be used to create a well-formed mesh to serve as an input to tissue creation. The output of this node also provides a good starting point for Delaunay Tetrahedralization. The parameters to the remesher are the level-set value to mesh (the “isoValue”), the target size of the output triangles, and the level-set resolution. The remesher parameters are: the level-set value to mesh (the “isoValue”), the target size of the output triangles, and the level-set resolution.

  • The isoValue is specified in scene units, and can be positive, zero, or negative. Zero and negative values only make sense when the input object represents a solid volume. In such cases, the zero isosurface will effectively remesh the input surface. A negative value will effectively “shrink” the object, whereas a positive value will enlarge it. If the input is not a closed volume, then the zero (or negative) isosurface will be empty.

The parameters to the remesher are the level-set value to mesh (the “isoValue”), the target size of the output triangles, and the level-set resolution.

  • The triangle size is specified in dimensionless units, where 1.0 is a default triangle size. This parameter controls the size of the output triangles. For example, if you set it to 2.0, you can expect the output triangles to be approximately 2x larger than with 1.0. The larger the value, the coarser the mesh. Conversely, the smaller the value, the smaller the mesh, and the longer the running time.

  • The resolution controls the resolution of the internal level set representation. This controls what geometric features are visible to the method. Increasing the resolution will cause the output mesh to respect input detailed features more closely, at the cost of more memory and computation.

In many cases, the output of the remesher is a manifold surface. When it is not, the produceManifoldMesh parameter, if enabled, applies a post-processing step that attempts to make the mesh manifold by removing hanging faces and performing edge collapses. You can disable this post-processing by turning produceManifoldMesh off. The Delaunay 3D tet mesher needs a manifold mesh as input.

A demonstration of isomeshing is available in the Built-in Demos under “Isomesher.”

Thread Management

Our solver automatically uses threading to accelerate the computation. The amount of threading is controlled using the Maya multithreading settings (e.g. the threadCount command). The mesh and the problem must be sufficiently large (e.g., at least a few hundred tets) to see any advantage from multithreading.