xatlas
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.
In the family Geometry, meshing & signed distance fields, UV parameterization
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | Built in | ArrayMesh.lightmap_unwrap(); scene import option Meshes > Light Baking = Static Lightmaps docs Godot bundles xatlas for lightmap UV unwrapping. |
| Unity | None found | Unity uses its own internal lightmap UV chart unwrapper rather than shipping xatlas. |
| Unreal 5.7 | Official add-on | Geometry Script plugin: Auto Generate X Atlas Mesh UVs docs Geometry Script is an engine plugin. |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
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 choose it
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
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 on a single artist-seamed chart, Geometry Images for single-chart remeshing, and an artist-made UV when texture painting quality matters.
Field marks
- 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
Crosses
- Neural-compressed directional lightmaps: High-resolution directional lightmaps stored as small latent grids decoded in the shader. The bands of a spherical-harmonic lightmap are strongly correlated, which joint neural encoding can exploit better than compressing each channel on its own.
- Least Squares Conformal Maps: LSCM is the typical per-chart flattening step inside atlas builders.
Sources
- primaryjpcy (2018). jpcy/xatlas. Mesh parameterization / UV unwrapping libraryGitHub API · license MIT · 2026-11-29