Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Unity 2D Sprite Shape is out of preview for 2019.3

Discussion in '2D' started by rustum, Jan 30, 2020.

  1. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    112
    Why not unity just buy the ferr2D or hire the developer to work for them? I also don't know why people most of the time use tilemaps but reject the idea of using sprite shape 2D.
     
  2. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    105
    It's not really a feasible option to hire a 3rd party developer, who probably is busy with other things, for a simple asset that they already have a functioning version of. And SpriteShape and Ferr2D are wildly different which is not really a bad thing even though the goal of both being relatively the same. Despite Ferr2D currently being 'better', it still has a lot of flaws. In my opinion SpriteShape has more potential given that it's more integrated into Unity's framework, they just need to find the time to improve it and add features. But I understand why that would be low priority right now.
     
  3. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    353
    I gotta check our Ferr2d. I have problems with using continuous shapes and different sprites in different directions, and I’d also like to make a shader for the fill and outlo r to make shadow effects for our 3/4 topdown game. Can ferr2d do that?:)
     
  4. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    353
    I checked the vids on Ferr2d and it seemed to fit our project very well, with the different types if gradients you can put on the fill and also it seems to support different sprites even if it’s a continuous line.

    But it seems abandoned and the reviews say it doesn’t support 2d lights. Can anyone confirm that?
     
  5. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    112
    The developer works for hololens for Microsoft. He seems very happy with it. But he is not making updates on the Ferr2D plugin now.
     
  6. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    416
    @nicmarxp The sprite that is used along the spline can be specified through 1) Angle Range 2) Variants.
    Angle Range : This will set the Sprite along the spline for the Angle specified from point to neighbor. An Angle Range is calculated on start of Every point that is set to Linear of Broken Tangent mode. For Continuous Tangent mode, Angle Range Sprite is only calculated on point where the Continuous mode starts and the same sprite is used for subsequent points where the Tangent mode is Continuous. If you want to set a different sprite within this Continuous sequence of points you can use Variants.

    Please take a look at the Enclosed demo.
     

    Attached Files:

    nicmarxp likes this.
  7. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    416
    @pastaluego
    SpriteShape provides 3 different Quality for Spline Detail which are usually good for most set of Inputs (4, 8, 16). Beyond 16 the topology is generally indistinguishable. However you may want to have even more fine grained Subdivision that may result in better UV along very acute curves. While 4, 8, 16 are the ones that are set by default, you can experiment with higher Spline Details to achieve the better UV. Please take a look at the enclosed demo and the sample script.


    We believe Corner sprites are provided to solve such cases.

    Thanks again for the feedback.
     

    Attached Files:

  8. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    353
    Thanks a lot, the broken points helped.

    What I'm trying to achieve is something like this. Do you think it would be possible?
    The confusing part is drawing everything pointing in the same direction, and making the seam between the sprites work, but it doesn't seem impossible.. :)

    pond.png
     
  9. zlremillard

    zlremillard

    Joined:
    Nov 19, 2014
    Posts:
    11
    Hello!
    Let's say I want to build something like the "vine" from the image in the first post of this thread and I would like to "reveal" the vine with an animation where it appears that it's growing along the spline.

    How could I achieve something like that? I've tried playing with a cutoff shader based on the uv but it affects each segment of the spline individually instead of the entire Sprite Shape. Is the mesh generated by Sprite Shape properly uv-mapped so that it can be filled from 0 to 1 in its entirety?
    Thanks!

    spriteShape.png
     
  10. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    599
    Does the SpriteShape API or API for the underlying Spline allow you to get positions along the spline at points other than the nodes?
    I'd like to add some functionality to SpriteShape to position GameObjects along the spline. I'd like to be able to position them anywhere along the spline (not just the nodes) and I'd like to be able to get the tangent/perpendicular for that point as well.

    Is this possible with the SpriteShape API's?

    -Jeff
     
  11. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    416
    Please take a look at Sprinkler script in SpriteShape Samples. Please use the attached script that extends the sample Sprinkler script to place a node at any random position in the Spline not just control-points.

    Please note: The attached script is just a demonstration of how it works. You may want to extend it to suit to your needs. We may update and refine this script in the Samples in near future. Thanks.
     

    Attached Files:

    Peyot and jeffweber like this.
  12. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    416
    I believe this can be done with Seamless variants and/or multiple SpriteShapes overlayed on top of another to achieve this.
     
  13. UWSUMUT

    UWSUMUT

    Joined:
    Jul 14, 2020
    Posts:
    1
    Hello, I have made a sprite shape profile with multiple sprites for different angles but sprite variants won't be shown if the tangent modes are set to continuous. They only work in linear or broken modes. Is there any way to achieve the same effect with smooth, curved corners?
     
    Last edited: Oct 30, 2020
  14. mikeacall

    mikeacall

    Joined:
    Oct 7, 2020
    Posts:
    1
    @Venkify Not sure the best place to ask this question, please direct me if this isn't the right place. I'm using 2D sprite shape. On my shape, hen i use a linear tangent, i can't get the vertex to stretch. As seen in the top picture. If i set the vertex to continuous the vertex stretches and looks better, but ends up mucking up the next vertex, causing the corner image to not display. Any thoughts?
     

    Attached Files:

    Last edited: Nov 5, 2020
  15. SofielafeeStudio

    SofielafeeStudio

    Joined:
    Mar 26, 2018
    Posts:
    13
    hi everyone, I'm trying to auto-destroy my platforms by calling OnBecameInvisible. This function is not triggered for sprite shape renderers; maybe I've got it wrong, has anyone tried? Would it be possible to support this event? thanks
     
  16. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    5,171
    Is there any way to detect if a sprite shape was updated at edit time?

    We're using both SpriteShapes and Tilemaps, and for the Tilemaps we're heavily using
    Tilemap.tilemapTileChanged
    in order to do post processing of the generated geometry. It'd be really convenient to have something similar for SpriteShapes, but I can't find anything in the API.
     
  17. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    515
    Hey, you might be able to accomplish this with a custom Culling Group.
    https://docs.unity3d.com/Manual/CullingGroupAPI.html

    Unity provides a detailed example for setting up custom Particle System culling.
    https://blogs.unity3d.com/2016/12/20/unitytips-particlesystem-performance-culling/

    Basically you can define sphere(s) and receive callbacks for visible/invisible etc.
     
  18. KoolGamez

    KoolGamez

    Joined:
    Apr 11, 2020
    Posts:
    14
    Can someone direct me to a resource that explains how to use this tool to create procedural shapes in Unity? I have tried searching for it and can't seem to find a comprehensive explanation/tutorial. My goal is to create endless shapes like twisting top/down roads or a smooth hills (like the ones in alto's adventure) using this asset
     
  19. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    112
    Can someone list me the PROS and CONS of Spriteshape? I hate making tiles. I really don't want to use tiles. I am wondering if I can totally replace tiling with Spriteshape.

    If Spriteshape does not meet the requirements maybe I will buy Ferr2D or Spline Terrain 2D

    But the problem with 3rd party tools is the support and after a while they stop developing the tools. Thus, becoming outdated.
     
    Last edited: Nov 21, 2020
  20. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    599
    Is it possible to have a gradient fill on a sprite shape. Either out of the box or using custom shaders?
     
  21. jrmgx

    jrmgx

    Joined:
    Oct 21, 2016
    Posts:
    28
    I've see that issue 1274400 has been fixed for version 5.1 of the spriteshape package and that's nice (I'm having this issue) but it's been reported on version 3.0.12 (unity 2019.4 LTS, the one I'm using) is it going to be back ported?
    If not (it will be a shame as 2019.4 is LTS), but anyway is it possible that I can do it myself?
     
  22. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    416
    Thanks for the post. Variants should work in Continuous mode as well. Please let us know the version of SpriteShape you are using. A quick demo is attached:

    SpriteShapeVariants.gif
     
  23. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    416
    A control point will be considered a Corner (Stretched or Auto) only if its neighbors are also in Linear mode.
    The reason is when using non-Linear neighbors, the corner can become distorted at acute angles and will result in geometry artifacts. As of now, please workaround by adding a linear point closer to the corner on both sides and it should now add a corner at the Control point. We will consider allowing more flexibility in the future. Will post an update once we have some info.
     
  24. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    416
    OnBecameInvisible() as well as OnBecameVisible() are both supported and should work well for SpriteShapeRenderer. Please submit a bug report with a simple repro project. Also please let us know the version of SpriteShape used. Thanks.
     
  25. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    416
    Please take a look at the function
    bool HasSplineDataChanged() in SpriteShapeController.cs
    You could add a similar function in your project and check for a change in hash. Hope this helps.

    We will consider this in an upcoming version. I will keep this thread updated. Thanks.
     
  26. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    416
    Yes, I would suggest creating a custom shader that blends the fill texture and the gradient texture.
     
  27. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    416
    Thanks for the post. We will ensure this gets backported in the upcoming version (3.1.5 hopefully). Will keep this thread posted. Thanks again.
     
unityunity