14
$\begingroup$

What research is leveraged to implement Blender Cloth? I know of several cloth models - Geometric, Physical, Particle - as well as their authors - Provot, Baraff & Witkin - but I am not certain if Blender utilizes one or any of these.

For example, I am not sure what is actually changed when you decrease the Structural Stiffness value from 15 to 10, or even what a "Stiffness" of 1 unit actually means (mathematically or physically). This also applies for the physics and maths of "Quality" step sizes, "Structural" and "Bending" qualities, and the "Spring" variables under the Damping setting. This powerpoint has helped, as has this .pdf, but neither offers complete answers to my questions.

$\endgroup$
5
  • $\begingroup$ I think blender uses it's own proprietary cloth solver $\endgroup$
    – Vader
    Commented Apr 2, 2014 at 16:58
  • 2
    $\begingroup$ You have multiple questions in this question. Each questions should focus on a single problem. $\endgroup$
    – Vader
    Commented Apr 2, 2014 at 16:59
  • $\begingroup$ Sources are available here / here. For more serious information on the implementation you could try to contact the devs. $\endgroup$
    – user2859
    Commented Apr 2, 2014 at 20:05
  • $\begingroup$ You're on the right track with Provot's Physically Based Cloth Model. $\endgroup$
    – Luis B
    Commented Apr 23, 2015 at 1:16
  • $\begingroup$ Good values to try out might be the following Mass/Structural/Bending values: Default (0.3,15,0.5); Heavier, Faster, Greater Force (1.0,15,0.5); Allows Stretching and Shearing (0.3,0.01,0.5); Doesn't Allow Bending (0.3,15,55) $\endgroup$
    – Luis B
    Commented Apr 30, 2015 at 1:08

2 Answers 2

23
$\begingroup$

Summary: Initially in 2004, Todd Koeckeritz leveraged Provot's Cloth Model (Deformation Constraints in a Mass-Spring Model to Describe Rigid Cloth Behavior); also, he leveraged simplified portions of Provot's Cloth Collision Model (Collision and self-collision handling in cloth model dedicated to design garments). Then in 2006, Daniel Genrich completed an implementation of Mezger's Cloth Collision Model (Improved Collision Detection and Response Techniques for Cloth Animation). Additionally, Todd Koeckeritz created a parameter named "Steps"/"Quality" to handle time steps. Finally in 2008, Daniel Genrich released Blender Cloth (according to BlenderNation.com).


Research Papers:

Todd Koeckeritz (Contributor of Blender Cloth) says in April 2006:

Provot was chosen when we started the project because I had the code written already from two years ago when I was working on cloth as a python module. So, we've started with that. However, the few semi-unique characteristics of the Provot paper referenced in the wiki page are being replaced now with a similar process from another paper. So, in some ways Provot is gone, or will be in the next release. However, the nice feature described by Provot in section 5 of his paper, deals with eliminating the super-elastic/rubbery effect that some cloth simulators exhibit. That was my reason for choosing the paper two+ years ago.

The initial checkin of Blender Cloth files for "trunk/blender/source/blender/makesdna/DNA_cloth_types.h" by Daniel Genrich (Contributor of Blender Cloth) reads in September 2007:

+/**
+* This struct contains all the global data required to run a simulation.
+* At the time of this writing, this structure contains data appropriate
+* to run a simulation as described in Deformation Constraints in a
+* Mass-Spring Model to Describe Rigid Cloth Behavior by Xavier Provot.
+*
+* I've tried to keep similar, if not exact names for the variables as
+* are presented in the paper.  Where I've changed the concept slightly,
+* as in stepsPerFrame comapred to the time step in the paper, I've used
+* variables with different names to minimize confusion.
+**/

Todd Koeckeritz talks about his implementation of Provot's Cloth Collision Model in April 2006:

What we have now is a partial implementation of one described by Provot in his paper "Collision and self collision handling in cloth model dedicated to design garments." We may not implement all that is described in that paper, but we do need to get friction working properly and get it working properly with moving and/or deforming collision objects. What we have now works fine for dropping pieces of cloth on cubes and such, but there's no sliding when there should be and it isn't working now with collision meshes being deformed by armatures and such.

Todd Koeckeritz talks about Daniel Genrich implementation of Mezger's Cloth Collision Model in March/April 2006:

Genscher is focusing on work on the k-dop collision system [...] The collision system we've implemented is described in papers by Metzger in 2002 and 2003 and is known as K-DOP BVH. From an end user standpoint, there isn't too much that needs to be understood about this implementation that is specific to the collision system. In most cases, you either want to spend CPU time computing collisions or you don't.

Todd Koeckeritz talks about Time Steps in April 2006:

