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
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Sorting and normal maps

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

  1. bobbaluba

    bobbaluba

    Joined:
    Feb 27, 2013
    Posts:
    81
    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:
    81
    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,517
    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