You combined your meshes, but the draw calls barely moved. The reason is almost always materials: every unique material is a separate draw call, and no amount of mesh combining helps until your textures share one. A texture atlas fixes exactly that.
Unity issues roughly one draw call per material per object. A scene with 200 props on 200 materials costs ~200 draw calls, even if every prop is a 12-triangle box. Mesh combining merges geometry, but combined meshes still referencing 15 different materials still cost 15 draw calls. The material count is the ceiling; geometry merging only gets you to that ceiling.
A texture atlas attacks the ceiling directly. Pack 20 small textures into one big image, point every mesh at that single texture through one shared material, and 20 draw calls become 1. It is the single highest-leverage optimization for prop-heavy, modular, or kit-bashed scenes.
The trick is UV remapping. An atlas is a big texture divided into regions, one per original texture, and every mesh's UVs get remapped to sample only its own region:
// Remap a mesh's UVs into one region of a texture atlas
void RemapUVsToAtlas(Mesh mesh, Rect atlasRect)
{
Vector2[] uvs = mesh.uv;
for (int i = 0; i < uvs.Length; i++)
{
uvs[i] = new Vector2(
atlasRect.x + uvs[i].x * atlasRect.width,
atlasRect.y + uvs[i].y * atlasRect.height
);
}
mesh.uv = uvs;
}
Three ways to build one:
- Unity's Sprite Atlas (Window → 2D → Sprite Atlas) — built-in, zero code, but sprite-oriented. It will not remap 3D model UVs.
- Manual atlas in an image editor — pack textures into one power-of-two image (1024, 2048, 4096), leave 4–8 pixels of padding between regions, convert each region to normalized UV space, remap each mesh, then combine. Full control, but add one new prop and you repack everything.
- Automated atlas baking — a tool collects textures, packs them with proper padding, remaps every mesh's UVs, and outputs one material. This is the practical choice for anything iterative.
Pitfalls that break your visuals: texture bleeding without padding (bilinear filtering samples neighboring regions at seams); mipmap bleeding at lower mip levels (keep opaque and alpha-tested textures in separate atlases); non-power-of-two sizes (mobile GPUs compress poorly); 4096 atlases with 64 props meaning each prop gets only ~512px (split hero assets into their own materials); and lightmap UV2, which atlas bakers must preserve or regenerate if you bake lighting.
Measure the win, don't trust vibes: open the Frame Debugger (Window → Analysis → Frame Debugger) and watch the atlased props collapse into a single draw event, and watch Batches drop in the Game view Stats panel. A typical prop-heavy scene goes from 150–300 batches to under 50 with combining plus atlasing. And profile on your actual target device — draw-call overhead is CPU-side, so a scene fine on a dev PC can still choke a phone or Quest.
I build VR games at PixelFalconVR and Unity tools at BlackBox Creations.
Full write-up with the complete method breakdown and FAQ: https://kashi45248-prog.github.io/Blackbox_creations-/tutorial-texture-atlas-unity-draw-calls.html
Top comments (0)