---
id: "cosserat-rods-pbd"
title: "Position & Orientation Based Cosserat Rods (GPU Hair & Cables)"
aliases: [Direct PBD Stiff Rods, Cosserat Rods]
domain: "simulation"
stage: "simulation"
realtime: "realtime"
platforms: [desktop-gpu, cuda, webgpu]
year_introduced: 2018
inputs: [curves]
outputs: [curves, animation]
style: "both"
dynamic: "dynamic"
cost: "cheap"
authority: "Deul et al., 2018"
url: "https://texelatlas.vercel.app/t/cosserat-rods-pbd/"
sources_verified_at: "2026-12-02"
---
# Position & Orientation Based Cosserat Rods (GPU Hair & Cables) (Deul et al., 2018)

> Simulates elastic hair strands, ropes, wires, and botanical stems with coupled stretch, shear, bend, and twist using quaternion-oriented Cosserat rod segments solved in Position-Based Dynamics (XPBD).

## How it works

Simple mass-spring chains cannot represent torsion (twist) or stiff bending without tiny timesteps. Cosserat rod theory equips each segment between particle nodes with a unit quaternion material frame (Darboux vector) tracking twist and curvature directly. Deul, Kugelstadt et al. solve stretch-shear and bend-twist constraints directly in a fast position-and-orientation PBD/XPBD loop—delivering unconditionally stable, twist-accurate strands, cables, and curls in real time on the GPU.

## When to use it

Choose for real-time curly hair, catenary power cables, ropes, whips, shoelaces, and flexible stems where bending stiffness and natural twist coupling matter.

## Cost

cheap — Parallelizes per-strand in compute shaders; thousands of strands run at <1ms on desktop GPUs.

## Failure modes

- Very high stiffness ratios with low sub-step counts still exhibit slight stretch unless solved with direct tridiagonal passes
- Dense strand-to-strand friction requires spatial hashing or continuum grid coupling

## Dataflow

- Inputs: curves
- Outputs: curves, animation
- Platforms: desktop-gpu, cuda, webgpu

## Presets

### Cosserat Rods — animated elastic bend-and-twist strands under wind forcing (glsl-fragment; rendered 2026-12-02)

```json
{
  "P_STIFF": 0.65,
  "P_WIND": 1
}
```

```glsl
const float P_STIFF = 0.65; // P Bend Stiffness [0.1, 1.5, 0.05]
const float P_WIND = 1.0; // P Wind Force [0.0, 2.2, 0.05]

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  vec3 col = mix(vec3(0.04, 0.06, 0.10), vec3(0.09, 0.12, 0.18), smoothstep(-0.5, 0.5, uv.y));
  for (int s = 0; s < 5; s++) {
    float fs = float(s) - 2.0;
    vec2 prev = vec2(fs * 0.18, 0.42);
    float minD = 9.0;
    float twistShade = 0.0;
    for (int k = 1; k <= 16; k++) {
      float fk = float(k) / 16.0;
      float sway = sin(iTime * 2.2 + fs * 0.9 - fk * 3.2) * (0.04 + 0.18 * fk * fk) * P_WIND / max(P_STIFF, 0.25);
      vec2 cur = vec2(fs * 0.18 + sway, 0.42 - fk * 0.84);
      vec2 pa = uv - prev, ba = cur - prev;
      float h = clamp(dot(pa, ba) / max(dot(ba, ba), 1e-5), 0.0, 1.0);
      float segD = length(pa - ba * h);
      if (segD < minD) { minD = segD; twistShade = 0.5 + 0.5 * sin(fk * 18.0 + iTime * 2.0 + fs); }
      prev = cur;
    }
    vec3 strandCol = mix(vec3(0.28, 0.52, 0.88), vec3(0.98, 0.76, 0.34), twistShade);
    col = mix(col, strandCol, smoothstep(0.015, 0.005, minD));
  }
  fragColor = vec4(pow(clamp(col, 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}
```

Attribution: MIT — written for this index.

## Lineage

- extends [Extended Position-Based Dynamics](https://texelatlas.vercel.app/t/xpbd.md)

## Sources

1. [primary] Crispin Deul, Tassilo Kugelstadt, Marcel Weiler, Jan Bender (2018) Direct Position‐Based Solver for Stiff Rods. Computer Graphics Forum. https://doi.org/10.1111/cgf.13326 (verified via crossref on 2026-12-02)

## Cite this entry

Texel. "Position & Orientation Based Cosserat Rods (GPU Hair & Cables)." https://texelatlas.vercel.app/t/cosserat-rods-pbd/ (accessed 2026-12-02).
