---
id: "xatlas"
title: "xatlas"
domain: "geometry"
stage: "geometry"
realtime: "offline"
platforms: [cpu, blender, unity, unreal, webgl2]
year_introduced: 2018
inputs: [mesh]
outputs: [uv-atlas]
style: "both"
dynamic: "static"
cost: "offline"
authority: "jpcy, 2018"
url: "https://texelatlas.vercel.app/t/xatlas/"
sources_verified_at: "2026-11-29"
---
# xatlas (jpcy, 2018)

> A small C++ library that segments a triangle mesh into charts, parameterizes each, and packs them into a lightmap atlas without user seams. Widely used for automatic lightmap UVs.

## Reach for it when

- need lightmap uvs for an arbitrary mesh
- automatic unwrapping without manual seams
- baked ao or probe textures need packed charts
- meshes have no secondary uv set for lightmaps

## How it works

The mesh is first split into charts by growing regions from seed triangles while checking normal deviation, roundness and the cost of the shared boundary, and merging when beneficial. Each chart is flattened by a least-squares conformal or similar projection, with iterative fixes for overlap and flip. Then the charts are packed using a rasterised approach: each chart is rendered into a bitmap, and a brute-force or block-based placer finds a position and rotation that fits with a chosen padding. The pack is repeated to find a resolution or texel density. The API can return a remapped vertex list so you can keep the original vertex data, and it supports multi-mesh atlases and a user-supplied UV set for reuse.

## When to use it

Choose it to generate secondary UVs for baked lightmaps, AO or probe textures on arbitrary meshes in an engine or tool. Prefer [Least Squares Conformal Maps](https://texelatlas.vercel.app/t/lscm-uv-unwrapping.md) on a single artist-seamed chart, [Geometry Images](https://texelatlas.vercel.app/t/geometry-images.md) for single-chart remeshing, and an artist-made UV when texture painting quality matters.

## Cost

offline — Seconds for hundreds of thousands of triangles; packing resolution dominates.

## Failure modes

- Many small charts and seams produce visible lighting or filtering seams when sampled with bilinear texels
- Charts of very different stretch cause uneven texel density
- Rejects or produces overlapping charts for non-manifold or degenerate input
- Packing efficiency depends on resolution; low settings waste space

## Engine support

- godot: builtin — `ArrayMesh.lightmap_unwrap(); scene import option Meshes > Light Baking = Static Lightmaps` (evidence: https://github.com/godotengine/godot/blob/4.7.2-stable/doc/classes/ArrayMesh.xml, checked 2026-12-01) — Godot bundles xatlas for lightmap UV unwrapping.
- unreal: official — `Geometry Script plugin: Auto Generate X Atlas Mesh UVs` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/geometry-scripting-reference-in-unreal-engine, checked 2026-12-01) — Geometry Script is an engine plugin.

## Dataflow

- Inputs: mesh
- Outputs: uv-atlas
- Platforms: cpu, blender, unity, unreal, webgl2

## Combines with

- [Least Squares Conformal Maps](https://texelatlas.vercel.app/t/lscm-uv-unwrapping.md): LSCM is the typical per-chart flattening step inside atlas builders.

## Combination ideas

- [Neural-compressed directional lightmaps](https://texelatlas.vercel.app/ideas/neural-compressed-lightmaps/)

## Sources

1. [primary] jpcy (2018) jpcy/xatlas. https://github.com/jpcy/xatlas License: MIT. (verified via github on 2026-11-29)

## Cite this entry

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