Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Is there any way to add a material with a normal map to a SpriteShape sprite?

Discussion in '2D Experimental Preview' started by tmcdonald, Oct 13, 2019.

  1. tmcdonald

    tmcdonald

    Joined:
    Mar 20, 2016
    Posts:
    160
    Hi all!

    I'm playing around with 2d lighting and sprite shapes. I know with a sprite renderer, I can just assign a material that has a normal map on it to get the lighting effect I desire. I have a sprite with an accompanying normal map texture that I really like the look of (and the 2d lighting works perfectly with it on a sprite renderer.) But I don't know how I can pull this off with a SpriteShape. Does anyone know a good way to make this work?
     
  2. tmcdonald

    tmcdonald

    Joined:
    Mar 20, 2016
    Posts:
    160
    I wanted to add an example to demonstrate what I'm talking about:



    The object on the left is has a SpriteRenderer with the same sprite and a material with a normal map I created. On the right is the sprite shape I created with this sprite. But I cannot find any way to use the normal map with it.
     
  3. dquek

    dquek

    Unity Technologies

    Joined:
    Apr 17, 2018
    Posts:
    70
    Hi @tmcdonald ,

    If you use latest 2019.3 Editor together with the latest packages:
    Universal Render Pipline 7.1.2
    SpriteShape 3.0.5

    ===
    You should be able to use Normal Maps.

    1. Add the normal map via Secondary Texture Module in Sprite Editor window.

    2. Make sure you activate the "Use Normal Map" checkbox in your 2D light
    upload_2019-10-21_17-50-45.png

    3. Also use this "Enable Tangents" in your Sprite Shape Controller to make sure the Normal Map orientation is correct throughout the SpriteShape.
    upload_2019-10-21_17-51-45.png
     
    Devhog likes this.
  4. jarbleswestlington_unity

    jarbleswestlington_unity

    Joined:
    Dec 6, 2017
    Posts:
    32
    I'm having this problem even with tangents enabled. Can't figure out why. (spriteShape on the left, normal Sprite with the same texture on the right)
    upload_2021-4-23_22-17-32.png
     
  5. jarbleswestlington_unity

    jarbleswestlington_unity

    Joined:
    Dec 6, 2017
    Posts:
    32
    Ah. It looks like the issue is that the "fill" texture doesn't support normal maps. Bummer.
     
    RemDust likes this.