There is one more important concept for an end user to understand and that is the one of how the simulation deals with time. It is impossible to model all the atoms or molecules in a piece of cloth and those objects with which it might collide as it would simply take too much time to compute the results, so we compromise by using the point masses and springs described above. There is a similar problem when it comes to dealing with time. While some parts of the cloth modifier attempt to deal with time in a continuous sense, other parts only compute the results at specific points in time. For example, think of dropping a ball on frame one and having it hit the ground on frame 21. If you only had results on frame 1 and frame 21, you'd have no idea on how the ball behaved between those frames. It might have been moving at a constant velocity or it might have been accelerated from rest by gravity or another force. On the other hand, if you had all the frames from 1 to 21, you could examine the position of the ball in each frame and then know much better how the ball moved during that time. With that new information, you can then better predict how the ball should move between frames 22 and 51. The cloth modifier has some similar problems, although we deal with them at the sub-frame level. To do this a parameter called Steps is provided. The higher the number of steps, the more time is spent computing a result, however that result should be more precise. The lowest setting for Steps is 1, meaning we'll run the simulation once per frame. This is the fastest way to get a result from the cloth modifier, however, the results might be less physically accurate than if you choose a larger number.

In April 2006, Todd Koeckeritz called it "Steps". Between September 2007 and January 2008, Daniel Genrich renamed "Steps Per Frame" to "Quality". The following code diff of "/source/blender/src/buttons_object.c" represents these changes:

-               uiDefButS(block, NUM, B_DIFF, "Steps:",                    10,80,100,20, &sb->minloops,  1.00,  30000.0, 10, 0, "Solver steps/frame ");
-               uiDefButI(block, NUM, B_DIFF, "Steps per Frame:",          10,150,150,20, &clmd->sim_parms.stepsPerFrame, 1.0, 100.0, 5, 0, "Quality of the simulation (higher=better=slower)");
+               uiDefButI(block, NUM, B_CLOTH_RENEW, "Quality:",           10,150,150,20, &clmd->sim_parms->stepsPerFrame, 4.0, 100.0, 5, 0, "Quality of the simulation (higher=better=slower)");

Parameters:

The Blender Cloth Modifier is based on a Spring Network, according to Todd Koeckeritz in April 2006:

The spring network is built of three types of springs and the user is allowed to control the stiffness of the springs separately: (1) Structural Springs are built on the edges of the mesh. They provide the main structural integrity of the cloth. (2) Shear Springs are built on the diagonals of quad faces and provide some resistance to shearing forces in the cloth. (3) Flexion Springs are built similarly to the Structural Springs, but are built on top of two close to parallel Structural Springs. Flexion Springs provide resistance to folding, the stiffer they are, the more the cloth will attempt to retain its original shape. Think of them as starch for your collar.

The Blender Cloth Controls were more detailed in April 2006:

  • Collision : This toggles whether the object is a collision object. Collision objects are not cloth objects, they only allow the cloth
    objects to react to them when they collide. To collide with a cloth
    object, this button should be toggled on and the object should share
    a layer with the cloth objects with which it should collide.
  • Bake Settings : This button switches the mode of the cloth modifier panel to baking mode, allowing the user to bake the results.
    Simulation Type : Presently there is only one solver implemented, the Provot solver as described in his paper above. There are however 3
    forms of integration, Explicit Euler, Middle Point and Runge-Kutta.
  • Collision Type : This allows the user to specify what type of collisions to process for the cloth object. Presently only the None
    and KDOP options are available.
  • Pinned Vertex Group : If a vertex group is chosen in this menu, those vertices are not affected by the cloth modifier. They are pinned in place.
  • Mass Scale Vertex Group : This vertex group allows the user to multiply the point mass by the influence/weight a vertice has in the
    vertex group. Thus parts of the cloth can have different weights
    making part of it appear wet or heavier for other reasons.
  • Mass Vertex Group : This vertex group allows the user to directly specify the weight of the vertices. The Scale parameter is used to
    adjust the results of this.
  • Scale : This allows the user to scale the results of applying a Mass Vertex Group.
  • Gravity X, Y and Z : These provide an external force to the cloth.
  • Spring Stiffness : These three parameters control the Structural, Shear and Flexion spring stiffness.
  • Damping Springs : This is the damping factor applied to motion produced by the springs.
  • Damping Viscous : This damping factor is applied to all motion of the cloth, higher values produce results like moving through water or mud.
  • Damping Self Fr : This will be used as the damping factor for friction caused by self collisions of the cloth.
  • Damping Friction : This damping factor is applied to the cloth vertices that collide with collisoin objects.
  • Simulation Steps : This controls how many steps per frame are used in the simulation. Higher values produce better results in general, but take longer to compute.
  • Simulate Adjustments : Adjustments controls whether or not attempts are made to keep the springs in the cloth from exceeding their
    original length multipled by Tc. When set to -1, the Structural
    springs get increasingly stiffer, up to 100 times stiffer, as the
    springs's length divided by its original length aproaches Tc. At 0
    (zero), not adjustments are made. At 1 (one) or greater, Provot's
    algorithm of adjusting the springs is done as many times as specified by this parameter.
  • Simulation Mass : This specifies the base mass of a vertice in a cloth object. The final value of the mass for any given vertice can
    be influenced by the Mass Scale Vertex Group and/or the Maxx Vertex
    Group.
  • Simulation MinZ : Provides an artificial floor below which the cloth vertices will not go.
  • Simulation Epsilon : This provides a buffer distance for collision detection and response. In the current implementation, small values
    in the range of 0.001 to 0.005 generally work best, although in some
    cases larger values may be desired.
  • Simulatin Tc : This specifies the critical deformation length as a ratio to the original spring length. This value has no effect if
    Adjustments are 0 (zero).
  • Simulation Spr Len : This allows the user to specify an artificially large or small base spring length. When this value is 1.0, the simulation behaves normally. With values less than 1 (one), the springs are treated as if they were shorter than they actually are which can be useful to shrink clothing to fit tighter on a model ... think spandex. If this value is greater than 1 (one), it provides an artificial force to expand the cloth object which can be useful to give bounce to a skirt or dress.
  • Simulation Pre-roll : This provides some artificial frames prior to the start of the animation to allow the cloth to find its resting
    position.
  • Simulation Col Loop : This is the maximum number of times per step collisions will be tested. This parameter is likely to go away.

