---
id: "hardware-tessellation-pn-triangles"
title: "Hardware tessellation: PN triangles and displacement"
aliases: [PN triangles, curved PN triangles, hull/domain shader tessellation, phong tessellation]
domain: "geometry"
stage: "geometry"
realtime: "realtime"
platforms: [desktop-gpu, unity, unreal]
year_introduced: 2001
inputs: [mesh, texture]
outputs: [mesh]
style: "both"
dynamic: "dynamic"
cost: "medium"
authority: "Vlachos et al., 2001"
url: "https://texelatlas.vercel.app/t/hardware-tessellation-pn-triangles/"
sources_verified_at: "2026-11-29"
---
# Hardware tessellation: PN triangles and displacement (Vlachos et al., 2001)

> Uses the GPU's fixed-function tessellator to subdivide coarse triangles on the fly, bending them with a curved patch such as PN triangles and optionally displacing the new vertices from a height map.

## Reach for it when

- low poly silhouettes look faceted and need rounding
- real displacement mapping with correct silhouettes
- add geometry detail on the gpu without more vertices
- need adaptive subdivision based on distance to camera

## How it works

A hull (tessellation control) stage receives each coarse triangle, computes per-edge and inner tessellation factors, and passes control data along. The fixed-function tessellator emits a barycentric lattice at those factors. A domain (evaluation) shader then places each new vertex. With PN triangles, the hull stage builds a cubic Bézier patch from the three positions and normals (ten control points, plus a quadratic normal patch), and the domain shader evaluates it so silhouettes become round without extra authored geometry. For displacement, it samples a height texture at the interpolated UV and moves the point along the normal. Tessellation factors are adaptive: from edge screen length or distance, and matched on shared edges so no cracks appear. Catmull-Clark feature-adaptive schemes follow the same stage layout with limit-surface patches.

## When to use it

Choose it to smooth low-poly silhouettes cheaply or to add real displacement with correct silhouettes and shadows on hardware that has tessellation stages. Prefer [Parallax occlusion mapping](https://texelatlas.vercel.app/t/parallax-occlusion-mapping.md) when you cannot change silhouettes and want a cheaper fake, [Catmull-Clark Subdivision](https://texelatlas.vercel.app/t/catmull-clark-subdivision.md) for authored subdivision-surface models, and [Meshlets (cluster rendering)](https://texelatlas.vercel.app/t/meshlets.md) / [Nanite virtualized geometry](https://texelatlas.vercel.app/t/nanite-virtualized-geometry.md) for modern pipelines where mesh shaders and clustered geometry replace tessellation. WebGL2 and WebGPU expose no tessellation stages.

## Cost

medium — Cost scales with the output triangle count; small triangles waste rasteriser quads, so factors must be capped. Qualitative.
Measured GPU Weight: 20.95× baseline (heavy) — 0.6579 ms median / 0.6847 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 16.63× baseline (moderate) — 0.2628 ms median (2.5× faster on L4).
Ampere A100 scaling: 12.49× baseline (moderate) — 0.3597 ms median (1.83× faster on A100).

## Failure modes

- Cracks along shared edges when neighbouring patches compute different tessellation factors
- PN triangles bulge or flatten near hard edges because vertex normals are averaged; separate normals or crease handling are required
- Shimmering and swimming vertices as adaptive factors change between frames without hysteresis
- Micro-triangles from over-tessellation tank rasteriser efficiency; and the stage is absent or slow on mobile and web APIs

## Engine support

- metal: builtin — `MTLRenderPipelineDescriptor.tessellationPartitionMode + compute-written tessellation factors` (evidence: https://developer.apple.com/tutorials/data/documentation/metal/mtlrenderpipelinedescriptor.json, checked 2026-12-01) — Fixed-function tessellator; PN-triangle / displacement shader is yours.
- unity: builtin — `HDRP Lit Tessellation material; Displacement Mode = Tessellation` (evidence: https://github.com/Unity-Technologies/Graphics/blob/557f6ac22b948284f57ffae6a789751fd1f63620/Packages/com.unity.render-pipelines.high-definition/Documentation~/lit-tessellation-material.md, checked 2026-12-01) — HDRP only; Phong tessellation with displacement.

## Dataflow

- Inputs: mesh, texture
- Outputs: mesh
- Platforms: desktop-gpu, unity, unreal

## Presets

### Hardware tessellation (PN triangles) — coarse flat polyhedron (left) vs curved cubic Bézier PN silhouette & displacement (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_TESS_FACTOR": 5,
  "P_DISPLACE": 0.55,
  "P_SPLIT": 0.45,
  "P_ROT_SPEED": 1
}
```

```glsl
const float P_TESS_FACTOR = 5.0; // P Tessellation Level [1.0, 9.0, 1.0]
const float P_DISPLACE = 0.55; // P Displacement Amp [0.0, 1.4, 0.04]
const float P_SPLIT = 0.45; // P Flat / PN Split [0.0, 1.0, 0.02]
const float P_ROT_SPEED = 1.0; // P Spin Speed [0.0, 2.5, 0.05]

mat2 rot2(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }

// Coarse low-poly icosahedron / octahedron-dodecahedron hull (sharp flat triangular facets!)
float sdCoarseOctaIco(vec3 q) {
  vec3 a = abs(q);
  // Intersection of 8 octahedral planes & 6 axial planes -> crisp faceted 14-face low-poly control mesh
  float dOct = (a.x + a.y + a.z - 1.18) * 0.57735027;
  float dCube = max(a.x, max(a.y, a.z)) - 0.72;
  float dEdge = (max(a.x + a.y, max(a.y + a.z, a.z + a.x)) - 1.06) * 0.70710678;
  return max(max(dOct, dCube), dEdge);
}

// Curved PN-Triangle Bezier surface: replaces each flat triangle with a curved cubic patch + height displacement
float mapPN(vec3 p, float dispAmp, float spin) {
  vec3 q = p;
  q.xz = rot2(spin * 0.36) * q.xz;
  q.yz = rot2(0.32) * q.yz;

  float r = length(q);
  vec3 d = q / max(r, 1e-4);
  // Smooth cubic Bezier PN-patch silhouette inflation (smoothly rounds flat hull to curved sphere-like patch)
  float baseR = 0.78;
  // High-frequency carved stone / scale displacement unlocked ONLY by hardware tessellation!
  float disp = (0.042 * sin(d.x * 14.0) * cos(d.y * 14.0) * sin(d.z * 14.0) +
                0.024 * cos(atan(d.z, d.x) * 12.0 + d.y * 9.0)) * dispAmp;
  return (r - (baseR + disp)) * 0.80;
}

float mapFlat(vec3 p, float spin) {
  vec3 q = p;
  q.xz = rot2(spin * 0.36) * q.xz;
  q.yz = rot2(0.32) * q.yz;
  return sdCoarseOctaIco(q);
}

vec3 calcNormalFlat(vec3 p, float spin) {
  vec2 e = vec2(0.002, 0.0);
  return normalize(vec3(
    mapFlat(p + e.xyy, spin) - mapFlat(p - e.xyy, spin),
    mapFlat(p + e.yxy, spin) - mapFlat(p - e.yxy, spin),
    mapFlat(p + e.yyx, spin) - mapFlat(p - e.yyx, spin)
  ));
}

vec3 calcNormalPN(vec3 p, float dispAmp, float spin) {
  vec2 e = vec2(0.002, 0.0);
  return normalize(vec3(
    mapPN(p + e.xyy, dispAmp, spin) - mapPN(p - e.xyy, dispAmp, spin),
    mapPN(p + e.yxy, dispAmp, spin) - mapPN(p - e.yxy, dispAmp, spin),
    mapPN(p + e.yyx, dispAmp, spin) - mapPN(p - e.yyx, dispAmp, spin)
  ));
}

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 screenX = fragCoord.x / max(iResolution.x, 1.0);
  float split = clamp(P_SPLIT, 0.0, 1.0);
  float tessF = clamp(floor(P_TESS_FACTOR + 0.5), 1.0, 10.0);
  float dispAmp = clamp(P_DISPLACE, 0.0, 1.5);
  float spin = iTime * max(P_ROT_SPEED, 0.0);

  vec3 ro = vec3(0.0, 0.08, 2.48);
  vec3 rd = normalize(vec3(uv, -1.52));

  vec3 col = mix(vec3(0.03, 0.04, 0.068), vec3(0.09, 0.115, 0.168), smoothstep(-0.55, 0.55, uv.y));
  bool isPN = screenX >= split;

  float t = 0.0;
  bool hit = false;
  for (int i = 0; i < 64; i++) {
    vec3 p = ro + rd * t;
    float d = isPN ? mapPN(p, dispAmp, spin) : mapFlat(p, spin);
    if (d < 0.002) { hit = true; break; }
    t += d;
    if (t > 9.0) break;
  }

  if (hit) {
    vec3 p = ro + rd * t;
    vec3 n = isPN ? calcNormalPN(p, dispAmp, spin) : calcNormalFlat(p, spin);

    // Object-space barycentric octahedral projection for coarse hull edges & tessellated sub-triangles!
    vec3 objP = p;
    objP.xz = rot2(spin * 0.36) * objP.xz;
    objP.yz = rot2(0.32) * objP.yz;
    vec3 a = abs(objP) / max(abs(objP.x) + abs(objP.y) + abs(objP.z), 1e-4);

    // Coarse patch triangle boundaries (octant edges)
    float coarseEdge = smoothstep(0.025, 0.004, min(a.x, min(a.y, a.z)));
    // Subdivided hardware tessellation barycentric lattice (scales with P_TESS_FACTOR!)
    vec3 tf = abs(fract(a * tessF) - 0.5);
    float subWire = smoothstep(0.45, 0.495, max(tf.x, max(tf.y, tf.z)));

    vec3 l1 = normalize(vec3(0.62, 0.85, 0.55));
    vec3 l2 = normalize(vec3(-0.72, -0.22, 0.55));
    float diff1 = max(dot(n, l1), 0.0);
    float diff2 = max(dot(n, l2), 0.0);
    vec3 hVec = normalize(l1 - rd);
    float spec = pow(max(dot(n, hVec), 0.0), 42.0) * 0.52;
    float rim = pow(1.0 - max(dot(n, -rd), 0.0), 3.0) * 0.32;

    vec3 alb = isPN ? vec3(0.24, 0.68, 0.92) : vec3(0.72, 0.52, 0.34);
    col = alb * (0.24 + 0.86 * diff1 + 0.24 * diff2) + vec3(spec) + vec3(0.45, 0.78, 1.0) * rim;

    if (isPN) {
      col = mix(col, vec3(0.14, 0.96, 0.78), subWire * 0.42);
      col = mix(col, vec3(1.0, 0.86, 0.36), coarseEdge * 0.78);
    } else {
      col = mix(col, vec3(1.0, 0.86, 0.36), coarseEdge * 0.88);
    }
  }

  float sep = smoothstep(0.0035, 0.0008, abs(screenX - 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: Original interactive WebGL2 fragment shader written for Texel Atlas (MIT).

## Combines with

- [Normal mapping with MikkTSpace](https://texelatlas.vercel.app/t/normal-mapping-mikktspace.md): Tessellated, displaced surfaces need consistent tangent frames so detail normal maps still shade correctly.

## Sources

1. [primary] Alex Vlachos, Jörg Peters, Chas Boyd, Jason L. Mitchell (2001) Curved PN triangles. Proceedings of the 2001 symposium on Interactive 3D graphics. https://doi.org/10.1145/364338.364387 (verified via crossref on 2026-11-29)
2. [secondary] Matthias Nießner, Charles Loop, Mark Meyer, Tony Derose (2012) Feature-adaptive GPU rendering of Catmull-Clark subdivision surfaces. ACM Transactions on Graphics. https://doi.org/10.1145/2077341.2077347 (verified via crossref on 2026-11-29)
3. [implementation] PixarAnimationStudios (2012) PixarAnimationStudios/OpenSubdiv. https://github.com/PixarAnimationStudios/OpenSubdiv License: NOASSERTION. (verified via github on 2026-11-29)

## Cite this entry

Texel. "Hardware tessellation: PN triangles and displacement." https://texelatlas.vercel.app/t/hardware-tessellation-pn-triangles/ (accessed 2026-12-01).
