Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Animating normal maps for sprites

Discussion in '2D' started by Bhrody, Jul 29, 2020.

  1. Bhrody

    Bhrody

    Joined:
    Jan 23, 2019
    Posts:
    2
    I've been trying to find a way to animate a sprite together with a normal map matched up to each frame, but as far as I can tell, this doesn't seem to be a part of Unity's standard workflow? Coming from Godot - where this is as trivial as plugging in your regular sprite sheet, then your matching sprite sheet of normal maps right under it and bam... it just works - it seems strange to me that I can't find anything roughly equivalent in Unity. It seems like a feature animators would be keen to have rather than implementing shaders for just edge lighting or something similar. Is there a package I'm not aware of somewhere that helps with this?

    I have seen tutorials on how to use a normal map with static images, but no dice for sprite sheets. I'm not sure if my google-fu is failing me, or if it's just not something typically done here. Though I've hacked around in Unity a bit here and there, I don't have much real experience with what Unity has to offer. If anyone can point me in the right direction, it would be much appreciated as this is something very important to the project I have in mind.
     
  2. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    If you are using a frame by frame Sprite animation with a SpriteRenderer, you could set up the normal maps for your Sprites using this:
    https://docs.unity3d.com/Manual/SpriteEditor-SecondaryTextures.html

    When the Sprite changes in the SpriteRenderer, the SpriteRenderer will be able to pick up the corresponding normal map for the newly changed Sprite frame.
     
  3. Bhrody

    Bhrody

    Joined:
    Jan 23, 2019
    Posts:
    2
    Ah, that looks like it could be the way to go. Thanks, I'll check it out!