The real-time destruction tool allows for the creation of objects that can be destroyed in real-time by the player. Because the objects are destroyed in real time, the player has complete freedom over what they want to destroy and the destruction looks different each time the object is destroyed. Objects can also behave different depending on which material they are, for example, a window will have completely different destruction patterns than a door.

Try out the Real-Time Destruction demo (Download)

Features:

  • Algorithms that are optimized to generate destruction patterns in real-time.
  • Fragmentation patterns, which are different for each type of material and can easily be custom made by a user.
  • Tools for creating walls, windows, tables…

Creating Destructables

In the editor, there is a tool that allows the user to draw polygons in any 2D shape the user wants and can contain as many points as the user wants.
This shape can also contain other polygons which can make holes in the shape to create windows, door holes, or other shapes.
When the shape is finished, it can be converted to a 3D shape like a wall, table door, window…

Using Delaunay triangulation, it is possible to create a 2D polygon from the 2D shape. This polygon can then be mirrored over its depth to create 2 different polygons at a set distance apart. These polygons can then be connected using quads to fill up the sides and finish the 3D model.

Fragments

Before destroying an object, the fragments for the destruction have to be generated. These fragments can be small or large chunks that fall of the object when it is getting destroyed.
Most of these fragments are parts of a voronoi pattern that can be tweaked by the user. But other patterns, like a spider web shape are also possible.

These fragment patterns can be of different sizes and shapes depending on which type of material is used. Glass for example breaks completely different compared to brick or wood, making it more realistic than using the same type of destruction for everything.

To make the destruction feel different each time, multiple fragments are generated at load time and can be used during runtime. It is also possible to generate the fragments during runtime, but it takes a considerable amount of time to generate those patterns.

Destruction

When an object is hit by a projectile, the impact point is transformed to be usable in the 2D shape.
Then a fragment is generated at the 2D location of the impact point. Each fragment in the pattern is then subtracted from the destructible 2D shape to create holes in the destructible object.
The fragments are also compared with an and Boolean operation with the destructible object to make sure no new geometry is generated.

Finally when all fragments have been subtracted from the destructible, the destructible is converted to 3D again, but this time with the new holes. and The new fragments are also converted to 3D meshes. Then an object pool for the fragments is used to spawn them in the world.