DMM Material Editing

Vik Sohal

An important element of creating and using DMM is setting the physical material properties of DMM objects.

DMM objects can be created to behave like objects in the real world, or like objects that cannot exist in the real world due to the physical constraints of reality. This interesting dichotomy can lead to some extremely intriguing possibilities in applying real-world concepts to game worlds.

For example, with DMM it is possible to create a wall that can have its density low enough that it can stand 20 feet high without buckling, yet by adjusting a single parameter (density or toughness) it is possible to make that wall come crumbling down under its own weight. With a quick adjustment of a few other parameters, that same wall could bend or expand strangely while it collapsed.

DMM Material Properties

In order to understand how DMM works, we must first look at what the parameters that govern its actions mean. The good news is that all the parameters are exactly the same as what you might find in a materials science textbook. This is because DMM is based on the science of continuum mechanics and finite element theory, both well-understood scientific fields.

Let’s examine those parameters now:

Youngs – Young’s modulus of elasticity, ranges from .1 to 1e10. This parameter determines how flexible an object is ranges from this parameter determines how elastic a material is. Setting this value to a low value makes a material more flexible, while setting it high makes a material more rigid. It is important that Youngs always be greater than Youngs Damp.

Poissons – Poisson’s Ratio, an parameter specifying the amount of volume preservation a material has when subjected to stress. A value of 0 means that the volume of the object will not be preserved at all, while a value of .5 means it will be perfectly preserved. A value of -1 is also possible, and will cause the material to expand as it is subjected to stress. Examples of different poisson’s ratios would be:

0 – A hollow tin can being crushed

.5 – A balloon being compressed

-1 – A cartoon mallet striking the ground and expanding as it hits.

Density – This specifies how much a material weighs per unit volume. This parameter ranges from 1 to 10,000. Increasing this number without increasing toughness can result in objects that collapse under their own weight.

Toughness – Denotes how strong a material is. More specifically, this is what determines how breakable something is. The larger the number, the harder something is to break. Setting toughness to 0 makes things unbreakable.

Youngs Damp – Youngs Dampening, ranges from .1 to 1e9. A dampening value related to velocity. The real-world analogue to this would be how much energy a material dissipates as heat when it is subjected to a sudden force. It is important that Youngs Damp always be less than Youngs.

Poissons Damp – Poissons Dampening, ranges from .1 to .5. Affects the velocity at which something changes shape. similar to the young's damp value, Poissons Damp keeps things from deforming too much as they stretch.

Yield – Ranges from 0 to 1. This parameter determines how much something has to deform before it plastically deforms. As long as a material deforms less than this value, it will always return to its original shape. If, however, the deformation exceeds this value, the material will stay in its deformed position scaled by "creep" (defined below).

MaxYield – Ranges from 0 to 1. MaxYield is used to limit how much a material may deform. If you strain a material more than this than the material will not deform any more. If you deform more than this, and let go, the material will revert back to how deformed it got at maxyield.

Creep – Ranges from 0 to 1. Creep is a scaling factor that determines how much plastic deformation occurs per unit second. A small creep means that the object can be massively deformed quickly, though if you let go, it will only be plastically deformed a little (if it went beyond yield). If you hold it for a long time in that deformation, it can get highly deformed (depending on what maxyield is).

MinIter - Solver iteration limits - keep this set to at least 4. Setting it higher will slow down the system but could result in greater accuracy. Messing with minIter can be useful to see if a material is acting strangely because the DMM solver is not converging. Increasing minIter won't really improve the accuracy.

MaxIter - Maximum solver iterations, increase for more accurate solutions. Though things can converge faster depending on what you set err (defined below) to. Sometimes the system may not converge in a single frame, resulting in simulations that do not look good. In this case, you can experiment by increasing maxIter to see if you get better results.

Rel Error – Relative Error, or the error before the DMM solver stops before reaching MaxIter. A value of .001 means that the solver stops when the error is 1/1000th of the error at the start of the frame. It is best to leave this value alone, or set it to the value in the example materials library.

splitLimit - limit on number of fractures that can occur for a given object per frame.

Wake up Radius - Radius of nodes around the impact point that tets will be woken up if the object is frozen. Reducing wakeup radius can create materials that act very rigid except in the area that forces are applied. Care should be exercised, as increasing the wakeup radius too much will wake up too many things resulting in slowdowns.

