Overview
In Unity 6.3, we have added a new algorithm for packing lightmaps based on the third-party UV packing library xAtlas. xAtlas is a fork of thekla_atlas, which was written for use in The Witness.
The new packing algorithm should in most cases produce more efficient and tightly packed lightmaps, with less authoring effort required, thus saving VRAM and disk space usage. In our testing, we observed anywhere from a 0% to 27% saving in memory usage across a variety of representative test scenes. The primary benefit of this new packing algorithm is that it considers the shape of each rendererâs UV layout, unlike the older packing algorithm, which only packs based on bounding boxes:
Because the new packing algorithm is solving a more difficult problem, it is generally slower than the older packing algorithm. For most of the scenes we tested, packing took on the order of a few seconds with the new packing algorithm, where it was essentially instant with the old packer. The time taken to calculate packing will scale with the size of the scene, and is logged in the editor log. If it becomes too slow, the quality can be reduced for faster packing, using a slider in the Lighting Window.
The new packing algorithm has been made the default for new scenes, but existing scenes will continue to use the older lightmap packing algorithm. The 2 algorithms will produce lightmaps with different layouts, and slight visual differences may therefore occur when switching between them. If you wish to continue to use the older packing algorithm, you can simply select it via a setting in the Lighting Window.
New features
The new packing algorithm brings a few new features with it, which the older algorithm couldnât support:
Packing speed/quality tradeoff: xAtlas is a stochastic UV packer, meaning it places UV layouts into an atlas at random positions, hoping to âdiscoverâ an efficient packing. It repeats this process many times, and selects the packing from the best attempt. This allows for direct control over the tradeoff between the time taken to compute the packing, and the quality of the packing. This tradeoff is configurable via the âPacking Iterationsâ setting in the Lighting Window. You can also force the packer to try every possible layout by setting LightingSettings.bruteForcePacking to true via script. This is intentionally not exposed in the UI, as it can take a very long time for larger scenes, so should be used with caution.
Block aligned packing: xAtlas has the ability to align all UV layouts to the boundaries of a 4x4 block of texels during packing. This can help mitigate compression artifacts, such as discoloration due to color bleeding, when using GPU block compression formats such as BC6H, BC7 and DXT5. It does come at the cost of slightly less memory-efficient packing, though. This feature can be toggled via the âBlock Aligned Packingâ setting in the Lighting Window.
Repacking of underused lightmaps: The older packer produces poor packing when a lightmap is just barely about 25% full, as it never attempts to split larger lightmaps into several small ones. With the new packer, we have added a setting âRepack Underused Lightmapsâ which does this. Below is an example of of problematic lightmap before and after the setting is applied:
Setup instructions and settings
The Lighting Window UI has been slightly redesigned to accommodate the new packing algorithm. A new dropdown labelled âLightmap Packingâ has been added. The options are âCustomâ and âAutoâ.

Additionally, the âLightmap Paddingâ and âFixed Lightmap Sizeâ settings have been moved into a new section which is only visible when Lightmap Packing = Custom. In Auto mode, xAtlas is used for packing, with some reasonable default settings.
When Lightmap Packing = xAtlas, the section expands to accommodate a few additional xAtlas-specific settings, controlling the features mentioned in the previous section. To use xAtlas for lightmap packing, simply select it in the âPacking Methodâ dropdown, or use Lightmap Packing = Auto.
Weâve also added scripting API to the LightingSettings class for controlling these new settings.
As a final note, xAtlas also contains functionality for lightmap UV generation / UV unwrapping, which has not been integrated in this release. We intend to investigate whether this makes sense to integrate in the future.
Let us know if you have any questions, or encounter issues with the new packing algorithm. ![]()




