This project demonstrates how to use NVIDIA FleX solver for GPU cloth simulation in a TouchDesigner Custom Operator. It also shows how to render dynamic meshes from the texture data using custom vertex/geometry shaders and TouchDesigner's PBR lighting functions.
Features:
- Cloth/inflatable simulation with controllable anchor points.
- Triangle mesh collision.
- Spheres, boxes and planes collisions.
- Radial forcefields.
- Many controlable parameters like wind, gravity, adherence, stiffness, etc.
ClothTOP_dali.toe: complex triangle mesh collision with multiple cloth bodies.
ClothTOP_inflatable.toe: inflatable body with dynamic pressure.
ClothTOP_cloak.toe: cloth body with animated anchor points.
- Download FleX 1.2 (get access here).
- Create a new environment variable called
NvFlexDir
that holds the path to/flex
(folder you've unpacked).
- Install the CUDA SDK you want to use.
- Generate the Visual Studio project using CMake.
- Building will automatically copy the .dll to the Plugins folder. If iusing a release dll, manually place it here.
- Open a demo with TouchDesigner 2020.28110+ supported (tested on Windows 10).
- Dali 3D model (download and place the .fbx next to ClothTOP_dali.toe)
- Cloak 3D model (already in ClothTOP_cloak.toe)
- The FlexCHOP by Vincent Houzé provided a starting point for this project.
- Moving anchors too fast can cause crashes with the solver not converging for extreme position deltas.
- Lack of robust error checking for input meshes.