---
id: "lscm-uv-unwrapping"
title: "Least Squares Conformal Maps"
domain: "geometry"
stage: "geometry"
realtime: "interactive"
platforms: [cpu, blender]
year_introduced: 2002
inputs: [mesh]
outputs: [uv-atlas]
style: "both"
dynamic: "static"
cost: "interactive"
authority: "Lévy et al., 2002"
url: "https://texelatlas.vercel.app/t/lscm-uv-unwrapping/"
sources_verified_at: "2026-11-29"
---
# Least Squares Conformal Maps (Lévy et al., 2002)

> Computes a UV parameterization of a mesh chart by minimising the deviation from a conformal (angle-preserving) map with a linear least-squares solve, pinning two vertices to remove the rigid-body freedom.

## Reach for it when

- need quick uvs for a single patch after marking seams
- texture stretches when unwrapping a mesh section
- angle-preserving unwrap for painting
- unfold a disc-like chart without much shear
- uv map for baking a hand-seamed piece

## How it works

The Cauchy-Riemann equations say a map is conformal when its gradient is a rotation plus scale. On a triangle mesh, each triangle is expressed in a local orthonormal basis and the conformality error is a quadratic function of the UV coordinates. Summing the squared errors over triangles gives a sparse least-squares system. A pair of vertices is pinned to fix translation, rotation and scale (or boundary conditions are provided); solving the symmetric positive-definite system gives UVs that preserve angles as well as possible. The method works with free boundaries, so a disc-topology chart takes its natural shape. Charts are usually produced by cutting seams along a spanning tree or by a segmentation step beforehand, and area distortion is often fixed by a following packing/scaling stage.

## When to use it

