Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Bug Sorting and normal maps

Discussion in '2D Experimental Preview' started by bobbaluba, Jun 28, 2020.

  1. bobbaluba

    bobbaluba

    Joined:
    Feb 27, 2013
    Posts:
    78
    Hi, I'm experimenting with the 2D lights package, and I'm having some issues with normal maps and sorting...

    Now if the object with a normal map is in front, everything is ok:

    upload_2020-6-28_15-29-14.png

    However, if it's behind another object, then the normal map of the occluded object is used on the object in front...

    upload_2020-6-28_15-30-4.png

    Is this a bug?

    While it doesn't occur if I move the objects to different sorting layers, however, I do want sorting based on y-position, as I want to do a 2.5 style game.
     
  2. bobbaluba

    bobbaluba

    Joined:
    Feb 27, 2013
    Posts:
    78
    I was able to work around it by essentially recreating the standard lit 2d shader in shader graph.

    EDIT:

    Actually, no. Now I have the opposite proble, but it's less noticeable. The box'es normal now overrides the characters, even though it's in front :/
     
    Last edited: Jun 28, 2020
  3. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,250
    I too have this problem, and in my case, I use depth buffer as well and when i use depth buffer and normal, rendering normal is done before working with depth buffer making the sprite to actually draw correctly using depth buffer but with incorrectly rendered normal buffer.. it is messed up right now.
     
    Last edited: Jul 1, 2020
unityunity