Skip to content

Experimental Cloth – Using XPBD Cloth in Blender 5.2

If you’ve kept your ear to the ground in the Blender community you may have heard a little bit of excitement brewing about a new simulation system that has been added as an experimental feature in Blender 5.2.

Using Cloth Dynamics in Blender 5.2

I’ll talk more about the actual details of the new system later but for those itching to just know how to use it, because it works a little differently to current cloth sims, let’s get straight into it.

IMPORTANT!
Cloth Dynamics currently lacks both Pressure and Self Collisions. I’ll talk about why later but they will likely be added in the near future.

We’ll just make a simple cloth dropping onto a sphere as a classic example. First let’s add a sphere, you can use whatever you like but I like the Round Cube added by the Extra Objects add-on that can be downloaded from Blender Extensions, and we’ll shade it smooth and I’ve added a subdivision surface too.

Smooth Shaded Round Cube

Now let’s make it a collision object. Head to the modifiers tab and search for Collider, you can also find it under the ‘unassigned’ category, I assume it will be moved/categorised when Blender releases.

‘Collider’ modifier in the ‘Unassigned’ menu

The default settings should be fine for now, just move it above your subdivision surface, if you also added one. The order only matters in that you usually want to use the original mesh rather than the subdivided mesh as it is computationally less intense to process.

Default Collider settings

Now let’s add a plane, move it above the sphere, scale it up by 2.5 and then subdivide it 50 times.

Subdivided Plane

Your object still needs enough geometry to ‘become’ a cloth, no change there.

WARNING!
It is important to note that if you do not subdivide your plane at all, essentially making it 1 large face, it will fall through your sphere rather than the collision acting like a large solid object or it bouncing off.

Now you can add a Cloth Dynamics modifier which is also under the ‘unassigned’ section.

‘Cloth Dynamics’ modifier in the ‘Unassigned’ menu

If you play the simulation now your plane will fall straight through your sphere. One major change in the new system is that you must tell the Cloth Dynamics modifier what collision objects it can collide with. Previously this was optional, now it seems to be required. The easiest way to do this is to throw your sphere into a collection via the outliner.

Collision collection layout

A simple collection layout as shown on the left is fine. The benefit of forcing this system is speed, the simulation doesn’t have to ‘care’ about every object’s collisions. You can organise collision objects for different sims better.

Under effectors select your collision collection. You can also adjust the Gravity, Structure, etc, but for now let’s leave them at the defaults.

Cloth Dynamics setup

If you now hit play, pull open a timeline or dope sheet view to control things, you should see the simulation play. One thing you should immediately notice is how smooth it is, I get almost 60fps stable on a Ryzen 5700X /RTX 3060 12GB.

Massive performance improvements aside you might notice how stiff the cloth seems. This is mainly because the default settings are set to 0 Stretch and 0 Bending. Here is a comparison between the new Cloth Dynamics and the old cloth simulation.

Note: Playback is a little slower because the old cloth simulation means real-time playback was only 15fps on my PC.

If we adjust the stretch and bendiness we can get it to behave more like the older system. Please do keep in mind that this is experimental, I’m sure it’ll be improved in the near future!

Old cloth simulation VS new with adjusted stretch & bend constraints

Note how low the values are for Stretch (0.110) and Bend (0.187). I’ve noticed they are very sensitive so while I do recommend experimenting, I’ve found anything above 0.25 starts to turn into sheets of slime.

From experimenting the exact results depend on a mixture of vertex weight, stretch, bending, linear damping and gravity. That seems obvious when you think about it, but my point is to make sure to consider each variable when trying to dial in some settings.

XPBD and the Future of Blender Simulations

Let’s get something out of the way for all of the people who are determined to be pessimistic. This is still experimental! Not hidden behind a flag or an experimental build, but experimental in the sense they probably shouldn’t replace your existing cloth workflow quite yet.

I suspect the idea is to get XPBD into blender as the start of a new unified solver system. I am not qualified to explain what exactly XPBD is, but I do know that it is not the cloth simulation or the hair simulation. XPBD is a constraint solver which can be used to create a cloth simulation, a hair simulation, even soft-body and rigid-body dynamics (and more!).

Adding it to the LTS release is a really good idea. The version they have added seems extremely stable, and it means people who need to stick with LTS versions will have access to the base XPBD solver allowing them to build upon it themselves if needed.

Cloth Dynamics – Pressure Bonus

As I mentioned earlier the current version of the Cloth Dynamics node does not have self-collisions or pressure. I can’t help with self-collision. I can, however, show how to add a very basic pressure system.

Pressure could be represented as a force pushing in the normal direction

Pressure, or at least fake pressure, can essentially be simulated as a force pushing in the same direction of the normals. Yes, I know this is not accurate, it should really be a volume constraint, but if you just want something to approximate pressure it is definitely a viable option.

Based on a conversation I had with someone way more qualified in the physics of pressure, I believe if you want a little more accuracy you can opt to scale the normal by the face area (using the face area node) and then use another vector scale to increase the strength by a lot. By a lot I mean by something like 10,000. I haven’t noticed too much difference in my simple tests though. The result is passable, especially for cushions, simple bean bag chairs, etc.

Simple pressure test inflating a cube

Is XPBD in Blender really useful?

Yes! It is honestly an amazing first step to a unified solving system similar to Vellum (Houdini). That’s not to say we are anywhere even close yet. We have to stay realistic, these are first steps and there is still a way to go yet, but it is here and has the potential to be a huge overhaul of Blender’s disparate simulation systems. I’m honestly excited to see what the future holds!

Published inUncategorized

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *