UDN
Search public documentation:

APEXClothing
日本語訳
中国翻译
한국어

Interested in the Unreal Engine?
Visit the Unreal Technology site.

Looking for jobs and company info?
Check out the Epic games site.

Questions about support via UDN?
Contact the UDN Staff

UE3 Home > APEX Framework > APEX Clothing in UE3
UE3 Home > Character Artist > APEX Clothing in UE3

APEX Clothing in UE3


Overview


APEX Clothing is a module of the APEX Framework developed by NVIDIA. With APEX Clothing users can create realistic clothing on their charcters within games. APEX Clothing has been integrated into UE3 and is available to licensees and UDK users. This page provides instructions on how to import and use APEX clothing within UE3.

More information on the APEX Clothing module can be found on the NVIDIA Clothing page.

Getting the Tools


The tools can be found on this page APEX Overview in the "Getting the Tools" section.

Tutorials


The latest clothing tutorials will be available with the tools but can also be viewed here: APEX Tutorials

Importing


  1. Import the Skeletal Mesh and animation files (.psk and .psa) for the asset which will have clothing.
  2. In the Material Editor create a material with the Two Sided? and Used With APEXMeshes? flags set.
    UDN_APEX_Clothing_Material_500.jpg

  3. Import the .apx file that you have created with the Max/Maya clothing plugin.
    Note
    Ensure that you export using the "APEX Clothing" export option and NOT "APEX ARM"
  4. Open the AnimSet Viewer and connect the Apex Clothing Asset to the mesh.
  5. By default, only 1 clothing slot is available. Adding a APEX Clothing node here, will create a new empty slot. 1 slot will always be empty to allow for multiple clothing assets to be added.
  6. There is a new Clothing LOD Map section under Skeletal Mesh. This section is used to associate a Clothing Asset with graphical materials and to manage LOD's.
  7. To associate a APEX Clothing Asset with a graphical material, set the Clothing Section Info of the corresponding Clothing Asset to the Material ID desired. This will replace the graphical version of the mesh section with the APEX Clothing Asset.
    Clothing_LOD_map1.png

  8. Use Clothing Asset Material - On the Skeletal Mesh in Anim Set Viewer, there is now an Apex Clothing section at the bottom. This control allows you to override the graphics material with a substitute graphics material that is defined in the APEX Clothing Asset. This supports multiple materials per clothing asset. The default is unchecked. This means that the APEX Clothing Asset will inherit the material from the skeletal mesh by default. Checking this control on causes all Clothing materials on the given skeletal Mesh to be overridden by their respective Clothing Assets.
    Apex_Clothing_Material_Override.png.

  9. If the override is enabled, Set the materials in the APEX Clothing Node. ( See image in Asset Settings below)
  10. You can use the PhysX Debug menu in order to view various aspects of the APEX Clothing.
    UDN_APEX_Clothing_Debug_Visualization_500.jpg

Asset Settings


You can see the Clothing Asset settings below. The defaults for many of these settings are fine but a few are worth mentioning here.

  • Continuous Rotation Threshold – If your character rotates two quickly in some situations it can cause collision problems with clothing. (i.e.)Character does a complete 180 in one frame. By setting this threshold you can force the clothing to snap to the new position so that it doesn’t have to go through a violent rotation simulation
  • Continuous Distance Threshold - In the case where you character moves an abnormally far distance in one frame you may have an unrealistic physical simulation, which would cause clothing to stretch abnormally. Setting this threshold will teleport the clothing to the new position to avoid adding energy into the cloth.
  • Reset After Teleport - This flag tells the cloth to reset itself after the teleport occurs. This puts the cloth back to the skinned pose and then start the simulation. This can avoid situations where the cloth may have been in an extreme pose and you teleport the player next to an object that the cloth might penetrate otherwise.

UDN_APEX_Clothing_Asset.png

Controlling Behavior During Animation (Choreographing Clothing)


You may have situations where your animations could cause extreme clothing behavior. Such as a jump that may cause a charcter’s cape to fly over their head. Or perhaps you have done some custom animation on your clothing because you want it to flail a certain way in some situations. You can use ClothingMaxDistanceScale Anim Notifies to control the max distance during animations. Using the MSDM_MULTIPLY Scale mode you can scale the existing MaxDistance on the clothing from 1.0 (full MaxDistance set on clothing) to 0.0 (Clothing totally skinned to animation).

UDN_APEX_Clothing_AnimNotifies_01.png

ClothingMaxDistanceScale Anim Notifies should always be used in pairs so that you can smoothly blend into your desired value, and then blend back out to the previous value when leaving an animation.

UDN_APEX_Clothing_AnimNotifies_02.png

Graphical LOD


APEX Clothing can have Graphical LOD's the simulate at their own unique resolutions.

  1. If you have authored your Clothing with LOD's in DCC tools, then when you connect the APEX Clothing Asset to the Skeletal Mesh(the same way as mentioned above), then the Clothing LOD Map for the corresponding Clothing Asset slot will be populated by however many LODs are in the APEX Clothing Asset. In the following example, there is 3 LODs.
  2. Set the clothing Section Info (mentioned above) for each level.
  3. If the desire is to override a graphical material for any clothing LOD, use the material override in the LOD info section of the Skeletal Mesh.

Wind


Wind can be set on the clothing Actors by setting the following

  • Wind Velocity Blend Time - You are setting the target velocity of the clothing verts with these settings. The Wind Velocity Blend Time is the amount of time it takes for the clothing to reach the velocity. A value of .01 should get you a quick response. Setting this value to 0.0 turns the wind off.
  • Wind Velocity Vector - A direction and force for the wind.

In order to get the most interesting behavior (flapping, rolls) when applying wind to APEX Clothing, it is recommended that you set the damping very low, preferably 0. If the damping on the clothing is high you will not see much movement within the clothing.

UDN_APEX_Clothing_Actor.png

Clothing Lag Hints


  • Preventing Lag with Attachments - If you are seeing clothing lag when attaching it via attachments in script try setting the bForceUpdateAttachmentsInTick to true for that SkeletalMeshComponent. Will ensure that the clothing component is updated twice a frame - once in Tick and again when UpdateTransform is called. This comes at a penalty cost but clothing must be updated after the actor has been moved in order to avoid the lag.
  • Lag on Characters - Ensure that actors with clothing have their TickGroup set to TG_PreAsyncWork
  • Tick Order - When debugging in general you can put logging in to ensure that the following are happening in the correct order. (Print out the names with GetPathName to ensure you are seeing the correct actor.)
    • Begin Frame
    • Tick
    • Update Transform (bFinalUpdate is set)
    • Sync Transform

Samples