Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1. First, load your character without cloth as usual into the Character Tool:

Pic1: Character loaded into Character Tool

 

2. Add a new attachment:

Pic2: Adding a new attachment 





3. Name the Attachment and set Type to VCloth 2.0 Attachment:

...

:

...

4. Scroll down to the Debug Files sub-menu and add the renderMeshName, the skin-binding, the simMeshName, the simBinding and the material file:

Note
The cloth bindings you will set in the following steps must fit to the character you have chosen. This means the cloth must be skinned according to the characters joints (see How To - Export VCloth from Maya to CRYENGINE). Otherwise the cloth will not work. This means you cannot simply change clothes between different characters. If the characters have different joints, you need to re-skin the cloth for each character separately.

Pic4: Adding renderMeshName, skin-binding, etc.
Image Removed

 

 

 

 

 

 

 

 

Image Added

 

(you can also change the according *.cdf file directly, which is basically an *.xml file, if that suits you better)

 In case you might want to change the according *.cdf file directly - the content belonging to the VCloth would look anywhere something similar to this:

<Attachment

...

Type="CA_VCLOTH"

...

AName="MyCloth"

...

forceSkinning="0"

...

forceSkinningFpsThreshold="25"

...

forceSkinningTranslateThreshold="1"

checkAnimationRewind="1"

...

disableSimulationAtDistance="10"

...

disableSimulationTimeRange="0.5"

...

b timeStep="0.0070000002"

...

timeStepMax="50"

...

 numIterations="5"

...

collideEveryNthStep="2"

...

collisionMultipleShiftFactor="0"

...

gravityFactor="0.1"

...

stretchStiffness="1"

...

 shearStiffness="0"

...

bendStiffness="0"

...

bendStiffnessByTrianglesAngle="0"

...

pullStiffness="0"

...

friction="0"

...

rigidDamping="0"

...

springDamping="0"

...

 springDampingPerSubstep="0"

...

collisionDampingTangential="0"

...

nearestNeighborDistanceConstraints="0"

...

nndcAllowedExtension="0"

...

 nndcMaximumShiftFactor="0.25"

...

nndcShiftCollisionFactor="0.5"

...

resetDampingFactor="0"

...

resetDampingRange="3"

...

 translationBlend="0"

...

rotationBlend="0"

...

externalBlend="0"

...

maxAnimDistance="0"

...

filterLaplace="0"

...

isMainCharacter="1"

...

renderMeshName=""

...

Binding=""

...

simMeshName=""

...

simBinding=""

...

Material=""

...

debugDrawVerticesRadius="0.0099999998"

...

debugDrawCloth="1"

...

debugDrawNNDC="0"

...

debugPrint="0"

...

hide="0"/>

...

5. Now save your character file and reload it - the cloth should now be visible with the default parameters set.

...

To visualize your proxies, enable Secondary Animation -> Cloth Proxies in the Display Options menu:

...

  1. In the properties, click Attachments -> Add
    Pic6: Adding attachment



  2. A new attachment is created. Now you can name it:
    Pic7: Naming new attachment

3. For Type, select ProxyAttachment

...

5. Select a Joint that will be the parent of the Proxy. Now your attachment should look similar to this:Pic8: Joint selected

6. Set Transformation and Lozenge Parameters according to your character.  You can use the mouse in the viewport to transform the proxy directly on the character.

7. Finally, your scene should look similar to the image below:

Pic9: Lozenge body

Now repeat the process for all body parts that are needed for collision handling of the cloth.

...

In the picture above, no collision proxies have been set. The cloth is only held by attached vertices and is not interacting with the body (see intersections with legs).

Pic11: Collision Proxy Setup
 

In the picture above, a rough proxy setup (left) ensures cloth interaction with the body. Hands normally result in intersection problems (especially while the character is running); big proxies might solve this problem in practice. However, due to the complexity of movements and sometimes intersections with the body, to improve stability, it is often recommended to not use proxies for hands at all.Pic12: Simple floor proxy

A simple floor proxy moves with the characters and works well for flat surfaces.

Pic13: Rough proxies

Rather rough proxies normally work better in all possible situations than filigrane, accurate ones.

...

