---
id: "unified-particle-physics"
title: "Unified particle physics"
aliases: [FleX]
domain: "simulation"
stage: "simulation"
realtime: "realtime"
platforms: [cuda, desktop-gpu]
year_introduced: 2014
inputs: [particles]
outputs: [particles, mesh]
style: "both"
dynamic: "dynamic"
cost: "medium"
authority: "Macklin et al., 2014"
url: "https://texelatlas.vercel.app/t/unified-particle-physics/"
sources_verified_at: "2026-11-29"
---
# Unified particle physics (Macklin et al., 2014)

> Single GPU particle framework that simulates rigid bodies, cloth, soft bodies, fluids and gases together using PBD-style constraints and two-way coupling.

## Reach for it when

- want fluids, cloth and rigid bodies interacting in one solver
- two-way coupling between liquid and solids
- separate simulators don't interact properly
- mixed-material gpu simulation in real time

## How it works

Every object is a set of particles. Rigid bodies and soft bodies use shape-matching clusters, cloth uses distance and bending constraints, fluids use position-based density constraints, and gases use a variant with an expansion term. All constraint types are solved in the same Jacobi-style loop on the GPU, with a shared uniform-grid neighbour search for collisions, so different phases (cloth versus fluid, rigid versus gas) interact through ordinary contact constraints with mass-ratio scaling. Averaging constraint corrections per particle and applying a relaxation factor keeps the Jacobi iteration stable. This design is the basis of the NVIDIA FleX library.

## When to use it

Choose it for scenes mixing liquids, cloth and solids with two-way coupling in one GPU solver. Prefer [Extended Position-Based Dynamics](https://texelatlas.vercel.app/t/xpbd.md) for a single-material solver with calibrated stiffness, [Position Based Fluids](https://texelatlas.vercel.app/t/position-based-fluids.md) for fluids alone, and [Sequential impulses (rigid bodies)](https://texelatlas.vercel.app/t/sequential-impulses.md) for large rigid-body piles needing accurate stacking.

## Cost

medium — GPU-bound by particle and contact count.

## Failure modes

- Rigid bodies built of particles stack poorly and show surface bumpiness
- Jacobi iteration with large mass ratios converges slowly
- Fluids and gases have visibly artificial viscosity
- Particles must be sized uniformly for the neighbour grid, limiting detail

## Dataflow

- Inputs: particles
- Outputs: particles, mesh
- Platforms: cuda, desktop-gpu

## Sources

1. [primary] Miles Macklin, Matthias Müller, Nuttapong Chentanez, Tae-Yong Kim (2014) Unified particle physics for real-time applications. ACM Transactions on Graphics. https://doi.org/10.1145/2601097.2601152 (verified via crossref on 2026-11-29)
2. [implementation] NVIDIAGameWorks (2017) NVIDIAGameWorks/FleX. https://github.com/NVIDIAGameWorks/FleX License: NOASSERTION. (verified via github on 2026-11-29)

## Cite this entry

Texel. "Unified particle physics." https://texelatlas.vercel.app/t/unified-particle-physics/ (accessed 2026-12-01).
