Texture Atlasing In Depth
Here you'll learn how to get the best results from texture atlasing, as well as how to resolve some common issues.
Last updated
Here you'll learn how to get the best results from texture atlasing, as well as how to resolve some common issues.
Last updated
Depending on your target, you may get more efficient results using the Material Merging options within the Character Assembler, instead of texture atlasing. Material merging prevents wasted space on the UV map, and the cost of rendering another draw call may be lower than the increased VRAM requirements. As with all performance related questions, you will want to test this and see what works best.
For materials to be merged through the texture atlas system, the following conditions need to be true:
The materials must be using one of the built-in shaders.
The materials must be using the same render queue (Transparent, Opaque, etc).
The materials must have the same textures filled in (i.e. for normal maps to atlas, all materials must contain a normal map; if any of them are missing a map, it will break the atlas).
Tip: If you see errors noting that "Material doesn't have a texture property" in the console, this means part of the asset may not be able to merge all the textures into the atlas. Showing log messages will tell you which materials may be causing the problem. Generally not all materials can be safely atlased, so these errors are purely informational.
For texture atlasing to work at its most efficient capacity, the number of materials packed into the atlas should be a power of 2 (i.e. 1, 2, 4, 8, 16, 32...) if the texture sizes are equal. Otherwise, the map may contain a large unwanted amount of wasted space.
You can adjust this by tweaking the Unity texture import resolutions on particular textures. This will allow the packing to more effectively use the space.