Cloth Simulation on skeletal meshes - Unreal 5.2

TirickTirick Posts: 230
edited August 2023 in Unreal Discussion

Some very very early tests of getting cloth simuation working 'cleanly' in Unreal on characters. I had struggled with this but recently had a breakthrough, and thought I would share some of my findings. A couple of important points:

1. I am not an expert! I am merely mucking around and searching varous sources for solutions. Far too many people to count have made videos, posts, or posed questions to get me here.

2. This was not intended to be used in real-time, although current testing shows it probably can be pushed to get there.

3. Cloth is currently limited (without a paid plugin) to single layers due to the limitations of Unreal's physics simulation process.There are additional limitations on connected materials; you cannot simulate two connected materials in a contiguous way: the cloth simulated mesh is essentially separated from the main mesh of the asset. 

4. I am also using 5.2 with my own (cludgy) control rig, which corrects the weird thigh issues (again, in my own clunky novice way, plugging crap in until it works way).

Results:

(adding a link as images appear to be broken): Cloth Simulation

Second note on the above, this is using my own terrible cloth material (using the Daz textures) so that I can get/test/build a good translucent cloth. I expect there is a material setting suitable in the Bridge assets, but the default doesn't work, and I wanted to learn anyway.

How was this completed? Oddly, quite easily after spending several hours researching and testing. 

I have myself brought the figure in and the clothing in as separate skeletal meshes. This isn't required, but it helps keep things organized. The two are put back together in a character blueprint. 

On the figure physics asset, I deleted all of the auto-generated physics capsules. I then selected the major body part bones (legs, pelvis, spine, arms, twists, pectorals, neck, head) and auto-generated new ones, using the following settings:  Min Bone Size 1, Primitive type: Multi-convex Hull,  Auto Orient Y, Hull count 1 (with the exception of Pelvis, which was set to 2), MAx Hull verts: 4096 (this is untested, I saw little improvement over 2048).

Then, on the clothing asset, I converted the material slot I wanted to simulate to cloth, ensured that it was set to use the figure's physics asset, and weight painted ~20-30 on the parts of the cloth I wanted to simulate. You must keep in mind that unsimulated elements will not follow the cloth, so weight paint 0 on seams. 

Applying the cloth will sometime reveal parts that are not painted completely, so go back to cloth paint and cover areas not simulating correctly. 

In the cloth settings, I then applied a general weight relative to the cloth type and under shared simulation, I set the iteration to 2 and the subdivison to 3. This has produced the best results so far, which can be seen in the link above. 

As I noted above, I am still experimenting on this, but am extremely happy with the results. I am focused on Movie Render Queue and animations at the moment, so your results in live gameplay may be different. I find non-smooth transitions can really play havoc with the cloth, and I am still working through building a good control rig to manage these. As well, because the mesh is actually skinned to the twist bones, separate physics bodies are created for these, at these seams, and at the joint seams, the cloth can sometimes fall through. 

At any rate, I expect to post more as I progress. I aluded to an issue with layers of cloth, which you can see below. The main gown is a separate mesh from the overgown, and both are simulated using the same physics asset. 

link: Layered cloth simulation

At any rate, as clothing simulation was the last real thing holding me back from using Unreal 100% of the time, I expect to post my progress as I explore how to best set this up.

I appreciate your feedback and would love to hear about your own testing and exploration on this approach.

Thank you!

Tirick

 

 

 

 

 

 

Post edited by Tirick on
Sign In or Register to comment.