IN THIS ARTICLE
Cloth for Mesh components
To use Cloth, you must enable the NVIDIA Cloth gem. For more information, see the NVIDIA Cloth Gem documentation.
You can create cloth assets for entities with Mesh components in the content creation application of your choice and import them into O3DE from an
.fbx file. The mesh asset should have the following:
- A cloth mesh that will be simulated and rendered in O3DE.
- Cloth data can be added to define per vertex mass and constraint properties using the vertex color tool in your content creation application. For more information see Per vertex properties for cloth.
- Optional - Any other static mesh. For example, if you create a flag to be simulated as cloth, then you can include a mesh for the flag pole.
Note:Sample Mesh component cloth assets are located in the NVIDIA Cloth gem directory, which is located at
For information on exporting mesh assets, see FBX Settings mesh export.
Add Cloth to Mesh components
Create cloth by adding the Cloth component to an entity that has a Mesh component, and then setting the properties of the Cloth component.
In O3DE Editor, add a new entity to the level.
Add a Mesh component to the entity, and reference the mesh asset and material.
Add a Cloth component to the entity.
Set the cloth data of the mesh asset.
- Click the button beside the Mesh node property to open the FBX Settings window.
In the FBX Settings window, on the Meshes tab, and choose Add Modifier, Cloth.
In the Cloth modifier area:
Select the cloth mesh from the drop-down list.
When applicable, select the vertex color stream and channel that includes the Inverse Masses data. If data is not provided, then cloth defaults to an inverse mass value of 1.0 for all vertices.
When applicable, select the vertex color stream and channel that include the Motion Constraints data. If data is not provided, then cloth defaults to a motion constraint value of 1.0 for all vertices.
When applicable, select the vertex color streams and channels that includes the Backstop Offset and Backstop Radius data. If data is not provided, then no backstop constraints will be applied in the simulation.
Choose the Update button. Asset Processor then updates the asset and includes the cloth data.
Configure the cloth component.
- Select the cloth mesh node from the drop-down list.
- Adjust cloth properties to obtain the desired cloth behavior. For more information, see Cloth Component.
View the Cloth Simulation
In O3DE Editor, press Ctrl+G or press the Play button to run your project.