Introduction
Blast is an NVIDIA GameWorksBlast destruction library. It consists of a Low Level API (NvBlast), a High Level (Toolkit) API (NvBlastTk) (Blast Toolkit or BlastTk), and Extensions (NvBlastExt) (Blast Extensions or BlastExt). This layered API is designed to allow short ramp-up time for first usage (through the Ext and Tk APIs) while also allowing for customization and optimization by experienced users through the low-level API.
This library is intended to replace APEX Destruction. It is being developed with years of user feedback and experience, with the goal of addressing shortcomings in performance, stability, and customizability of the APEX Destruction module.
Asset Structure
Blast is currently designed to support rigid body, pre-fractured destruction. Future versions may support runtime fracturing or deformation.
The static data associated with a destructible is stored in an asset. Assets are instanced into actors, which may be damaged and fractured. When fractured, actors are broken into pieces called chunks. Connected groups of chunks belong to new actors. The grouping of chunks into actors is determined by the support graph in the asset.
Chunks are defined hierarchically, so that when a chunk is fractured its child chunks are created. The user may tag any chunk in this hierarchy as a support chunk. This is covered in more detail in the Support Model section. The user also supplies a description of the connections between support chunks. A bond represents the surface joining neighboring chunks. A bond is represented by a surface centroid, an average surface normal, and the surface area. These quantities don’t need to be exact for Blast to operate effectively.
Multiple chunk hierarchies may exist in a single asset. The root chunks (see Definitions) will be visible when the asset is initially instanced. Subsequent fracturing has the effect of breaking the root chunks into their hierarchical descendants.
Support Model
Blast requires that support chunks form an exact cover (see the definition of exact coverage in Definitions). The geometric interpretation of exact coverage is that the support chunks fill the space of the root (unfractured) chunk, without any volume being covered by more than one chunk. A helper function is provided to modify a set of chunk descriptors so that they have exact coverage. This function fills in missing coverage by assigning support to chunks at the highest place possible (closest to root) in the hierarchy, and redundant support is removed: if a chunk and one of its descendant chunks are both marked as support, the function will remove support from the descendant chunk.
Support chunks that are joined by bonds will be grouped together in the same actor when fracturing occurs. Bonds may be defined between any two support chunks, or between a support chunk and “the world.” There is no corresponding “world chunk,” but the bond represents a connection between the chunk and its external environment. All chunks with a support graph connected to the world will be put into the same actor. An expected use case is to make this actor static (or kinematic). Actors may be queried to determine if they are “world-bound.”
In order to take advantage of the chunk hieararchy to reduce the number of chunks which represent an actor physically and graphically, Blast calculates a list of visible chunks from the support chunks in an actor. These may be the support chunks, or they may be ancestors of support chunks if all descendant support chunks are in the actor.
Support chunks do not have to be leaves in the chunk hierarchy, nor do they have to be at the same depth in the hierarchy. Children of support chunks will always be the sole chunk in their actor, since there are no bonds defined between them. If an actor consists of a subsupport chunk (see Definitions), the visible chunk is the same chunk. The same is true if an actor consists of a single support chunk.
Damage Model
Damage is defined as loss of an actor’s material integrity. This is modeled by a simple health value associated with the bonds and chunks in the support graph. The user applies damage to an actor at a given location, with a maximum effect radius. The resulting loss of bond and chunk health is determined by a user-defined material function. In this way the user can customize the effect of damage based upon the bonds’ properties such as normal and area, as well as distance from impact location.
Damage is applied during the processing of a damage event buffer. After all damage events are processed, bonds with non-positive healths are considered to be broken. Blast performs island detection on the support graph to find all groups of support chunks that are connected by unbroken bonds, and any new islands found result in new actors.
If an actor is composed of a single support or subsupport chunk with subsupport descendants, then there is no bond structure to model damage. Instead, such a chunk is considered to have its own health value, which may be decreased by damage. When such a lower-support (see Definitions) chunk’s health is non-positive, its associated actor is deleted and replaced by actors that represent its child chunks, if any.
The effect of damage on leaf chunks depends upon which API is used. The low-level API does not delete leaf chunks. It is up to the user to delete them, and manage their physical and graphical representation outside of Blast if so desired.