FractureTool is a command-utility for generating destructible assets from regular mesh assets.
It exposes a subset of options provided by the DestructibleAssetAuthoring API, and can be used
for batch processing of simple fracture configurations or as basic alternative to PhysXLab.
For instance, a session to produce a Voronoi-fractured OBJ mesh using 100 Voronoi sites would look as follows:
Again, all of the command-line options are fully described by simply running FractureTool.
Tessellation
A natural way to extend the detail of destructible assets is with hardware-accelarated
tessellation. As a purely graphical effect, run-time tessellation provides additional
visual fidelity without sacrificing simulation performance; it’s a great way to add
roughness and realism to fractured chunks.
By design, the core APEX destruction module provides very little in the way of explicit
tessellation support. However, FractureTool (and in the future, PhysXLab) offers a simple
way to augment destructible assets with tessellated materials. Together with the
SimpleDestruction example, it provides a rough template of how tessellation can work in a
destructible pipeline.
The following command-line sequence illustrates one such example:
FractureTool.exe -mesh block.obj -output block.apb -noise-amplitude .5 -export-material -disp-maps -export-disp-maps
Run with shorthand, we have the following:
FractureTool.exe -m block.obj -o block.apb -na .5 -em -dm -edm
APEX Fracture Tool (Press any key to cancel...)
Loaded \ [==================================================] 100%
Fractured | [==================================================] 100%
Saved | [==================================================] 100%
Success!
Files exported to PATH/TO/OUTPUT/
Displacement Map: blockDisplacementMap.dds
Material: blockMaterial0.xml
Material: blockMaterial1.xml
Asset: block.apb
This command will perform a slice fracture of block.obj. However, rather than adding
actual geometric noise, by specifying -disp-maps and -export-disp-maps, and providing a non-zero
-noise-amplitude, FractureTool generates and stores the noise in a 3D texture (blockDisplacementMap.dds).
The -export-material flag outputs materials for the asset that are compatible with SimpleDestruction.
We can view the tessellated result by running
SimpleDestruction.exe -loadasset block.apb -d3d11
The -d3d11 flag loads the DX11 renderer, which is required for tessellation in SimpleDestruction.
Note: For SimpleDestruction to properly import the asset, the exported texture and material files must be in a directory accessible to SimpleDestruction (typically APEX_INSTALL_DIR/media/APEX/1.4/SimpleDestruction)
In the end, most of the tessellation work is performed in the actual domain and hull shaders. Two such implemenations are included in the Sample framework:
shaders/tessellation/texture_noise.cg
shaders/tessellation/procedural_noise.cg
texture_noise.cg will use the 3D displacement map texture provided by FractureTool. If the -export-disp-maps option is removed when using FractureTool, the generated material will instead use procedural_noise.cg. This shader uses a simple 3D Perlin noise generator to add tessellated detail at run-time.