---
id: "strand-based-real-time-hair"
title: "Strand-based real-time hair (TressFX style)"
aliases: [TressFX, strand hair, NVIDIA HairWorks style]
domain: "materials"
stage: "material"
realtime: "realtime"
platforms: [desktop-gpu, unreal, unity, webgpu]
year_introduced: 2012
inputs: [curves, skeleton, material-params]
outputs: [radiance]
style: "photoreal"
dynamic: "dynamic"
cost: "heavy"
authority: "GPUOpen-Effects, 2016"
url: "https://texelatlas.vercel.app/t/strand-based-real-time-hair/"
sources_verified_at: "2026-11-29"
---
# Strand-based real-time hair (TressFX style) (GPUOpen-Effects, 2016)

> Renders and simulates tens of thousands of individual hair strands on the GPU: guide strands run a position-based simulation, are interpolated into many render strands, expanded to camera-facing ribbons, then shaded and blended with an order-independent technique.

## Reach for it when

- want individual simulated hair strands in real time
- hero character hair with proper silhouette and motion
- hair transparency sorting is expensive
- hair strands alias and shimmer in motion
- need gpu hair simulation with collisions

## How it works

Authoring supplies guide hairs as polylines. A compute pass simulates them with a few constraints (length, local shape against the head's rest pose, global shape, wind) integrated by Verlet-style steps, and collides them with proxy capsules. A second pass interpolates guides to many follower strands and applies clumping and tessellation. Rendering expands each segment into a thin camera-facing quad (or tube), often one or two pixels wide, and shades it with a strand tangent lobe such as Kajiya-Kay or a Marschner approximation. Transparency is the hard part: TressFX stores per-pixel linked lists of fragments and sorts and blends them, while others use alpha-to-coverage or a k-buffer. Self-shadowing is approximated with deep shadow-like opacity maps or a density volume. Antialiasing relies on coverage-based thin-line handling plus temporal methods.

## When to use it

Choose it for hero characters on desktop and console where individual strands matter for silhouette and motion. Prefer [Shell and fin fur rendering](https://texelatlas.vercel.app/t/shell-fur-rendering.md) for short fur and [Kajiya-Kay hair shading](https://texelatlas.vercel.app/t/kajiya-kay-hair-shading.md) on cards for crowds or mobile. Use [Marschner hair scattering model](https://texelatlas.vercel.app/t/marschner-hair-scattering.md) or [Disney / Chiang hair and fur BSDF](https://texelatlas.vercel.app/t/disney-hair-bsdf.md) for the shading model instead of Kajiya-Kay if path-traced fidelity is the goal. The simulation part uses ideas from [Position Based Dynamics](https://texelatlas.vercel.app/t/position-based-dynamics.md) and [Extended Position-Based Dynamics](https://texelatlas.vercel.app/t/xpbd.md).

## Cost

heavy — Hair is one of the costliest character features; cost scales with strand count, transparency method and shadows.
Measured GPU Weight: 32.25× baseline (heavy) — 1.0609 ms median / 1.0723 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 28.02× baseline (heavy) — 0.4455 ms median (2.38× faster on L4).
Ampere A100 scaling: 23.03× baseline (heavy) — 0.6632 ms median (1.6× faster on A100).

## Failure modes

- Per-pixel linked-list transparency overflows its memory budget in dense close-ups
- Strands collide poorly with shoulders and clothing when only head proxies exist
- Aliasing and shimmering of one-pixel strands needs temporal accumulation, causing ghosting
- Strand count LOD pops without careful width compensation
- Self-shadowing is approximate, so hair looks flat or overly bright without it
- Stiff constraints under low frame rate or large time steps make hair explode or jitter

## Engine support

- blender: builtin — `Render Properties > Curves > Shape = Strand or Strip (EEVEE)` (evidence: https://docs.blender.org/manual/en/5.2/render/eevee/render_settings/curves.html, checked 2026-12-01) — Hair curve rendering; not TressFX-style GPU simulation.
- unreal: official — `Enable Groom plugins; import a Groom Asset and add a Groom Component` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/hair-rendering-and-simulation-in-unreal-engine, checked 2026-12-01) — Strand rendering plus Niagara-based hair simulation.

## Dataflow

- Inputs: curves, skeleton, material-params
- Outputs: radiance
- Platforms: desktop-gpu, unreal, unity, webgpu

## Presets

### Strand-Based Real-Time Hair — simulated PBD guide strands (left) vs dense interpolated Marschner ribbons (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_STRAND_DENSITY": 26,
  "P_WIND_SWAY": 0.75,
  "P_SPEC_SHIFT": 0.22,
  "P_SPLIT": 0.48
}
```

```glsl
const float P_STRAND_DENSITY = 26.0; // P Render Strands [10.0, 42.0, 2.0]
const float P_WIND_SWAY = 0.75; // P Wind & Sway [0.0, 1.8, 0.05]
const float P_SPEC_SHIFT = 0.22; // P Cuticle Shift [0.05, 0.45, 0.02]
const float P_SPLIT = 0.48; // P Guides / Hair Split [0.0, 1.0, 0.02]

float hash11(float p) {
  p = fract(p * 0.1031);
  p *= p + 33.33;
  return fract(p * (p + p));
}

// Compute strand centerline x(y) and tangent for a cascading hair lock swaying in wind
void evalStrandCurve(float y, float id, float wind, out float cx, out float dxdy, out float zOff) {
  float rootX = (id - 0.5) * 0.92;
  float lenFactor = clamp(0.46 - y, 0.0, 1.15);
  float phase = iTime * 2.1 + id * 6.8;
  float wave = sin(phase - lenFactor * 4.2) * 0.085 * wind * lenFactor * lenFactor;
  float curl = sin(lenFactor * 7.5 + id * 13.0) * 0.045 * (0.25 + lenFactor);
  // Natural cascade curve over crown and shoulder
  float drape = 0.12 * sin(lenFactor * 2.6) * sign(rootX + 0.001) * (0.3 + abs(rootX));
  cx = rootX * (0.55 + 0.55 * smoothstep(0.46, -0.35, y)) + drape + wave + curl;

  // Derivative dx/dy for strand tangent
  float eps = 0.015;
  float lf2 = clamp(0.46 - (y - eps), 0.0, 1.15);
  float cx2 = rootX * (0.55 + 0.55 * smoothstep(0.46, -0.35, y - eps))
            + 0.12 * sin(lf2 * 2.6) * sign(rootX + 0.001) * (0.3 + abs(rootX))
            + sin(phase - lf2 * 4.2) * 0.085 * wind * lf2 * lf2
            + sin(lf2 * 7.5 + id * 13.0) * 0.045 * (0.25 + lf2);
  dxdy = (cx - cx2) / eps;
  zOff = cos((id - 0.5) * 2.6) * 0.25 + 0.06 * cos(lenFactor * 5.0 + id * 9.0);
}

vec3 aces(vec3 x) {
  x = max(x, 0.0);
  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  float sx = fragCoord.x / max(iResolution.x, 1.0);
  float split = clamp(P_SPLIT, 0.0, 1.0);
  bool showFullHair = sx >= split;

  float wind = clamp(P_WIND_SWAY, 0.0, 2.2);
  float shift = clamp(P_SPEC_SHIFT, 0.02, 0.5);
  int numStrands = showFullHair ? int(clamp(floor(P_STRAND_DENSITY + 0.5), 8.0, 44.0)) : 7;

  // Studio backdrop + mannequin head/shoulder silhouette
  vec3 col = mix(vec3(0.05, 0.06, 0.09), vec3(0.13, 0.16, 0.22), smoothstep(-0.5, 0.5, uv.y));
  float headD = length((uv - vec2(0.0, 0.14)) * vec2(1.15, 0.92)) - 0.34;
  if (headD < 0.0) {
    vec2 hxy = (uv - vec2(0.0, 0.14)) / 0.34;
    vec3 hn = normalize(vec3(hxy, sqrt(max(1.0 - dot(hxy, hxy), 0.05))));
    float nl = max(dot(hn, normalize(vec3(0.55, 0.7, 0.55))), 0.08);
    col = vec3(0.18, 0.17, 0.19) * nl + vec3(0.06, 0.08, 0.12);
  }

  vec3 L = normalize(vec3(0.58 * cos(iTime * 0.35), 0.68, 0.62));
  vec3 V = vec3(0.0, 0.0, 1.0);
  vec3 H = normalize(L + V);

  // Order-independent depth-composited ribbons across simulated hair strands
  vec3 hairAcc = vec3(0.0);
  float covAcc = 0.0;
  float crownMask = smoothstep(0.48, 0.36, uv.y) * smoothstep(-0.52, -0.36, uv.y);

  for (int i = 0; i < 44; i++) {
    if (i >= numStrands) break;
    float fi = (float(i) + 0.5) / float(numStrands);
    float rnd = hash11(float(i) * 19.37 + 1.7);
    float cx, dxdy, zOff;
    evalStrandCurve(uv.y, fi, wind, cx, dxdy, zOff);

    float strandEnd = -0.46 + 0.14 * rnd;
    float tipFade = smoothstep(strandEnd, strandEnd + 0.10, uv.y);
    float width = showFullHair ? (0.022 + 0.012 * rnd) : 0.014;
    float dist = abs(uv.x - cx);

    if (dist < width * 2.2 && tipFade > 0.01 && crownMask > 0.01) {
      float alpha = smoothstep(width * 1.15, width * 0.25, dist) * tipFade * crownMask;
      // Compute 3D ribbon tangent T and cross-strand normal N
      vec3 T = normalize(vec3(dxdy, 1.0, 0.18 * sin(uv.y * 5.0 + rnd * 6.0)));
      float across = clamp((uv.x - cx) / max(width, 1e-4), -1.0, 1.0);
      vec3 N = normalize(vec3(across * 0.85, -dxdy * across * 0.4, sqrt(max(1.0 - across * across * 0.72, 0.1))));

      vec3 strandCol;
      if (!showFullHair) {
        // Left: Distinct PBD guide strand visualization with animated particle beads along each guide
        vec3 guideHue = 0.55 + 0.45 * cos(6.28318 * (fi + vec3(0.0, 0.33, 0.67)));
        float bead = smoothstep(0.014, 0.005, abs(fract(uv.y * 9.0) - 0.5) * 0.11);
        strandCol = mix(guideHue * 0.9, vec3(1.0, 0.98, 0.9), bead * 0.8);
      } else {
        // Right: Marschner / Kajiya-Kay dual-lobe specular (primary R white lobe + secondary TRT warm amber lobe)
        vec3 baseHair = mix(vec3(0.18, 0.08, 0.04), vec3(0.36, 0.16, 0.07), rnd);
        // Primary cuticle-shifted tangent T1 (white reflection)
        vec3 T1 = normalize(T + N * shift);
        float th1 = dot(T1, H);
        float sinTH1 = sqrt(max(1.0 - th1 * th1, 0.0));
        float specR = pow(sinTH1, 56.0) * 1.25;

        // Secondary shifted tangent T2 (colored internal TRT reflection)
        vec3 T2 = normalize(T - N * (shift * 1.65));
        float th2 = dot(T2, H);
        float sinTH2 = sqrt(max(1.0 - th2 * th2, 0.0));
        float specTRT = pow(sinTH2, 18.0) * 0.75;

        // Longitudinal diffuse + self-shadowing across hair volume depth
        float sinTL = sqrt(max(1.0 - dot(T, L) * dot(T, L), 0.0));
        float selfShadow = 0.38 + 0.62 * smoothstep(-0.25, 0.30, zOff);
        float microFibers = 0.85 + 0.15 * sin(across * 18.0 + rnd * 20.0);
        strandCol = (baseHair * (0.32 + 0.85 * sinTL) + vec3(1.0, 0.96, 0.90) * specR + vec3(0.95, 0.48, 0.18) * specTRT) * selfShadow * microFibers;
      }

      // Depth-biased soft OIT blend
      float w = alpha * (0.45 + 0.85 * smoothstep(-0.3, 0.35, zOff));
      hairAcc += strandCol * w;
      covAcc += w;
    }
  }

  if (covAcc > 0.001) {
    vec3 finalHair = hairAcc / max(covAcc, 1e-4);
    col = mix(col, finalHair, clamp(covAcc, 0.0, 1.0));
  }

  float sep = smoothstep(0.0035, 0.0008, abs(sx - split));
  col = mix(col, vec3(0.95, 0.97, 1.0), sep);
  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}
```

Attribution: MIT — written for this index.

## Combines with

- [Extended Position-Based Dynamics](https://texelatlas.vercel.app/t/xpbd.md): Guide strands use distance and shape constraints solved position-based each frame.
- [Temporal Anti-Aliasing](https://texelatlas.vercel.app/t/temporal-anti-aliasing.md): Resolves the sub-pixel strand coverage that single-frame antialiasing cannot.

## Sources

1. [primary] GPUOpen-Effects (2016) GPUOpen-Effects/TressFX. https://github.com/GPUOpen-Effects/TressFX License: MIT. (verified via github on 2026-11-29)
2. [secondary] Cem Yuksel, Sarah Tariq Advanced techniques in real-time hair rendering and simulation. cemyuksel.com. https://www.cemyuksel.com/courses/conferences/siggraph2010-hair (verified via http on 2026-11-29)

## Cite this entry

Texel. "Strand-based real-time hair (TressFX style)." https://texelatlas.vercel.app/t/strand-based-real-time-hair/ (accessed 2026-12-01).
