Improvements to the Cloth Simulator

Here we take a look at the most significant developments in the cloth simulator from the past few months. This work was based on the proposal found here. The code developed during this time is at the moment still in its own branch, but will be merged at some point during the 2.8 series.

Mass Spring Model

With the old mass-spring model used by Blender, the user could have no independent control over bending and compression, or stretching and shearing. As shown in the image below, the tension and shearing springs were coupled together.


Tension and shear springs shown in blue, and compression/bending springs shown in red. (springs of same color translate to a single property in the UI)

Also, a single linear spring was responsible for both bending and compression resistance, as can be observed in the animation below. Furthermore, the usage of linear springs for resisting bending, deviates significantly from actual cloth behavior, and even allows bends to be flipped to the opposite direction without any resistance.


(Cross-sectional view) This video shows that the same spring was responsible for providing both compression and bending resistance, by pushing opposite sides of a bend away from each other.

The new model has componentized springs, and the addition of angular bending springs. Combining these things, the user has complete control over every aspect of the cloth stiffness independently.


Tension springs shown in blue, compression springs shown in red, shear springs shown in cyan, and angular bending springs shown in green. (springs of same color translate to a single property in the UI)

Beyond that, the angular springs behave much more realistically, and are signed, meaning that the cloth is aware of the direction of the bend, thus not allowing it to get flipped.


(Cross-sectional view) Here in the new model it can be seen that a new dedicated angular spring was added specifically for bending, while the compression springs always stay flush with the cloth surface.

Below are comparisons of various aspects of the cloth model that were improved.


Comparison of the old cloth bending model (left) and the new model (right).


Comparison of the old combined isotropic cloth tension model (left) and the new componentized anisotropic stretch/shear model (right).

Plasticity

Plasticity is the most significant property of deformable materials that was missing from Blender’s cloth simulator. Plasticity is the property in which materials retain deformations after being subjected to stresses, and thus don’t return completely to their original shape. In addition to the improved mass-spring model, the inclusion of this property, is the final piece in enabling the simulation of virtually any known deformable sheet material.


The same simulation shown without plasticity (left), and with plasticity (right).

External Rest Shape

The “Dynamic Besemesh” feature allows the underlying cloth mesh animation to be used as the new rest shape on each frame, thus enabling effects where the cloth changes shape throughout the simulation. However, an issue arises when this feature is used in combination with pinning. Because the pins also utilize the underlying mesh state to determine vertex locations, one could not have independent control over the pin locations and the dynamic rest shape. Now support has been added for using another mesh (with identical topology) as the rest shape.

The video below demonstrates the described issue, and shows how one can now animate rest shape and pin locations independently.


From left to right: (Top row) Animated cloth mesh (before simulation); Simulated cloth using own mesh both for pinning and as dynamic rest shape; (Bottom row) Animated mesh used as rest shape; Simulated cloth using external rest shape mesh;

25 comments 9,986 Views
  1. Amazing!

  2. isotropic cloth tensión looks really amazing. How it looks combined with twisting?

  3. OMG that looks almost real!

  4. This is amazing!

  5. omg, those improvements are unreal. Easy to see why so few wanted to use the old cloth system. Can´t wait to see your plans for Blender particles 🙂

  6. Long missed improvements. Even a flag, which is a classic, basic tutorial, which there are tons of, becomes a headache when done for production, as the final result is “the most successful simulation” instead of cloth of particular characteristics, not to mention cases requiring plasticity.
    Any improvement is great, and this looks like a major one.

    Just in case, and if it’s not not yet carved in stone – please don’t forget that target shapes/pinning often are to be animated. Inability to do things like that is a widespread showstopper for many things simulation related in Blender.

    • This has been implemented. You can now animate target shapes, and pins independently (as shown in the last clip). You can also animate the influence of different pins throughout the simulation.

  7. This is nice. But I’d really like to see this working on an animated character with multiple layers of clothing made of different materials, with belts, straps, stitching, quilting, etc.

  8. Please add a function to tear cloth!

  9. Multithreaded? The shorter the wait the better the outcome.

    • This. Is it multithreaded or even GPU accelerated?

    • Well, collisions have been multithreaded. And other general performance improvements have been made.

  10. Nice Improvements!
    But I’d like to see a function for tearing cloth.

  11. If you are looking for code for cloth tearing effect, check this sample out from javascript.

    https://codepen.io/dissimulate/pen/KrAwx

    Hope this can be used in python.

  12. Quite nice! I can’t wait to see how this works on a character model! I’m quite curious to know if there’ll be any updates to collision detection!

    • Thanks! This was used for all the henchmen and the doctor in Agent 327.
      A demo of all the cloth from the film is coming soon!
      As for collisions, improvements were made in regards to performance and reliability, but work is still in progress.

      • Hey Luca.. a tutorial on how to sew clothes together to make clothes in blender would be cool.. like how you do in Marvelous Designer

  13. gpu acceleration please!…seriously though between new viewport GI, the amazing manipulators and now this….christmass seems to be early this year, as well as next year….now if we could get some game engine love my world would be perfect.

  14. Is there a working build for this?

  15. Is there a working build for this?

  16. Hey, those are fantastic news! But I need to ask the same question as Michael – is there a build available with it already or do we have to wait longer?

  17. Very impressive!

  1. Leave a Reply

    Your email address will not be published. Required fields are marked *

     

share this story on