Unreal Engine 4 cloth simulation tips

Jul 08, 2020 at 10:00 am by nemirc


Working with cloth simulation in UE4 is not really that complicated. Previously, you had to create your APEX clothing in an external application, but now that clothing is created directly inside UE4. I already discussed cloth simulation in my Unity user explores Unreal Engine 4 series, so I won’t repeat my words here. I wanted, however, to share a few tips I learned when working on the dress for my character, Amelia. 

Tip 1: Decide which parts to simulate. 

If you have used cloth simulation in Maya (I am not sure if this is similar in other applications), then you know your entire object is turned into cloth, and you modify the behavior using constraints. For example, if you want part of your cloth to stick to your character (like the collar of a t-shirt) you use constraints to do it. 

In UE4, when you turn your outfit into cloth, you use the Cloth Paint brush to paint the parts of your cloth that will move and the others that will be deformed by bones. In the Cloth Paint brush settings, you can set a max value for painting, and everything between that max value and 0 will be affected by both in some degree (for example, a value of 50, with a max value of 100 means that point will deform 50% by following the cloth simulation and 50% by following the bone skinning). For Amelia, I decided where I wanted the simulation to start, and then used a gradient to make it gradually go from 0 to 100. 

Tip 2: Weird normal artifacts. 

Adding the cloth simulation to my character’s dress caused a weird rendering artifact. The geometry remained the same (I know because I checked the wireframe) but the rendering looked wrong, like the normals were breaking. You can see what I mean in the image below. 

I found that checking the “Recomputer Tangents” box for the section that has the cloth simulation (under the LOD section) fixed the issue. If you are using multiple LODs and they all have clothing simulation, you will have to do this for all of them. 

Tip 3: Multiple Physics Assets. 

Cloth simulation in game engines works differently than pre-rendered graphics. While Maya lets you set your character’s body as collider for your cloth, UE4 requires you to create a Physics Asset for cloth collisions. One important thing to know is that the Physics Asset used for your collision doesn’t need to be the same as the one used for your pawn’s skeletal mesh. This is important because it means you can have a custom Physics Asset just for cloth collisions. 

Tip 4: Crazy collider setups. 

This is somewhat of a continuation of the previous one. When I was browsing the UE4 forums to learn more about working with cloth, I found a comment that said “you can’t make tighter clothing in UE4.” Obviously, if you plan to make some sort of really tight clothing (like a bodysuit or a leotard, swimsuit, etc.) you wouldn’t bother setting up cloth simulation since the cloth is “sticking” to the body (wrinkles can be managed with normal maps). However, I was making a dress and I needed to make it follow the girl’s curves below the waist line since making a looser dress was not something I wanted. 

Actually, you can make a form-fitting skirt if you put enough work on it, like I did. To make the dress follow the character’s curves, first I created a very complex setup for my Physics Asset (previously I mentioned how you can use a custom Physics Asset for the clothing, so I created a second one just for the dress collisions, while keeping the original one for the overall physics). 

The hips bone has 2 capsule colliders, along the hip bone axis, and 4 sphere colliders (2 for each buttock). You can see how they are placed in the image below.  

On the other hand, each leg has one sphere collider and one tapered capsule collider. The sphere collider is used to keep the volume of the lower buttock area, while the tapered capsule is used to simulate the shape of the thigh. 

Overall, the plan was to get a collision that followed the girl’s curves as close as possible, with strategic collider placement. You need to keep in mind that there’s a limit to the number of colliders you can add. If you add too many, previous colliders automatically disable, so you can’t just add countless colliders to get the result you want. This is why I added a third sphere collider to the leg bone, rather than the hip bone. 

Tip 5: Cheating with geometry. 

Sometimes, no matter how much you try, parts of the skin will still get through the clothing. To fix this I modified Amelia's body to slightly decrease the size of her butt and hips, so there was enough space between the body and the dress so the dress doesn’t intersect with the body. In the image below you can see a comparison between the original model (blue) and the modified model (green). 

While I made those modifications to the body mesh, the “volume” of the dress is the same, and thus the perceived volume of the body. If you overlay the dressed model and the “underwear-only” body, they both have pretty much the same volume. 

And those are the tips. I hope you found them useful when working with cloth simulation in UE4.  

Get Unreal Engine: https://www.unrealengine.com/en-US/get-now 






Sign up for our newsletter

This website uses cookies to ensure you get the best experience possible More Info
Got it!