ChaosCloth initialization performance

Hi,

We are observing kind of a hitch on ChaosCloth initializaction in FClothingSimulation::CreateActor each time we spawn any new character actor that uses cloth.

We are also testing ChaosClothAsset approach, initialization time is pretty similar, it just moved to FClothSimulationProxy::FClothSimulationProxy.

It always happens on main thread and takes up a few ms.

What can we do in general, about cloth initialization, to make faster?

Steps to Reproduce
Spawn any actor that uses cloth.

Hi,

It looks like you’re on 5.5, and there are some improvements being worked on to Chaos Cloth such as the Beta Cloth Editor - notably which contains optimizations to cloth game thread and interactor tick. (https://portal.productboard.com/epicgames/1\-unreal\-engine\-public\-roadmap/c/2189\-chaos\-cloth)

In addition to this, there’s this public issue tracker that shows Chaos Clothing CreateClothActor taking a long time with LODs and Self-Collision, and was fixed in 5.6. (Unreal Engine Issues and Bug Tracker (UE\-204424\))

If you’re looking for more immediate improvements aside from updating, reducing the cloth complexity could help.

A sure way to pin point what part of initialization is taking the most time would be to utilize a profiler like Unreal Insights. This would narrow it down to if it’s the cloth asset, simulation setup, or another area.

Please let me know what you think!

Regards

Hi,

Thanks for all the informations.

We have sucessfully integrated two perforce changes needed to fix mentioned issue UE-204424 (perforce main CL 38186035 and 37460700).

It introduced p.ChaosClothAsset.EnableAsyncClothInitialization, we evaluated this option and looks like it is working, most of the cloth initialization work is now done async.

Regards

Glad to hear it’s working, I’ll be closing this case now but feel free to respond here with any follow up questions or comments. Thank you!