If your cloth is hi-res and still too elastic, you should try out the LRA - Long Range AttachmentsNNDC - Nearest Neighbor Distance Constraints, this is a sophisticated algorithm to decrease elasticity strongly. It might work, or not - that depends on the topology of your cloth. But if it works, you can normally decrease the values in Stiffness and Elasticity and more importantly for performance, the number of Coll./Stiffness Iterations.

If you use Long Range Attachments (LRA Nearest Neighbor Distance Constraints (NNDC), keep in mind:

  • CRYENGINE implements a strongly improved adaption of LRAsNNDCs. These are used to enforce the elongation of the cloth. Hence, it reduces the elasticity/springiness of the cloth strongly.
  • LRAs NNDCs use mesh topology to reduce elasticity along paths to the closest constraint/attached vertices. Depending on your mesh, these might work impressively.
Note
  • Leave the parameter LRA NNDC shift collision factor untouched at 1.0 - otherwise there might be flickering.
  • LRA NNDC allowed extension should also be left at 0.0, since it works pretty fine with this value.

...

Context/Parameter

Value/Size

Performance

Ideal Value Range

Simulation Mesh

Less vertices

higher

ca. 500 - 1500

No. of Coll./Stiffness Iterations

Smaller

higher

3-4

No. of collision proxies

Smaller

higher

8 -12Long Range Attachments

Nearest Neighbor Distance Constraints

Enable

Equal, but much stiffer cloth possible

Enable

If cloth flickers, you need to disable this value and tweak stiffness via Stiffness and Elasticity values and increase no. of iterations with Coll./Stiffness Iterations.

...

  • Skinning:
    • ca_DebugSWSkinning
      By enabling this variable, the skinning of the render mesh can be explored.
  • Simulation:
    • ca_DrawCloth
      Set this variable to 2 to use the visual debugging features of the VCloth 2.0 Attachment in the Character Tool(can be found in the Debug section in the Parameters of the attachment).

Pic15: Debugging views
 

Left: Original
Middle: ca_DebugSWSkinning enabled [skinning]
Right: ca_DrawCloth = 2 [simulation] (Result depends on Attachment Debug Parameters) 

...

The effect of each of these parameters is described below.

Pic16: Debug simulation
Image RemovedImage Added

Draw Vertices Radius

...

  • Change Radius of Drawn Vertices

  • Color Encoding: green (unconstrained), green to blue (intensity of confinement), Red (fully constrained).

Pic18: Different Draw Vertices Radius Sizes: 0.01 (left), 0.02 (middle), 0.04 (right) - colors indicate the strength of confinement

...

  • 1 - draw stretch links
  • 2 - draw shear links
  • 3 - draw bend links
  • 4 - draw all links (stretch, shear and bend)
  • 6 - draw particle positions (simulation position and skinned position, additionally, previous step position)
  • 7, 8, 9, 10 - draw determined bending triangles, including actual normal with different length (7..10 - descending order)

Pic19: Left: Stretch links (Parameter: 1); Right: Stretch, Shear, Bend links (Parameter: 4)

Pic20: Bending triangles 
 

In the above picture, all edges between two neighboring triangles are drawn, as well as all normals of each triangle.

Parameter: Draw

...

Nearest Neighbor Distance Constraints

Note

Ensure console Variable ca_DrawCloth is set to 2.

Using this parameter, a detailed visualization of generated long range attachments Nearest Neighbor Distance Constraints data can be enabled.

  • 1 - for each vertex, draw closest 100% attached vertex
  • 2 - for each vertex, draw closest 100% attached vertex (ordered by distance to closest attached vertex)
  • 3 - for each vertex, draw connection to next neighbor, which follows on the path over the simulation mesh to the closest 100% attached vertex

...

Left: Parameter: 1 - Closest attached Vertex (if vertex is attached, or no connection is found (e.g., disconnected islands), a red line is drawn to the right); Middle: Parameter: 2 - Closest attached Vertex, ordered by distance);
Right: Parameter: 3 - Next neighbor on the way to closest attached vertex - if this connectivity is not resulting in kind of straight lines, long range attachments Nearest Neighbor Distance Constraints should be disabled.

Parameter: Debug

...