Carbon Cloth Hints

The document mainly refers to triangle meshes, but the same general rules apply to quad meshes as well.

Carbon Simulation Philosophy

Carbon Simulation is designed for quality without sacrificing performance, that is why it is fast, but there are of course limitations that come with this when simulating cloth.

Cloth Primitive Size

For the purpose of this topic, let’s assume that the scene is setup in SI (metric) units: Scale is 1 (e.g. a character is 1.8 unit tall) and Gravity is 9.81.

Under these scene conditions we should try and avoid triangles less than the equivalent of 1cm (0.01 unit) in length. So, at this size a typical shirt/skirt might have 10,000 triangles.

Number Of Triangles In Cloth

Carbon Cloth is modelled as a global network of constraints. The more constraints (triangles) in a single cloth the harder Carbon has to work to deliver the expected result (convergence).

The work is proportional to the square of the number of constraints.

A single garment with 10,000 triangles (of the right size see above) should typically need 10 or 20 Iterations for the solver to reach a reasonable result (convergence). A garment with 20,000 triangles (a long dress for example) may need 50 to 100 Iterations.

If you want to simulate the ultimate fine wrinkles, a 100,000+ triangle dress is going to be required and then you are going to have to drastically increase the number of iterations and clearly performance is not a key objective with such a simulation.

Triangle Shape

Ideally all triangles should be about the same size, equilateral where possible, not inverted and random orientation, unless a particular look is the aim of orientation.

The Carbon Cloth node has a tool to help identify problem triangles.

Fold Size, Shape

The size of the folds and wrinkles is ultimately limited by the triangle size, unless you have an explicit crease line of triangles in your geometry. If your triangles are 1cm (0.01 unit) in size then the fold width is unlikely to be less than about 2cm as in the screen shot below.

_images/carbon_cloth_hints_assassin_catwalk.png

Folds on a 15K triangles cloth.

Also, folds are typically the result of energy being imparted to the cloth, so if you don’t have some reasonable movement you are probably not going to see interesting wrinkles.

Folds And Persistence

Carbon has support for angular plasticity so folds that are created during the simulation can be made persistent.

Also folds in the reference pose can be made persistent as well.

See also

Angular Plasticity.

Number Of Triangles In Character

The number of triangles in the character body, where it collides with the clothing, has an effect on the quality of the collision.

Character triangle resolutions similar to the clothing work fine. Higher resolutions will just run a bit slower, lower resolution may affect the look of the cloth simulation.

The triangle size and shape preferences as detailed for the cloth only apply to areas of the character being used as deformable in a Carbon Morph to allow pinch mitigation.

Number Of Iterations

Carbon iterates towards a result. The harder the problem the more Iterations Carbon needs.

Typically 10 or 20 Iterations are enough and we’d recommend starting a scene with Iterations set to 20.

Certain situations require more Iterations, 100 or more Iterations might be required for example with a large number of primitives, or very badly shaped triangles, or where you want a stiff behavior.

Number Of Subdivisions

Carbon supports very accurate collision between the triangles of the character and the clothing. To achieve this accuracy Carbon has to avoid the character moving more than half the cloth Thickness in a single time-step (subdivision).

Typically, with a character at walking pace you need 240 time-steps per second. So with a 24fps animation you need 10 time-steps per frame, to achieve this you set Subdivisions to 10.

If the character is moving faster and/or the cloth is swishing around fast you may need to try 20 subdivisions to avoid the character penetrating into the cloth.

If the character is interpenetrating the cloth, typically at the knees, then try increasing the number of Subdivisions.

Note

Increasing Subdivisions will not solve the issue of pinching where the cloth is trapped between two inter-penetrating parts of the character body.

Cloth Thickness

Cloth is a double-sided collision shape by default. Cloth outer fatness corresponds to the outer fatness of the collider and applies to each side; therefore, thickness of the cloth is double the outer fatness value.

There is a limitation as to how large the fatness can be for self-colliding cloths (half the height of the triangle). Carbon uses an automatic self-collision fatness computation that locally overrides the outer fatness during self-collision.

The Carbon Cloth node has a tool to visualize where the outer fatness override is happening.

Performance Tips

One of Carbon’s strengths is handling multi-layer clothing collision with high performance. Carbon accurately collides multi-layer clothing.

By default, every layer collides with every other layer. This can be changed and to increase performance you can tell Carbon which layers to collide using a Carbon Filter.

Try to ensure that multiple layers of clothing are not inter-penetrating on the first frame as this can lead to simulation issues.

Multiple cloths get processed in parallel and so if a garment can be split into two parts, e.g. either side of a belt, then performance will increase significantly both from the parallel processing and also because the constraint network will be smaller Carbon has to do less work and so all round its faster.

Collision will be faster when the character collider is split into multiple meshes so that any parts of the character that are not colliding with the clothing are in a separate mesh(es).