Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

1. Cloth Setup

  • The VCloth in CryEngine needs two meshes: One mesh is used for simulation and one mesh is used for rendering - the latter mesh is skinned according to the simulated mesh. While possible to use the same mesh, it is recommended to tweak the simulation mesh according to your needs. Additionally, you might use a hi-res mesh for rendering and a low-res mesh for simulation, which would improve the overall performance strongly.

Create a Simulation Mesh out of your Render Mesh.

  • Cloth simulation in general is an expensive process, so the simulation mesh should be kind of low-resolutional.
  • Best results are achieved with a clean and homogeneous edge-flow, since the edges are used directly within the simulation.
  • For performance reasons, the simulation mesh should contain lower resolution than the render mesh. A clean edge-flow of the simulation mesh improves quality. The render mesh is used for visual representation and is animated by skinning according to the simulation mesh.

A hi-res render mesh and a lo-res simulation mesh is used for cloth simulation in CryEngine.

 

  • The cloth mesh needs vertex colors (greyscale) applied, which represent the constraints of attached vertices. Hence, vertex colors define the relationship between cloth physics and original skinning.
    • Typically, virtual cloth is constraint around shoulders and other fast moving body parts, or in areas, where a cloth should not move physically, but is rather skinned. Black vertex colors indicates a full constraint (which basically means, the according vertex positions are determined by skinning). White vertex colors indicate unconstraint vertices, whose movement is determined entirely by the simulation. Grey values in between indicate the strength of simulation vs. skinning. Thus, fine transitions between fully skinned and fully simulated areas can be defined.
    • At the end of the process, your cloth should look something like this in Maya:

2. Cloth Export to CryEngine

CryEngine needs some additional meta-data for cloth meshes. These meta-data can be generated by the ressource compiler (RC) of the CryEngine. However, if the meta-data is missing, these data sets are generated by the CryEngine on the fly - which would result in stuttering at run-time, since the preprocess is kind of too expensive for a smooth run-time experience. Thus, it is strongly recommended to use one of the following exporting methods, to include the meta-data in the exported skin file.

There are two ways of exporting cloth to the CryEngine. If you got the latest exporter-plugin, the exporting process is fairly simple and is described in the following. If your plugin is outdated, you might use the second way of exporting.

2.1. Method 1: Export - using Plugin

  • Open the "Export old" plugin from the Crytek Maya Plugins:

 

  • In the Exporter:
    • Set "Export Path"
    • Select the simulation mesh
    • Select the "VCloth Pre-Process" Flag
    • Set the "Custom Export Path"

  • The render mesh can be exported the same way, but the "VCloth Pre-Process"-Flag is not needed for exporting, resulting in smaller file size.


2.2. Method 2: Export - using RC command-line commands

  • Open the "Export old" plugin from the Crytek Maya Plugins:

 

  • In the Exporter:
    • Set "Export Path"
    • Select the simulation mesh
    • Set the "Custom Export Path"
    • Open "CryEngine Settings"
  • In the Tab "Resource Compiler" add the command line option: "/forceVCloth" 
  • Now close the CryEngine Settings Manger and export the simulation mesh by clicking "Export Selected"
  • IMPORTANT: Now open the CryEngine Settings Manager again and remove the option "/forceVCloth", since this is a global option. If you don't do this, all following exported skins (including NON-CLOTH!) would store the cloth-metadata, which is totally unnecessary and unwanted and would increase file-sizes unnecessarily!
  • The render mesh can be exportet the same way, but without specifying the "/forceVCloth" command-line option.


  • No labels