UDN
Search public documentation:

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

Licensees can log in.

Red links require licensee log in.


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


Tools for creating APEX assets may be obtained by following these instructions NVIDIA APEX Tools. Note: UE3 is currently using APEX 1.1. Please ensure that you download the proper versions of the tools.

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"
    Note
    Make sure you do not have the AnimSet Viewer open when doing this or the import will fail.
  4. Open the properties for the Apex Clothing Asset and set the Material to be the UE3 material that you will be using for the clothing.

    UDN_Material_toApex.jpg

  5. Open the AnimSet Viewer and connect the Apex Clothing Asset to the mesh.
    UDN_APEX_Clothing_Material_Applied_Back_500.jpg

  6. 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


In order for clothing to simulate the ClothingAssets array on the Skeletal Mesh must match the number of Materials. If you are setting up graphical LOD on your characters you will most likely need to add additional ClothingAsset slots. This currently only supports clothing at the lowest LOD of the model, and will revert to skinned animation at higher LODs. In the future there will be support for clothing simulation at multiple LOD levels.

UDEN_APEX_Clothing_LOD.png

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

Tips


  • 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

Samples