Friction - Coefficient of dynamic friction, ranges from 0 to .5. This controls how slippery things are. There is not presently a coefficient of static friction, so use this single value for both.

Creating DMM Materials

Generally, the best place to start in creating a DMM material is to edit an existing material that has behavior close to your target material. You can then use the DMM viewer application to rapidly iterate and create the material you want.

The viewer application has a simple scene description that allows you to import DMM objects created with the DMM production pipeline into a test scene. You can then adjust settings and throw objects at the object and observe its behavior. You can also observe the effect that gravity and other objects have on the object as its material properties are changed.

So to summarize, to edit a DMM material, you load a scene with objects set to some default or test settings, alter the settings and reset the scene to observe the behavior. This process is repeated until the desired material property is achieved.

To better explain what the different material properties have on the material as a whole, we will examine why the settings for a couple of popular materials are set to what they are:

Example: Glass

These settings are for a large pane of glass set into an overhead panel.

Parameter | Value | Explanation
Youngs | 3.37145e006 | Glass is a amorphous solid and tends to flex slightly before it breaks. Setting the young’s modulus to a less than “totally brittle” value helps sell this when the object flexes just before it breaks
Poissons | 0.0 | Glass does not noticeably distort from a volume preservation standpoint, so it is best to leave this set to 0.
Density | 2549.310 | This is a good setting for plate glass, and allows it to remain intact when used as a ceiling pane
Toughness | 1472.73 | Ensures that the glass remains strong enough to support itself. Lowering this is useful if you want to have the glass shatter when it is slightly impacted through a combination of its weight and the object hitting it.
Youngs Damp | 0.0 | No dampening is needed, glass generally dissipates all its kinetic energy as fracture quickly.
Poissons Damp | 0.0 | Since we are not concerned too much with preserving volume in materials as rigid as glass, we can leave this set to 0 as well.
Yield | 0.0 | Glass does not plastically deform, so this is set to 0
MaxYield | 0.0 | Glass dos not plastically deform, so this is set to 0
Creep | 0.0 | Glass does not plastically deform, so this is set to 0
MinIter | 4 | A material like glass generally converges quickly, so 4 is a good value
MaxIter | 40 | The standard default for all materials
Rel Error | .001 | The standard default for all materials
SplitLimit | 8 | This ensures that the glass breaks well when large panes are set, but you may want to lower it for more localized destruction
Wake Up Radius | 1.2448 | You don’t want the entire pane to simulate on point impacts, this is a good value to start with overhead glass
Friction | .6 | Glass has roughly this degree of friction

Example: Rubber

This material can be used for floppy plants as well as other rubber-like objects.

Parameter | Value | Explanation
Youngs | 1.59773e006 | This is a good start for floppy objects which retain their shape at a size of around 8 feet. You may want to make smaller objects have a smaller youngs modulus to ensure proper movement
Poissons | 0.0 | Volume preservation is important for rubbery things. Start with 0 for for moderate floppyness, but increase to .5 to get interesting secondary movement.
Density | 998.207 | Rubbery objects are not too dense, this is a good value to start with.
Toughness | 0 | Plants and rubbery objects can break, but for our example, we are creating a material that is basically streachable but not breakable.
Youngs Damp | 1000 | Plants and rubbery objects don’t flop around forever. This is generally due to the microstructure of those materials where water or some other interesting mechanism absorbs kinetic energy. Setting Youngs Damp to 1000 will give a good basis to keep objects made with this material from moving wildly.
Poissons Damp | 0.0 | The change in volume is not too great in most plants (though it might be if you had something with a large bulb as an integral part), so leaving this set to 0 is ok
Yield | 0.0 | Rubber does not plastically deform, so this is set to 0
MaxYield | 0.0 | Rubber does not plastically deform, so this is set to 0
Creep | 0.0 | Rubber does not plastically deform, so this is set to 0
MinIter | 4 | A nonrigid material like rubber generally converges quickly
MaxIter | 25 | A nonrigid material like rubber generally converges quickly
Rel Error | .001 | The standard default for all materials
SplitLimit | 8 | We are not too concerned with fracture in most rubber objects, but this would be a good starting point if we were.
Wake Up Radius | 9 | A floppy object consumes less CPU cycles than a rigid one, so it is ok to set this a bit higher to ensure a more intuitive feel for the object’s movement.
Friction | .6 | Rubber objects generally are impacted by other object types, so this is a good starting point

