What you are going to learn:
Most game engines that support dynamic lighting and sprite sheets — e.g. Unity — require the normal maps to be packed in the same way as the sprites.
The reason is simple: The OpenGL shaders are fed with one set of coordinates and 2 textures. Using a different layout would require handling additional coordinates.
There are 2 obvious ways to accomplish the goal:
Packing the sheets first then generate the normal maps on the whole sprite sheet sounds like a good idea — but it is not:
This way has several advantages:
TexturePacker 3.7.0 has a new normal map packing mode. Depending on the file organization in your project it's just adding the normal maps and setting the check mark Normal maps/Pack with same layout :
Pressing Publish creates a normal map sheet in the same directory as your sprite sheet, using the same data format and the file name suffix _n .
TexturePacker's Normal maps/Auto-detect mode should in most cases do the work. You can override the auto-detection in cases where it does not work as expected - see Overriding auto-detection.
There are 2 common layouts for the folder structure, TexturePacker handles both of them:
Adding the normal maps is easy: Just drag & drop them into TexturePacker.
TexturePacker matches the normal maps and sprites based on the longest common file name part.
The easiest way is to simply keep everything under the same main folder add this as a smart folder. TexturePacker re-creates the sprite and normal map sheet as soon as one of the images changes.
Detecting normal maps is heuristics based. You can disable it in case it does not work with your normal maps.
Override settings are available after clicking on Normal maps/show advanced
Use the Path filter if you are keeping your normals in separated folders. All sprites under a folder path containing the filter expression are treated as normal maps.
Use the Normal map suffix if you are using a suffix for your normal maps.
TexturePacker's settings for Trim mode , Extrude and Padding all work with the normal maps.