Like many 2D games these days, I’m using normal mapped sprites. 2017’s Sprite Atlas asset allows me to handle the sprites, but how do I go about atlasing the normal maps to go with them?
You have to make the same layout for the sprite sheet and the normal maps.
Here’s a tutorial - skip the first part if you already have the normal maps.
Okay, so it’s not a feature supported in Unity itself.
I’m having a look at TexturePacker. In principle it looks good, but I can’t get it to work. It keeps combining my albedo sprites with my normal sprites on one sheet and doesn’t put the normal maps in the normal-map texture.
I’ve tried every combination of normal maps and sprites in the same folder, different folder, smart folder, manually adding sprites, different names, etc, but it just ain’t working.
Edit: I managed to get normal maps working by using manual settings instead of automatic. My next observation is that there’s a drop in quality versus my current solution of using mesh renderers and individual materials for each.
With Unity’s sprite packing I can put all my ship sprites into an atlas to save on memory and organisation (don’t need to be powers of 2) but still reference individual sprites as textures inside a standard shader. Using TexturePacker, although I can pack the textures, I cannot assign them individually to materials so can’t apply them as needed.
You have to check “Pack with same layout” in the “Normal maps” section in the right sidebar.
If Auto-detect does not work set “Normal map suffix” => “_n” or the “Path filter” to “Normals”.
Which one of these 2 images do you consider better? The left one is blurry, the right one does not blend the border pixels with the background. What texture settings do you use?
Texture settings were identical (24 bit normal map, 32 bit RGBA texture). The left one (mesh renderer) is better as it’s antialiased - the right one runs the risk of crawling edges. That said, further tests suggests no difference, so I’m not sure what’s going on in this case and will have to evaluate more. Seems the texture sampling was different in some way in the sprite which may have something to do with sprite rendering. (?)
Is there any chance TexturePacker sprites could be referenced as if they were stand-alone textures like Unity’s packed sprites? TexturePacker is fine if you want to grab a sprite from it and place that in game, but I can’t atlas a whole load of sprites for particle effects or use them in NGUI. Unity’s atlasing is the only convenient way to get individual sprites usable as individual textures (can assign them to materials, draw them on a quad mesh renderer, use them in particle effects) being packed into memory-saving atlases. I’m looking at TexturePacker only for normal-mapped sprite objects at the moment, which means two different workflows.
Edit : I’ve just converted a load of sprites to TexturePacker and applied in game, and they sadly appear a pixelated mess in motion. I’ve tried Unity’s sprites and they too are a pixelated mess when very small, so it seems to be an issue with how the sprite renderer works. If I can’t get the Sprite Renderer to draw smoothly, or get TexturePacker individual srpites accessible as textures, it’ll be no use to me and the only way for me to proceed will be manually placing sprites into an atlas and calculating texture coordinates a la 2003.
TexturePacker currently creates the same as if you import a sprite sheet and slice it in Unity. You don’t have access to the sub-textures - just as part of the sprites.
If I can’t get the Sprite Renderer to draw smoothly, or get TexturePacker individual srpites accessible as textures, it’ll be no use to me and the only way for me to proceed will be manually placing sprites into an atlas and calculating texture coordinates a la 2003.
That’s at least something you won’t have to do. You can customize the output format from TexturePacker. E.g. create a C# file with the coordinates or JSON or whatever format you want to use with the coordinates.
Okay, I’ll look into that.
Seems I’ve fixed the rendering quality. Unity 2017 imports textures with mip maps off by default for some reason. Swtiching them on for the TexturePacker texture produces the correct results.

