Search Unity

Working with Normal Maps and Sprite Atlases

Discussion in 'General Graphics' started by 82MiddleMan, Jul 13, 2020.

  1. 82MiddleMan

    82MiddleMan

    Joined:
    Jul 6, 2015
    Posts:
    23
    All my sprites for my character are separate and put into a sprite atlas, but I found out (the hard way) that when I put a normal map on those sprites (as secondary textures in sprite editor), they don't work because of the sprite atlas (they work fine after taking the sprites out of the atlas).

    So what's the best practice here?

    I've been setting my normal maps to normal map when I import them, but that means I can't make an atlas of them. They seem to still work when set to sprite, and I'm guessing if I do that and make an identical atlas to the other sprites it will work. But I've tried doing this and despite the 2 folders having the same amount of files, with the same names, and the same dimensions, it arranges them differently. And there must be a reason there's a normal map mode, so should I be using it?

    The only other option seems to be to not have anything that needs a normal map in an atlas, but that would be a huge amount of sprites for me.

    Am I missing something? What's the best solution here?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Short version is you need to have a separate sprite color and normal atlas, they can't be part of the same atlas. They also can't use Unity's auto-atlasing as there's no guarantee it'll auto-atlas two sets of sprites the same. You have to generate your atlases outside of Unity, and make sure that both the color and normal atlases have exactly the same layout.
     
  3. 82MiddleMan

    82MiddleMan

    Joined:
    Jul 6, 2015
    Posts:
    23
    Thanks. I was thinking I was going to have to do that. Which is a right pain as everything is saved as separate sprites and using unity's atlases.