Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Unity SpriteShape 3.0.6 is out

Discussion in '2D' started by rustum, Nov 4, 2019.

  1. rustum

    rustum

    Unity Technologies

    Joined:
    Feb 14, 2015
    Posts:
    51
    This version adds improvements to corners, including the ability to adjust the pivot of corner sprites and adjust corner threshold angles. Tessellation is also smoother for corners. An optional performance boost can be activated by installing the Burst Package. Check out the information below for more on this release.

    Getting Started:
    1. Install latest Unity 2019.3.
    2. Open Package Manager by going to Window > Package Manager
    3. Choose SpriteShape 3.0.6 from the list and click on Install at the bottom right of the Package Manager window.

    Here’s more details on this release:

    What’s New
    • It is now possible to adjust the pivot of a corner sprite. This makes it easier to align them with edge sprites.
    • Corner threshold angles can now be set by users.
    • The mesh generated at Sprite Shape corners is now smoother.
    What’s Changed
    • The Sprite Shape package will now benefit from a performance boost by optionally installing Burst package
      • Important Considerations
        • Currently the Burst package is not a dependency of this package and is therefore not installed by default. This is because the performance code in our package is new and we want to make sure it is stable before we install Burst by default.
    Fixed
    • Fixed an issue where Inputting Point Position manually causes mesh to not conform to the spline:
      • SpriteShape now gets generated properly.
    • The conforming sprite shape sample has been improved to remove GC except when editing.
     
  2. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    562
    I get the following errors... They do not block the game from running but they are a bit annoying.

    Screen Shot 2019-11-04 at 9.36.12 AM.png
     
  3. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    216
    We have fixed this and will publish a new version soon. Thanks.
     
    jeffweber likes this.
  4. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    216
    A quick demo for the above :

     
    Silenus3 likes this.
  5. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    56
    I just installed the 2019.3 beta and the 3.0.6 package and am trying to get the corners to generate but can't seem to be able to. I'm not sure if I'm doing anything wrong. Am I supposed to still be using corner sprites or are they now supposed to automatically generate by merging the adjacent edge textures like continuous tangent mode does?

    I tried adjusting the corner threshold but it never seemed to make any change.

    Here's an example of my attempt with a quick sample texture I made for testing that's a little less uniform than blocks of color.
    upload_2019-11-10_17-47-37.png
    No amount of adjusting the linear tangent mode could I get the ends of the edge textures to combine into a corner, so I'm not sure how the new corners work and what's supposed to be happening or if we had a misunderstanding.

    I finagled the continuous tangent mode vertices to kind of resemble a corner to somewhat give an idea of what I ideally imagine the linear tangent mode would do texture-wise (except hopefully with a more accurately sharp angle relative to the angle of its adjacent spline edges as shown in the red line, which I can only assume is possible since Ferr2D can do it).
     
    Last edited: Nov 11, 2019
  6. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    56
    Also I had mentioned this before but there's still an issue with the collider offset not behaving perfectly when the spriteshape has edge textures.


    For some bizarre reason offset = 0 is currently identical to offset = 0.001, and the closer you get to zero, the more accurate it becomes. So offset = 0.0000001 is somehow closer to the mesh than 0 is.

    upload_2019-11-10_18-52-58.png
    If no edge textures are present, then offset = 0 correctly matches the mesh outline and is perceptually identical to offset = 0.0000001 (6 zeros or more) with edge textures present.

    Very strange bug.
     
  7. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    216
    Could you please send us the project ? Also please find another quick demo with simple sprites to demonstrate the functionality of corners in 3.0.6 attached. Corners.gif
     
    Last edited: Nov 11, 2019
  8. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    56
    I tested the corners and they're definitely way better than before. The problem for me lies with making corners look seamless for natural-looking textures.

    Included in the attachment project are a bunch of example spriteshapes I just made with random textures I found online to showcase the transitions that different types of textures need to blend the edges and the fill textures.

    For the non-natural brick-like stone texture you can see the new corners work very well, though spriteshape isn't really ideal for oddly shaped man-made looking textures as you can see with the stone texture the seams are a little too obvious. For the more natural rocky texture you can see that corner sprites don't really work well (though I didn't really spend more than a minute making the corner sprites so they don't currently transition with the edges properly). They just don't transition as well as corners that were created by combining the adjacent edge textures like continuous tangent mode does, because they require their own baked transition into both adjacent edge textures, which isn't a very quick process and limits the types of edges the corner works for to virtually only one, as well as a transition that respects how those specific edge textures transition into the fill texture, which I'm not sure if it's even possible to do. At least not easily.

    In terms of workflow it'd also be much more convenient for the developer since creating corners that are as seamless and natural looking as possible for each corner type isn't a trivial amount of work by itself, and even moreso for detailed textures. If the adjacent edge textures were combined and bent into a corner it would render the need to create corner sprites unnecessary as well as look better than handmade corners in what I believe to be the majority of cases.

    Ultimately for me the 2 main factors are the time involved in making a good looking spriteshape, and the idea that even the most miniscule flaw in the seams of a spriteshape can instantly turn it from looking professional into amateurish. And the amount of time it takes to make corners with no guarantee they'll look clean is not currently worth the risk for me personally. If I was working with much simpler textures and straight angles then I'm sure I could get away with it.

    I also included in the samplescene an example of the collider offset bug. If you zoom in super far into the top right corner and mess with the offset values I described in the above post you'll be able to see what I'm referring to.
     

    Attached Files:

    Last edited: Nov 11, 2019