logo80lv
Articlesclick_arrow
Research
Talentsclick_arrow
Events
Workshops
Aboutclick_arrow
profile_loginLogIn

Cloth Simulation for Games: Difficulties and Current Solutions

We've talked to character artists, game developers, and animators, discussed why is it so hard to create complex and realistic cloth simulation in games and revealed what the current solutions are.

These days, games are getting more realistic with high-quality graphics and a handful of tiny details added to the game’s world. Characters animation has leveled up and relies on motion capture techniques even more heavily now. However, one thing about character production is definitely missing. Clothes simulation seems to be not so advanced if compared to the rest of the CGI used in the game development.

For instance, here are 5 most well-known and critically acclaimed titles with a complex game world and storyline, yet, plain clothes such as ropes and one-piece long clothes with a fairly simple simulation in them. 

  • Horizon: Zero Dawn 

  • The Witcher: Wild Hunt 

  • Dark Souls III

  • Assassin’s Creed Odyssey 

  • The Last of Us 

So, why is it so hard to achieve diverse clothes simulation and keep it on the same level as the rest of the game’s world and characters? 

Before we dive into the challenges of creating a realistic cloth simulation, let’s get a general idea of how the cloth simulation (or deformation) works. Anda Deng, character artist, gave an in-depth look at the simulation process itself and explained the complexity of it:

“You can think about cloth simulation as cloth animation which contains a number of frames. In order to have different shapes of the cloth when stretching, wrinkling, it needs to generate different .obj files for the cloth animation. One frame = One .obj file. Let’s say one .obj file is 2 MB, just imagine how many frames it takes to finish one complete motion. 

It’s impossible for a game engine to handle such a large size of files. Another thing is that the game engine itself doesn’t do cloth simulation, it needs to do a simulation in Marvelous Designer first. How good is the simulation depends on how good the body animation is. Cloth thickness could be a big problem for a bad simulation as well, if you add thickness, basically, it means that you double the file size, and it also makes it a lot harder for simulation to run smoothly”.

by Anda Deng

Erasmus Brosdau, the founder of Black Amber Digital, also points out that cloth simulation isn’t only about wrinkles and stretching, it’s also about changing conditions, different fabrics behavior, layering pieces of clothes, and so on:

“However, cloth simulation is a chapter on its own as an infinite amount of deforming scenarios can be imagined and the user expects it just to look realistic. What if the cloth is wet, tears apart have different elements of fabric over it, etc. Another aspect is the fact that cloth simulation becomes more accurate the more polygons a cloth mesh has. Imagine a flat plane with only a handful of polygons, you can guess that this geometry will not look great if you try to simulate this as a curtain, or something like this. As a result, you increase the polycount, the simulation starts to look better, but it also becomes much more time consuming to simulate - this is one of the core problems. Characters wearing a shirt underneath armor pieces, etc would all need to be simulated frame by frame and taking all colliders into consideration like the body underneath the shirt, the armor parts, leather straps, etc. And that’s a massive amount of performance only spent on simulating a shirt, think about the rest of the scene - gameplay logic, enemy AI, player input, graphics, effects, post-processing, etc.”

Talking about implementing clothes simulation in games, Shaafi Ahmad focused on the technical side of it and explained the complexity of it by a mix of variables used to store information: “Games have a lot of complex variables interacting with each other and realistic cloth simulation is just another variable in the mix. It's a variable that is inherently taxing on the hardware and was usually left out or imitated with different methods”.

by Shaafi Ahmad

Animator Alex Yaremchuk focused on the ability to control clothes behavior which is hard to maintain: “In general, cloth simulations are hard to control. There's a gap between real-life fabric behavior and any type of simulation. Simulations tend to break and glitch more often than not. So it's especially difficult to set up a system that works in real-time on the user machine with as few glitches as possible. That requires extra time and extra budget (unless it's something super basic)”.

It becomes obvious that the key issue is the capability of the used software for the development and tech for playing to handle, store, and constantly update such an amount of data.

Currently Applied Pipelines and Software Systems

To avoid implementing any data-based solutions, game developers rely on a few technical workflows and one simple but essential rule - “ no cloth simulation for smaller objects”. What’s the reason for the rule? Erasmus elaborates on it:

“Because of all these factors the decision for game developers is easy at this point: No simulation at all on smaller objects. Usually, only big cloth elements are being simulated like capes. This process can be simplified luckily as these big cloth elements usually only need to collide with one thing: the entire body. And for that process there is always a proxy object being used for checking collision, mostly various forms of spheres and capsules. The more closely you look on games with these big cloth dynamics, you can also very often see intersections with the geometry of the body.”

To see the rule in action, Erasmus gives a few examples to take a look at:

“Dark Souls is always a good example: Many outfits have capes or long hanging cloth parts and they all get simulated - but in such low quality that they intersect pretty much everywhere. As the overall graphics are not that impressive anyway, nobody really notices though.

The more realistic your graphics become, for example Uncharted 4, the more obvious it becomes if the cloth is not properly simulated and only 100% skinned to the character. Uncharted 4 for example uses a trick of blending normal maps for cloth wrinkles in and out when the player moves. It gives the impression that Nathan’s shirt is really stretching left and right, it looks great. This trick of course only works on cloth elements very close to the body.” 

When it comes to actual technical solutions that can be used, there are only a few of them: 

  • Using an A pose low poly model that sticks to the skeleton of the character and moves together with it when animated. There are a handful of tutorials on how to do it in Unreal Engine, using NVIDIA Apex.
  • Using GPU-based solutions. For this one, artists use an open-source real-time physics engine from NVIDIA - NVIDIA PhysX and Havok Physics/Cloth. NVIDIA PhysX works with wireframes, however, the number of frames is definitely high for consoles to handle such simulations. Such a workflow requires advanced tech and more computing power for both developers and consumers therefore can’t be used in a common pipeline. 
  • In 3D art, the forementioned by Anda Deng Marvelous Designer is a breakthrough in terms of cloth simulation production and its optimization. The software applies traditional 3D modeling to the cloth simulation, allows artists to create custom reusable assets, and includes a feature of pin animation. 
  • Besides that, most common and free tools like ZBrush and Blender offer tools for clothes simulations that can automatically develop physics to create realistic deformation. The software also comes with brushes to add wrinkles manually. 

 

What Are Possible Solutions in the Foreseeable Future?

Since the key issue of creating a realistic cloth deformation is the computing power, future technological upgrades will definitely give game developers a bit more freedom in their simulation pipelines. New powerful next-gen consoles, PS5 and Xbox Series X bring the possibility to have a higher number of frames compared to the current closer. AI-based algorithms, integrated into engines and tools, can also optimize the framework hence leading to more believable clothes behavior. 

However, cloth deformation alongside with fluid and destruction simulations remain the most difficult to build, and all these simulation types require procedural-based tools and give a little to no space for optimization for games.

Interviews are taken by Ellie Harisova

The cover image is a shot from Zenobia by Erasmus Brosdau and his team.

Join discussion

Comments 1

  • Anonymous user

    great article, but there is something that is not correct in any way:

    "Cloth thickness could be a big problem for a bad simulation as well, if you add thickness, basically, it means that you double the file size, and it also makes it a lot harder for simulation to run smoothly".

    This is false, thickness has nothing to do with the file size.

    0

    Anonymous user

    ·4 years ago·

You might also like

We need your consent

We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more