Rigid Body Fx For Games Using Houdini & Unreal Engine (Part 2)
In Part 1 of the blog, we have seen how we can use baked rigid body simulation data inside game engine for various purposes. Now in Part 2 of this blog, we will go through the process of doing rigid body destruction in real-time.
In order to do it in real-time, we will look into the Apex Destruction plugin in Unreal which helps to create destructible asset with fracturing and
to assign physical properties which helps in the calculation of
simulation.
Rigid Body Destruction (Real-time solution)
The above destruction of assets is done at runtime based on defined number of fracture pieces. We can either define the fracture patterns in engine itself or can import the fracture asset and use it in the engine. Let us have a look at those options.
1. In-Engine Fracture
As shown above, Voronoi method has been used to fracture the pieces. This is a quick in-built fracture solution for preparing the destructible assets in engine without depending on any other DCC apps. However, it has very limited fracture options and it is not possible to get different types of fracture shapes like wood splinters, glass crack, and so on.
As you can see the above destruction is done using the fracture data within the Engine. This can be used for simple breakable effect where not many details are required. However, in order to get more details in fracture pieces, external application like Houdini can provide us with good solution.
2. Houdini Fracture
(RBD Material Fracture in Houdini) |
Here the fracture has been done in Houdini which provides more variations in the fracture pieces. There are multiple fracturing methods within Houdini like Boolean fracture, Voronoi fracture, rbd material fracture. Here I have used rbd material fracture method.
(Asset Fracture Comparison) |
Post fracturing the asset in Houdini, we need to export the rbd pieces to fbx. Then the fbx can be imported into the engine using the import option within the 'Destructible Mesh' window. The difference between in-engine fracture and Houdini fracture data can be seen clearly in the above image.
Let us see what results we get in the rbd effect with both the destructible mesh assets. The imported Houdini asset provides more detailed result in the simulation.
(Impact Dust Particle System in Engine) |
I have also created a Niagara dust particle system and attached it to the destructible mesh asset. This helps to add more impact and thus selling the overall effect nicely.
Performance and Optimization
The real-time destruction of assets definitely adds costs to runtime calculation. Thus, optimizing the fractured assets are very crucial. We can get rid of any extra geometry inside the fractured pieces and the poly count of the pieces can also be reduced. If a scene comprised of lots of destructible objects, the non-interactive objects, which is getting destroyed, can be made use of cached data instead of real-time data.
My Thoughts
The solution for rigid body destructible system for games has many challenges. Whether it is a baked solution or a dynamic runtime one, the key is to have a balance between visual impact and runtime performance.
There are other solutions like Chaos Destruction systems in Unreal which provides lots of possibilities and someday I would definitely like explore that too.
So, keep checking out for more content like this. Until then keep developing and keep gaming.
Cheers!
Resources:
Comments
Post a Comment