Search Unity

Sprite Shape border overlap fill become transparent issue

Discussion in '2D' started by scozirge, Nov 12, 2018.

  1. scozirge

    scozirge

    Joined:
    Feb 24, 2015
    Posts:
    80
    I add material to the sprite and use sprite shape to design my terrains. I can change the depth sorting to avoid two overlapping sprite shape become transparent, but the fill will overlap the border. Looking at the picture below.

    The top one is the result I want. But the real result is the below one(fill overlap the border and become transparent(like a white line) because they are in the same position z)
    upload_2018-11-12_16-16-46.png

    this is sample package
    Github link:
    https://github.com/scozirge/SpriteShapeIssue

    Does anyone know how to fix it? Thanks.
     
    Last edited: Jan 4, 2019
  2. scozirge

    scozirge

    Joined:
    Feb 24, 2015
    Posts:
    80
    Do anyone know how to tackle this issue?
     
  3. Primoz56

    Primoz56

    Joined:
    May 9, 2018
    Posts:
    369
    Haven't worked with sprite shapes, but maybe using sprite masks could solve your issue?
     
  4. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    644
  5. scozirge

    scozirge

    Joined:
    Feb 24, 2015
    Posts:
    80
    I have updated my test project to 2018.3.0.f2 by unityhub and it was still the same problem. I uploaded my test project to github. It can clearly be seen that the border and fill overlap and become transparent in the game scene. I think that's because of the two sprites on the same depth.
    Github link:
    https://github.com/scozirge/SpriteShapeIssue

    Thanks for the help.
     
    Last edited: Jan 4, 2019
  6. scozirge

    scozirge

    Joined:
    Feb 24, 2015
    Posts:
    80
    I have updated my project to 2018.3.0f2. However, the problem still exists. Where do I file a bug report?
     
  7. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    644
    @scozirge Thanks for submitting the test project. Will take a look asap and will update this thread.
     
  8. scozirge

    scozirge

    Joined:
    Feb 24, 2015
    Posts:
    80
    Thanks. I really appreciate. Is there any other way to tackle the issue, like changing every individual border's sorting layer?
     
  9. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    644
    @scozirge To resolve the issue with diffuse shader, please disable ForwardAdd by add noforwardadd in
    #pragma surface

    Attached is the modified Spritres-Diffuse shader for reference.

    Please let us know if this fixes the issue.
     

    Attached Files:

  10. scozirge

    scozirge

    Joined:
    Feb 24, 2015
    Posts:
    80
    @Venkify It works. Thank you for your patience. I really appreciate your help.
    upload_2019-1-15_14-35-23.png
     
  11. MercurialKid

    MercurialKid

    Joined:
    Aug 30, 2018
    Posts:
    22
    Agreed. This fix works.
     
  12. unity_gcY466ShONMKpQ

    unity_gcY466ShONMKpQ

    Joined:
    May 19, 2021
    Posts:
    2

    i have same issue, can you please explain more how and where should i apply this fix in unity??
    like i don't even know where is forwardadd!