---
id: "triplanar-mapping"
title: "Triplanar mapping"
domain: "materials"
stage: "material"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot, blender]
year_introduced: 2007
inputs: [texture, normals, mesh]
outputs: [texture, material-params]
style: "both"
dynamic: "both"
cost: "cheap"
authority: "Geiss"
url: "https://texelatlas.vercel.app/t/triplanar-mapping/"
sources_verified_at: "2026-11-29"
---
# Triplanar mapping (Geiss)

> Texturing without UVs: sample a texture along the three world axes and blend by the surface normal. The standard fix for terrain cliffs, procedural meshes and anything where UV stretching is unavoidable.

## Reach for it when

- textures stretch on cliffs and steep terrain
- procedural meshes have no uvs
- need to texture rocks without unwrapping
- uv stretching ruins terrain slopes

## How it works

Project the world position onto the three axis-aligned planes (yz, xz, xy) to form three UV sets and fetch the texture three times. Blend weights come from the absolute normal raised to a sharpness power and renormalised, w = |n|^k / sum |n|^k, so each projection dominates where it faces the surface. Normal maps need care: each projection's tangent-space normal has to be swizzled into world space (the whiteout or reoriented normal blend methods handle this properly) before blending. Vertex or splat-weighted material masks can pick different textures per layer. Because there are no UVs, the technique works on SDF-meshed, voxel and heightfield terrain, and the cost is three fetches per texture rather than one.

## When to use it

Choose it for terrain, rocks, procedurally generated meshes and any mesh without good UVs. Prefer UV mapping with an atlas when UVs exist and detail must be authored. Use [Histogram-preserving blending (stochastic texturing)](https://texelatlas.vercel.app/t/histogram-preserving-blending.md) or [Hex-tiling](https://texelatlas.vercel.app/t/hex-tiling.md) on top to break repetition visible on large triplanar surfaces. Use [Surface gradient based bump mapping framework](https://texelatlas.vercel.app/t/surface-gradient-bump-mapping.md) to blend normals robustly.

## Cost

cheap — Three texture fetches per map instead of one; bandwidth multiplies with layer count.
Measured GPU Weight: 1.29× baseline (feather) — 0.0423 ms median / 0.0439 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 1.19× baseline (feather) — 0.0189 ms median (2.24× faster on L4).
Ampere A100 scaling: 1.03× baseline (feather) — 0.0297 ms median (1.42× faster on A100).

## Failure modes

- Visible blending seams and doubled detail where two projections overlap on 45-degree slopes
- Naive normal blending produces wrong lighting; swizzle or use reoriented normal mapping
- Texture repeats visibly over large areas without anti-tiling
- Texture scale follows world space, so scaled objects show stretched or varying texel density

## Engine support

- babylonjs: official — `new BABYLON.TriPlanarMaterial('m', scene) from @babylonjs/materials` (evidence: https://github.com/BabylonJS/Babylon.js/blob/9.38.0/packages/dev/materials/src/triPlanar/triPlanarMaterial.ts, checked 2026-12-01) — Also TriPlanarBlock in Node Material.
- blender: builtin — `Image Texture node > Projection = Box (with Blend)` (evidence: https://docs.blender.org/manual/en/5.2/render/shader_nodes/textures/image.html, checked 2026-12-01)
- godot: builtin — `BaseMaterial3D.uv1_triplanar = true` (evidence: https://github.com/godotengine/godot/blob/4.7.2-stable/doc/classes/BaseMaterial3D.xml, checked 2026-12-01)
- threejs: builtin — `import { triplanarTexture } from 'three/tsl'` (evidence: https://github.com/mrdoob/three.js/blob/r187/src/nodes/utils/TriplanarTextures.js, checked 2026-12-01) — TSL / WebGPURenderer.
- unity: builtin — `Shader Graph > Triplanar Node` (evidence: https://github.com/Unity-Technologies/Graphics/blob/557f6ac22b948284f57ffae6a789751fd1f63620/Packages/com.unity.shadergraph/Documentation~/Triplanar-Node.md, checked 2026-12-01) — Shader Graph node, URP and HDRP.
- unreal: builtin — `Material function WorldAlignedTexture (Texturing material functions)` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/texturing-material-functions-in-unreal-engine, checked 2026-12-01)

## Dataflow

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

## Presets

### Planar projection (left) vs triplanar projection (right) (glsl-fragment; rendered 2026-11-29)

```json
{
  "SCALE": 3,
  "SHARPNESS": 4
}
```

```glsl
// Texturing without UVs. Left sphere: a single planar projection along z stretches the texture toward the
// silhouette. Right sphere: triplanar projection blends three axis-aligned lookups by |normal|^4.
const float SCALE = 3.0;
const float SHARPNESS = 4.0;

vec3 tex(vec2 uv) {
  vec2 f = fract(uv);
  vec3 c = mix(vec3(0.9, 0.55, 0.2), vec3(0.2, 0.3, 0.55), mod(floor(uv.x) + floor(uv.y), 2.0));
  return mix(c, vec3(1.0), smoothstep(0.03, 0.0, abs(length(f - 0.5) - 0.3)));
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  vec3 ro = vec3(0.0, 0.0, 4.0), rd = normalize(vec3(uv, -2.3));
  vec3 col = vec3(0.08) + 0.06 * uv.y;
  mat3 rot = mat3(0.87, 0.0, -0.5, 0.0, 1.0, 0.0, 0.5, 0.0, 0.87);
  for (int i = 0; i < 2; i++) {
    vec3 c = vec3(i == 0 ? -0.5 : 0.5, 0.0, 0.0);
    vec3 oc = ro - c; float b = dot(oc, rd); float h = b * b - dot(oc, oc) + 0.46 * 0.46;
    if (h < 0.0) continue;
    vec3 n = normalize(ro + rd * (-b - sqrt(h)) - c);
    vec3 q = rot * n * 0.46;
    vec3 alb;
    if (i == 0) alb = tex(q.xy * SCALE * 2.2);
    else {
      vec3 w = pow(abs(rot * n), vec3(SHARPNESS)); w /= w.x + w.y + w.z;
      alb = tex(q.yz * SCALE * 2.2) * w.x + tex(q.zx * SCALE * 2.2) * w.y + tex(q.xy * SCALE * 2.2) * w.z;
    }
    col = alb * (0.2 + 0.9 * max(dot(n, normalize(vec3(0.5, 0.6, 0.7))), 0.0));
  }
  fragColor = vec4(pow(col, vec3(1.0 / 2.2)), 1.0);
}

```

Attribution: written for this index

## Combines with

- [Hex-tiling](https://texelatlas.vercel.app/t/hex-tiling.md): Hex-tiling breaks the repetition of each triplanar projection.

## Sources

1. [primary] Ryan Geiss Generating Complex Procedural Terrains Using the GPU. developer.nvidia.com. https://developer.nvidia.com/gpugems/gpugems3/part-i-geometry/chapter-1-generating-complex-procedural-terrains-using-gpu (verified via http on 2026-11-29)

## Cite this entry

Texel. "Triplanar mapping." https://texelatlas.vercel.app/t/triplanar-mapping/ (accessed 2026-12-01).