Daniel Genrich simplified the controls by May 2008:

  • StructStiff: Structural Stiffness also includes shear stiffness. Both define the stiffness of the structure of the cloth. Lower values will make the cloth look like elastic rubber.
  • BendStiff: Bending Stiffness describes how the cloth forms its wrinkles. Higher values result in bigger but not necessarily more
    wrinkles.
  • Spring Damp: Specifies how much the amount of movement will be lowered. This can prevent unwanted jiggling, and can result also in
    smoother animation.
  • Air Damp: How thick is the air? How much movement will it stop due to its thickness? Practically speaking, you receive slower movement of cloth with higher air damping. With air damping set to zero, you have moon surface conditions.
  • Quality: More quality gives more stable cloth (less jiggling with high BendStiff) and additionally you receive better collision
    responses.
  • Mass: More mass gives heavier cloth, with slightly more weight on the border like normal cloth.
  • Gravity: X, Y and Z direction of the gravity you want to have working on the cloth.
  • Min Distance: Defines the cloth thickness where the collision response kicks in. It helps to keep a minimum distance between the
    Cloth and the colliding mesh. Just increase it if you encounter
    collision penetrations (This is only one of two available options
    to resolve that issue - you could also increase the Quality on the
    first Cloth panel).
  • Friction: Friction defines how good a cloth can slide over a collision object. See this for how friction effects the cloth
    collisions.
  • Min Distance: Defines the cloth thickness where the selfcollision response kicks in. It helps to keep a minimum distance between the
    Cloth.
  • Selfcoll Quality: This values helps you to resolve several layers of selfcollisions. Be carefull: the Collision Quality has to be at least as high as Selfcoll Quality to have it working!
  • StructStiff VGroup: Vertex Group to be used for Structural Stiffness scaling.
  • BendStiff VGroup: Vertex Group to be used for Bending Stiffness scaling.
  • StructStiff Max: Defines the Structural Stiffness maximum. The structural stiffness gets scaled between this maximum (the red
    painted values on the vertex group) and the minimum StructStiff on
    the first Cloth panel (blue painted vertices on the vertex group). A
    linear interpolation function is used inbetween.
  • BendStiff Max: Defines the Bending Stiffness maximum. The bending stiffness gets scaled between this maximum (the red painted values on the vertex group) and the minimum BendStiff on the first Cloth panel
    (blue painted vertices on the vertex group). A linear interpolation
    function is used inbetween.

As of today (April 2015), the controls for Blender have three damping forces (Spring, Velocity, Air). Provot's model explains these three damping forces as follows (respectively: Internal, Gravity, Viscous-Damping/Air):

The internal force is the resultant of the tensions of the springs linking P_ij to its neighbors. The external force is of various nature according to the kind of load to which we wish the model to be exposed. Omnipresent loads will be gravity, a viscous damping, and a viscous interaction with an air stream or wind. Let g be the acceleration of gravity, the weight of P_ij is given by F_g=mg. The viscous damping will be given by F_d=-C_dv where C_d is a damping coefficient and v is the velocity of point P_ij. The role of this damping is in fact to model in first approximation the dissipation of the mechanical energy of our model. It is introduced as an external force but could actually be considered as an internal force as well. Finally, a viscous fluid moving at a uniform velocity u exerts on the surface of a body moving at a velocity v a force F_v = C_v((n dot (u-v))n where n is the unit normal on the surface.

The controls today (April 2015) are very similar to the controls in May 2008. The full set of updated parameters can be found in the the current Blender Manual: http://www.blender.org/manual/physics/cloth.html

$\endgroup$
2
$\begingroup$

There was a blog about development, it's gone but a copy can be located here I believe the simulator is particle based, and you might be able to find a few details there. However, the best approach would be the blender developers mailing list, or even browsing the source code.
Normally I think pointing someone at the source code is a very incomplete answer, but you mentioned you are using this for a lab. So I'm assuming that you need a very detailed answer of how it is simulated. Also keep in mind that Blender is an animation package. It creates results that look good, not necessarily results that are physically accurate.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .