---
id: "reoriented-normal-mapping"
title: "Reoriented normal map blending (detail normals)"
aliases: [RNM, reoriented normal blending]
domain: "materials"
stage: "material"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot, blender]
year_introduced: 2012
inputs: [normals, texture]
outputs: [normals]
style: "both"
dynamic: "both"
cost: "cheap"
authority: "Barre-Brisebois & Hill"
url: "https://texelatlas.vercel.app/t/reoriented-normal-mapping/"
sources_verified_at: "2026-11-29"
---
# Reoriented normal map blending (detail normals) (Barre-Brisebois & Hill)

> A correct way to layer a detail normal map onto a base normal map: it rotates the detail normal into the frame of the base so slopes combine as real orientations rather than averaged offsets.

## Reach for it when

- detail normal map flattens the base normal map
- blending two normal maps looks wrong on slopes
- combining triplanar or decal normals correctly
- micro detail normals lose strength on curved areas
- choose between udn whiteout and correct normal blend

## How it works

Blending two tangent-space normals by adding xy and renormalising treats them as height gradients and flattens detail where the base is steep. Reoriented blending instead rotates the detail normal by the rotation that carries the +Z axis to the base normal. With t = base*(2,2,2)+(-1,-1,0) and u = detail*(-2,-2,2)+(1,1,-1), the result is r = t * dot(t,u) / t.z - u, then normalised. That is the shortest-arc rotation applied to the detail vector in closed form: no trigonometry or matrix building, just a dot product and a divide. Cheaper approximations include UDN (add the detail xy to the base) and the whiteout blend (add xy, multiply z), which keep strong detail but are not exact. RNM is the reference that others are compared to; the cost difference matters only on weak hardware.

## When to use it

Use it whenever a detail or micro normal map is layered on top of a macro normal map, or when decals and triplanar projections combine tangent-space normals. Prefer [Surface gradient based bump mapping framework](https://texelatlas.vercel.app/t/surface-gradient-bump-mapping.md) for a framework that blends many bump or normal sources in one place with consistent semantics. Prefer plain UDN or whiteout when ALU is critical. Use [Normal distribution filtering for specular antialiasing](https://texelatlas.vercel.app/t/normal-distribution-filtering.md) or [Toksvig normal-map filtering](https://texelatlas.vercel.app/t/toksvig-mipmapping.md) for how those normal maps are filtered and minified.

## Cost

cheap — A dot product, a divide and a normalise per blend.
Measured GPU Weight: 4.14× baseline (light) — 0.1363 ms median / 0.1387 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 3.36× baseline (light) — 0.0535 ms median (2.55× faster on L4).
Ampere A100 scaling: 2.5× baseline (light) — 0.0721 ms median (1.89× faster on A100).

## Failure modes

- Uses the +Z-up unpacked convention; passing already-biased [0,1] values or OpenGL/DirectX Y-flipped maps gives wrong slopes
- Division by t.z blows up when the base normal is nearly horizontal, unless clamped
- Blending must happen before the TBN transform; blending in world space reintroduces the error
- Not associative: blending in a different order across layers changes the result slightly
- Mip-averaged detail normals shorten in length, so the blend underestimates detail at distance without length-aware filtering

## Engine support

- unity: builtin — `Shader Graph > Normal Blend node > Mode = Reoriented` (evidence: https://github.com/Unity-Technologies/Graphics/blob/557f6ac22b948284f57ffae6a789751fd1f63620/Packages/com.unity.shadergraph/Documentation~/Normal-Blend-Node.md, checked 2026-12-01)

## Dataflow

- Inputs: normals, texture
- Outputs: normals
- Platforms: webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot, blender

## Presets

### Reoriented Normal Mapping (RNM) — linear/UDN normal blend flattening (left) vs quaternion RNM rotation (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_MACRO_STEEP": 1,
  "P_DETAIL_STR": 0.85,
  "P_LIGHT_SPIN": 0.65,
  "P_SPLIT": 0.48
}
```

```glsl
const float P_MACRO_STEEP = 1.0; // P Base Slope Steep [0.2, 1.5, 0.05]
const float P_DETAIL_STR = 0.85; // P Detail Strength [0.1, 1.5, 0.05]
const float P_LIGHT_SPIN = 0.65; // P Light Orbit [0.0, 2.2, 0.05]
const float P_SPLIT = 0.48; // P Linear / RNM Split [0.0, 1.0, 0.02]

// Base macro normal map: bold embossed circular domes & deep fluted ridges (very steep base slopes!)
vec3 evalBaseNormal(vec2 uv, float steep) {
  vec2 p = uv * 3.2;
  vec2 cell = fract(p) - 0.5;
  float r = length(cell);
  // Steep spherical bump + wave ridges
  vec2 grad = vec2(0.0);
  if (r < 0.38) {
    grad += (cell / max(r, 1e-4)) * smoothstep(0.38, 0.05, r) * 2.4;
  }
  grad += vec2(cos(uv.x * 14.0), sin(uv.y * 14.0)) * 0.85;
  grad *= steep;
  return normalize(vec3(-grad.x, -grad.y, 1.0));
}

// High-frequency detail normal map: crisp micro-hexagonal scales / embossed fabric studs
vec3 evalDetailNormal(vec2 uv, float str) {
  vec2 q = uv * 34.0;
  vec2 f = fract(q) - 0.5;
  float r = length(f);
  vec2 dg = (r < 0.38) ? (f / max(r, 1e-4)) * smoothstep(0.38, 0.08, r) * 1.65 : vec2(0.0);
  dg += vec2(cos(q.x * 3.14159), sin(q.y * 3.14159)) * 0.45;
  dg *= str;
  return normalize(vec3(-dg.x, -dg.y, 1.0));
}

// Reoriented Normal Mapping (Barre-Brisebois & Hill 2012): shortest-arc quaternion rotation of n2 onto n1!
vec3 blendRNM(vec3 n1, vec3 n2) {
  vec3 t = n1 + vec3(0.0, 0.0, 1.0);
  vec3 u = n2 * vec3(-1.0, -1.0, 1.0);
  return normalize(t * (dot(t, u) / max(t.z, 1e-4)) - u);
}

// Naive linear normal blending (washes out detail when base normal tilts steeply away from +Z!)
vec3 blendLinear(vec3 n1, vec3 n2) {
  return normalize(n1 + n2);
}

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);
  bool isRNM = screenX >= split;
  float steep = clamp(P_MACRO_STEEP, 0.15, 1.6);
  float detStr = clamp(P_DETAIL_STR, 0.05, 1.6);
  float spin = iTime * max(P_LIGHT_SPIN, 0.0);

  vec3 nBase = evalBaseNormal(uv, steep);
  vec3 nDet = evalDetailNormal(uv, detStr);
  vec3 n = isRNM ? blendRNM(nBase, nDet) : blendLinear(nBase, nDet);

  // Orbiting grazing studio key light + cool fill light so slope-normal differences pop unmistakably!
  vec3 l1 = normalize(vec3(cos(spin * 0.75) * 0.85, sin(spin * 0.75) * 0.85, 0.42));
  vec3 l2 = normalize(vec3(-0.65, 0.55, 0.65));
  vec3 v = vec3(0.0, 0.0, 1.0);

  float diff1 = max(dot(n, l1), 0.0);
  float diff2 = max(dot(n, l2), 0.0);
  float spec1 = pow(max(dot(n, normalize(l1 + v)), 0.0), 48.0);
  float spec2 = pow(max(dot(n, normalize(l2 + v)), 0.0), 28.0);

  // Anodized copper-slate ceramic shader
  vec3 alb = mix(vec3(0.18, 0.24, 0.34), vec3(0.84, 0.46, 0.26), smoothstep(0.4, 0.95, nBase.z));
  vec3 col = alb * (0.16 + 0.95 * diff1 + 0.30 * diff2)
           + vec3(1.0, 0.90, 0.78) * spec1 * 0.88
           + vec3(0.32, 0.74, 1.0) * spec2 * 0.35;

  // Subtle normal-map diagnostic strip along bottom edge
  float screenY = fragCoord.y / max(iResolution.y, 1.0);
  if (screenY < 0.12) {
    col = mix(col, n * 0.5 + 0.5, smoothstep(0.12, 0.11, screenY) * 0.92);
  }

  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: MIT — written for this index.

## Lineage

- extends [Normal mapping with MikkTSpace](https://texelatlas.vercel.app/t/normal-mapping-mikktspace.md)
- extended by [Surface gradient based bump mapping framework](https://texelatlas.vercel.app/t/surface-gradient-bump-mapping.md)

## Combines with

- [Triplanar mapping](https://texelatlas.vercel.app/t/triplanar-mapping.md): The three projected tangent-space normals are combined with reoriented blending instead of a linear mix.
- [Deferred and projected decals](https://texelatlas.vercel.app/t/deferred-and-projected-decals.md): Decal normals are layered over the stored surface normal using the same rotation.

## Sources

1. [primary] Colin Barre-Brisebois, Stephen Hill Blending in Detail. blog.selfshadow.com. https://blog.selfshadow.com/publications/blending-in-detail (verified via http on 2026-11-29)

## Cite this entry

Texel. "Reoriented normal map blending (detail normals)." https://texelatlas.vercel.app/t/reoriented-normal-mapping/ (accessed 2026-12-01).