Example: Plastic

Plastic and Steel have many similarities in their material behavior, The primary difference between the two is density and toughness

Parameter | Value | Explanation
Youngs | 3.e+007 | The same youngs modulus as steel is a good starting point for plastic
Poissons | 0.330 | This is a good starting point for a bendable plastic because it has some volume preservation while keeping
Density | 1000 | Increase for steel to account for greater mass
Toughness | 0 | Breakable plastic objects are interesting, but for this example, we are making the object nonbreakable to focus on basic properties of plastic deformation
Youngs Damp | 0.0 | If you don’t want the object to flop too much, you can increase this
Poissons Damp | 0.0 | Change this if you have a very very large plastically deforming object.
Yield | .194 | We want the threshold of plastic deformation to be fairly low
MaxYield | .414 | We want to limit how much deformation the plastic will have to this
Creep | 1.00 | Set this to 1 for most plastics
MinIter | 4 | A soft material like plastic generally converges quickly
MaxIter | 35 | The standard default for all materials
Rel Error | .001 | The standard default for all materials
SplitLimit | 0 | Our plastic is not breakable
Wake Up Radius | 3 | We want deformation to be highly localized in this plastic
Friction | .6 | Glass has roughly this degree of friction

Example: Brick

Brick is a very rigid material, but even in this case, there is some slight deformation before fracture occurs.

Parameter | Value | Explanation
Youngs | 3.98019e007 | Despite its notion of being very rigid, there is still no need to make Brick as rigid as possible to achieve the effect we want.
Poissons | 0.0 | Brick does not need to have volume preservation as it will not deform enough to matter
Density | 3072 | Roughly the weight you would want for bricks in a brick wall
Toughness | 22721 | Change this based on how dense an object you are throwing at the brick object. For a man-sized object with material density of 3072, this is probably a good value to ensure the “guy through the brick wall” effect
Youngs Damp | 371937 | When getting things very rigid, we can increase dampening to get the effect of rigidity without making the actual youngs modulus really high (which will slow down the solver for reasons outlined below)
Poissons Damp | 0.0 | Not relevant for really rigid objects
Yield | 0.0 | Brick does not plastically deform, so this is set to 0 (you may want to play with this and the following three values to set a visual value to mortor holding the brick splinters together)
MaxYield | 0.0 | Brick dos not plastically deform, so this is set to 0
Creep | 0.0 | Brick does not plastically deform, so this is set to 0
MinIter | 4 | A material like brick generally converges quickly, so 4 is a good value
MaxIter | 40 | The standard default for all materials
Rel Error | .001 | The standard default for all materials
SplitLimit | 14 | This dictates how “crumbley” a brick wall can be. Increase for a more pronounced fracture effect.
Wake Up Radius | .78585 | You can increase this, but for large rigid bodies like brick walls, it is good to keep too many tets from waking up at once for performance reasons.
Friction | .522 | Brick has roughly this degree of friction.

Advanced Topics

When working with lots of DMM within a scene, it is important to see how DMM objects interact with each other. Having a rigid brick wall next to a plastically deformable steel beam can produce some interesting effects, as can having a large floppy plant be hit repeatedly by a projectile to see how it moves.

Also, utilizing the DMM glue system, and creating multimaterial objects (all the aforementioned material properties can be assigned on a per-tet basis if needed through the DMM API) you can create DMM objects that can take advantage of many different material behaviors.

Performance

In general, floppy objects take less CPU time than rigid objects. Try and design materials that do not have a young’s modulus close to the limit. Objects that are very rigid also have a tendency to “wake up” a greater part of their volume for simulation as forces propogate through them. For soft bodies, the same forces do not tend to propagate nearly as far through them.

Multimaterials

The DMM API allows all the aforementioned material properties to be assigned on a per-tet basis. This means that you could have a wall that was half floppy and half rigid based on how the tets within it were assigned their properties. Authoring materials in this way generally requires a script or some sort of load-time effort, but the end result can be very interesting. See the DMM API specification for further details.

For more interesting multimaterial behavior, it is generally desirable to use Glue and keep mesh densities low.

Glue

Because DMM objects are constructed from single meshes, it can be difficult combine multiple objects together without greatly increasing the mesh density at the places where objects join. For this reason, we have created an entire “Glue” API which lets you create meshes of relatively low densities that are held together with “glue” volumes.

See the DMM API specification for further details.