Community Tutorial: Chaos Flesh

The Chaos Flesh provides high-quality, real-time simulation of deformable (soft) bodies in Unreal Engine. Unlike rigid body simulation, the shape of soft bodies can change during simulation based on their properties.

The Chaos Flesh system supports the simulation of Static and Skeletal Meshes with a variety of parameters - giving artists unprecedented control over the end result. However, the system’s main focus is on the simulation of a character’s muscle deformation during skeletal animation.

The Chaos Flesh system achieves high performance by simulating low-resolution geometry at runtime along with cached results from an offline simulation of high-resolution cinematic-quality geometry.

Learn more about the Chaos Flesh system by following along in this tutorial series.

https://dev.epicgames.com/community/learning/tutorials/BEby/unreal-engine-chaos-flesh

3 Likes

Hey, i cant find deformer solver actor in my engine 5.2, can you tell me why. thank you

I think you’re probably in the preview 1 branch. This functionality should exist in the 5.2 release. However, in the preview 1 branch, I believe all you should need to do is create an deformable solver asset and then drag it into the view.

yes, i created a deformerable solver and drag it into the scene just like GDC 2023 did , but there is no link selection in the flesh asset to associate with the chaos deformer solver. should i download the source version and compile it? Or Wait for 5.2 release

The demos are based off the pending 5.2 release. I have pulled the tutorial until the 5.2 release is made public. Apologies for the confusion.

thx for your tutorial , i’ve learned what i wanted to achieve in a much easier way.Softbody Sim was a little bit complicated before, unreal engine is so amazing!love you guys

2 Likes

time to release!hah, ive already succeed in source version, but wanna know more usages about radial tet and TetrahedralCollection on skeletal mesh :smiley:

1 Like

Hello again. I’ve found that if i create a skeletal mesh blueprint for flesh , the flesh visualization component cannot change material. Is there any solution to change the default chaos flesh material? I tried in dataflow graph but did not work.

You can set the material on the Flesh’s ProceduralMeshComponent, but the tetrahedral mesh should only be used for visualizing the results of the simulation. To render the results in game, you need to bind the simulation results to a skeletal mesh for playback (see Skeletal Deformations). If you have a Nanite mesh, use sample points from the simulation that drive a deformation map and update the geometry using the world position offset (WPO).

Skeletal Deformations : Chaos Flesh | Community tutorial

Sample Simulation Results:

1 Like

Thanks Brice, i’ve already succeed binding the sim to SK mesh yesterday. But i want to use it for a more interesting and interative way.
Just like the video shows, i want to overlap the tet mesh and skeletal mesh, and interact with other actors in real time, so i tried to give tet-mesh a mask material to hide, but keep the interaction.
It failed to change material, and i tried to modify it in ProceduralMeshComponent , not work either.
Thanks for your tutorial, very helpful.

I did it ! Hah ,thank you so much , i used some trick

1 Like

You can also disable the UProceduralMeshComponent using the console variable:

p.Chaos.DebugDraw.Deformable.SimulationMesh 0

Which can be set in a project ini file if you what to ship with it disabled.

1 Like

Thank you so much … :grin: :grin:

Hi Brice, thanks for the great tutorial series!

I was wondering if you’d be able to provide some pointers on how to get those sampled simulation results into a map that can be used for WPO for use on a Nanite mesh?

I’ve been able to get most of it set up but I’m stuck on this wall. Would be much appreciated!

That was set up by one of the rendering artists in the shader graph using the (Get Skeletal Mesh Embedded Positions) node. The idea involves taking the sample positions from the simulation (see Sampling Simulation Results) and using those to build a 2D texture to drive the deformations of the Nanite model. The map is generated by finding the distance between the sampled simulated position from its initial “pre-simulated” position, and then blending those deltas across the UV space of the deformation map. The float values in the deformation map are used as a scalar to displace vertices along the direction of the vertex normal.

There are limitations with this approach in that they only capture displacement in a single direction, so the accuracy of the transfer is tied to the placement of the sample positions relative to the render vertices. This worked for the Rivian tire because the sample positions we used to capture the deformations transferred to the texture reasonably well. There might be a general solution in the transfer process, but we did not take our implementation that far, as it seems like something that should be optimized on a case-by-case basis.

1 Like

Makes sense, I can see why there isn’t an included general solution. Thanks for the response!

I’m excited by the potential of this system! I did have one question after watching the tutorials. If I’m trying to recreate the durometer amount for a plastic, what variable would you say is the most physically accurate to that property? Would that be density or is there something else that wasnt covered in the tutorials that might result in more accurate simulations?

Right now, it’s just mass, stiffness and damping for controlling the material behavior.

We have not tried to measure a real-world material model for tetrahedral simulations, as we are actively developing features around performance and accuracy of the underlying integration scheme. This means that as we refine the simulator, the material properties will be affected as well. I would expect the look of the results to change over the next few updates. However, if you are measuring the material properties of the simulator, that would be interesting information to share.

One thing that comes to mind. The accuracy of the simulation is based on a combination of the mesh resolution and the number of timesteps/iterations. Because the real time version of the solver is running on the edge of convergence it will be difficult to define real world equivalents that work across all cases, but maybe possible for the offline cached simulations. I could see some standard geometry that we use to model real world materials, but as soon as we reduce one of those constraints, the solver is going to produce different results. Again, if you’re measuring this type of information, that would be interesting to see.

1 Like

Great tutorial. Is there a way to apply a physics force like “addForce”/ “addImpulse” while using a flesh simulation? It seems like they’re ignored on the skeletal mesh when simulating.

Hi HongzuoMa1, would you mind telling us the trick? Would require for my use case.