Choose it for quick, stable unwrapping of a single disc-like chart: hand-seam workflows, texture painting and baking. Prefer [xatlas](https://texelatlas.vercel.app/t/xatlas.md) when you need automatic chart segmentation and packing of the whole mesh, [Geometry Images](https://texelatlas.vercel.app/t/geometry-images.md) when you want a single square chart for the entire surface, and an area-preserving method when texel density must be uniform.

## Cost

interactive — One sparse linear solve per chart; sub-second for typical charts with tens of thousands of triangles.
Measured GPU Weight: 25.7× baseline (heavy) — 0.8069 ms median / 0.8204 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 21.56× baseline (heavy) — 0.3406 ms median (2.37× faster on L4).
Ampere A100 scaling: 15.36× baseline (moderate) — 0.4425 ms median (1.82× faster on A100).

## Failure modes

- Angle preservation means area can blow up: large stretch near sharp cone-like regions
- Flipped triangles can still appear since the objective does not forbid them
- Depends on which two vertices are pinned and on the seam layout
- Charts with high Gaussian curvature need many seams, creating visible texture breaks

## Engine support

- blender: builtin — `UV Editing > UV > Unwrap > Conformal (Angle Based is the alternative)` (evidence: https://docs.blender.org/manual/en/5.2/modeling/meshes/editing/uv.html, checked 2026-12-01)
- godot: builtin — `ArrayMesh.lightmap_unwrap() / Mesh Import > Light Baking = Static Lightmaps (bundled xatlas uses ChartType::LSCM parameterization)` (evidence: https://github.com/godotengine/godot/blob/4.7.2-stable/thirdparty/xatlas/xatlas.cpp, checked 2026-12-01)
- unreal: builtin — `Modeling Mode > UVs > Unwrap and Geometry Script (GeometryScriptUVFlattenMethod.CONFORMAL / SPECTRAL_CONFORMAL, or auto_generate_x_atlas)` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/python-api/class/GeometryScriptUVFlattenMethod, checked 2026-12-01)

## Dataflow

- Inputs: mesh
- Outputs: uv-atlas
- Platforms: cpu, blender

## Presets

### Least Squares Conformal Maps — sheared planar UV (left) vs angle-preserving conformal UV & Tissot circles (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_UV_FREQ": 8,
  "P_TISSOT_CIRCLES": 0.85,
  "P_SPLIT": 0.45,
  "P_ROT_SPEED": 1
}
```

```glsl
const float P_UV_FREQ = 8.0; // P Checker Density [4.0, 16.0, 1.0]
const float P_TISSOT_CIRCLES = 0.85; // P Tissot Indicatrix [0.0, 1.5, 0.05]
const float P_SPLIT = 0.45; // P Planar / LSCM 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); }

// Sculpted undulating hourglass/vase manifold with strong positive & negative Gaussian curvature
float mapSurface(vec3 p, float spin) {
  vec3 q = p;
  q.xz = rot2(spin * 0.35) * q.xz;
  q.yz = rot2(0.28) * q.yz;
  float ang = atan(q.z, q.x);
  float profileR = 0.56 + 0.22 * cos(q.y * 3.8) + 0.08 * sin(ang * 3.0) * cos(q.y * 2.2);
  float dCyl = length(q.xz) - profileR;
  float dCap = abs(q.y) - 0.82;
  vec2 w = vec2(dCyl, dCap);
  return (min(max(w.x, w.y), 0.0) + length(max(w, 0.0)) - 0.04) * 0.72;
}

vec3 calcNormal(vec3 p, float spin) {
  vec2 e = vec2(0.0025, 0.0);
  return normalize(vec3(
    mapSurface(p + e.xyy, spin) - mapSurface(p - e.xyy, spin),
    mapSurface(p + e.yxy, spin) - mapSurface(p - e.yxy, spin),
    mapSurface(p + e.yyx, spin) - mapSurface(p - e.yyx, spin)
  ));
}

// Evaluate UV checkerboard + Tissot indicatrix circles (circles stay strictly circular ONLY under conformal maps!)
vec3 evalUvPattern(vec2 uvTex, float freq, float tissotAmt, float scaleFactor) {
  vec2 g = uvTex * freq;
  vec2 cell = floor(g);
  vec2 f = fract(g) - 0.5;
  float chk = mod(cell.x + cell.y, 2.0);
  // Subtle conformal area-scale color ramp (teal = compressed, ivory = neutral, amber = expanded)
  vec3 scaleTint = mix(vec3(0.18, 0.62, 0.84), vec3(0.95, 0.64, 0.24), clamp(scaleFactor, 0.0, 1.0));
  vec3 base = mix(vec3(0.16, 0.20, 0.26), mix(vec3(0.86, 0.88, 0.90), scaleTint, 0.45), chk);

  // Orthogonal UV gridlines (preserve exact 90-degree crossings under LSCM!)
  float gridLine = smoothstep(0.055, 0.015, min(abs(f.x), abs(f.y)));
  base = mix(base, vec3(0.06, 0.09, 0.14), gridLine * 0.45);

  // Tissot indicatrix circles centered in every UV tile: distortion reveals shear immediately!
  if (tissotAmt > 0.01) {
    float r = length(f);
    float ring = smoothstep(0.055, 0.012, abs(r - 0.28));
    base = mix(base, vec3(0.98, 0.34, 0.32), ring * 0.82 * min(tissotAmt, 1.2));
  }
  return base;
}

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 freq = clamp(floor(P_UV_FREQ + 0.5), 3.0, 18.0);
  float tissot = clamp(P_TISSOT_CIRCLES, 0.0, 1.5);
  float spin = iTime * max(P_ROT_SPEED, 0.0);

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

  vec3 col = mix(vec3(0.03, 0.042, 0.068), vec3(0.092, 0.118, 0.170), smoothstep(-0.55, 0.55, uv.y));
  vec2 bgG = abs(fract(uv * 10.0 - 0.5) - 0.5);
  col += vec3(0.018, 0.028, 0.045) * smoothstep(0.03, 0.0, min(bgG.x, bgG.y));

  float t = 0.0;
  bool hit = false;
  for (int i = 0; i < 64; i++) {
    float d = mapSurface(ro + rd * t, spin);
    if (d < 0.002) { hit = true; break; }
    t += d;
    if (t > 9.0) break;
  }

  if (hit) {
    vec3 p = ro + rd * t;
    vec3 n = calcNormal(p, spin);

    // Object-space coordinates on the curved surface of revolution
    vec3 objP = p;
    objP.xz = rot2(spin * 0.35) * objP.xz;
    objP.yz = rot2(0.28) * objP.yz;

    // Left: Naive Planar UV projection (causes severe shear & stretched Tissot ellipses on curved flanks!)
    vec2 naiveUV = objP.xy * 0.65;

    // Right: Exact Isothermal / Conformal LSCM parameterization!
    // For a surface of revolution r(y), conformal coordinate satisfies dv = ds / r(y) so metric is isotropic: ds^2 = r^2(du^2 + dv^2)!
    float theta = atan(objP.z, objP.x);
    float rSurf = max(length(objP.xz), 0.18);
    // Integrate meridian arc-length / r(y) using 6-tap midpoint quadrature for true angle-preserving LSCM UV!
    float vConf = 0.0;
    float dy = objP.y / 6.0;
    for (int k = 0; k < 6; k++) {
      float ym = (float(k) + 0.5) * dy;
      float rm = 0.56 + 0.22 * cos(ym * 3.8) + 0.08 * sin(theta * 3.0) * cos(ym * 2.2);
      float drdy = -0.22 * 3.8 * sin(ym * 3.8) - 0.08 * 2.2 * sin(theta * 3.0) * sin(ym * 2.2);
      float ds = sqrt(1.0 + drdy * drdy) * dy;
      vConf += ds / max(rm, 0.22);
    }
    vec2 lscmUV = vec2(theta / 3.14159265, vConf / 3.14159265);
    float confScale = clamp((rSurf - 0.32) / 0.50, 0.0, 1.0);

    bool isLscm = screenX >= split;
    vec3 alb = isLscm
      ? evalUvPattern(lscmUV, freq, tissot, confScale)
      : evalUvPattern(naiveUV, freq, tissot, 0.5);

    vec3 l1 = normalize(vec3(0.62, 0.86, 0.55));
    vec3 l2 = normalize(vec3(-0.75, -0.22, 0.52));
    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.42;
    float rim = pow(1.0 - max(dot(n, -rd), 0.0), 3.0) * 0.26;

    col = alb * (0.28 + 0.82 * diff1 + 0.24 * diff2) + vec3(spec) + vec3(0.45, 0.72, 1.0) * rim;
  }

  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

- [xatlas](https://texelatlas.vercel.app/t/xatlas.md): The atlas generator uses chart-level parameterization of this sort before packing.

## Sources

1. [primary] Bruno Lévy, Sylvain Petitjean, Nicolas Ray, Jérome Maillot (2002) Least squares conformal maps for automatic texture atlas generation. Proceedings of the 29th annual conference on Computer graphics and interactive techniques. https://doi.org/10.1145/566570.566590 (verified via crossref on 2026-11-29)
2. [implementation] jpcy (2018) jpcy/xatlas. https://github.com/jpcy/xatlas License: MIT. (verified via github on 2026-11-29)

## Cite this entry

Texel. "Least Squares Conformal Maps." https://texelatlas.vercel.app/t/lscm-uv-unwrapping/ (accessed 2026-12-01).
