Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Ferr2D Terrain Tool

Discussion in 'Assets and Asset Store' started by koujaku, Oct 9, 2013.

  1. SpecTrePaul

    SpecTrePaul

    Joined:
    Jan 10, 2017
    Posts:
    2
    Been testing this on my game with the URP and 2D lights and have found that this works fully, including with shadows when editing the shadow polygon shape.
    I was going to switch over to Unity Sprite Shape but I don't need to now.

    All I did was update my project as you would to URP and then change all the shader renderers to the URP 2D one and it just worked out of the box. Fully compatible with layers and lights.

    If you find that you can't edit the shape it will be because the editor turned off Gizmos when changing to URP so just press the Gizmo button and can edit again.

    To edit the shadow shape of the Ferr2D polygon you have to hold down the control key to select, move and create new points or it won't work.

    Just to show, here I have 2 square Ferr2D objects on a background sorting layer only being effected by a global light. A 2D point light casting onto the Ferr2D object with shadow polygon set and casting a shadow onto a Unity Sprite Shape object.

    Thats it, just works. Very happy!!

    Screenshot 2020-12-09 at 19.08.09.png

    This image is showing the light using cookies too and shadow shape set on the pipe.

    Screenshot 2020-12-10 at 14.09.07.png
     
    Last edited: Dec 10, 2020
    wedgiebee and PhantomFox128 like this.
  2. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    199
    2020.2 seems to make it so alt functions like deleting a node no longer work.

    I believe due to a fix by Unity for this bug report
    https://issuetracker.unity3d.com/is...-rotation-when-mouse-hovering-over-the-button

    It appears to have caused Handles.Button not to register a click in OnSceneGUI when alt key is pressed. So it's not a Ferr2D issue it's a Unity issue that causes Ferr2D alt functions not to work.

    **Appears it was an intentional change. So despite ALT working as a modifier for Handles.Button's onclick for the past 10 years, it was never 'supposed to' and now no longer does.
     
    Last edited: Jan 6, 2021
    streetjustice likes this.
  3. MGNClam

    MGNClam

    Joined:
    Jul 20, 2019
    Posts:
    2
    When laying down walkable paths - for physics purposes, I want to "snap" terrain to 15degree angles.

    So the ground is either flat, 15/30/45/60 degrees.

    Is it possible to make Ferr snap like that when placing walkable terrain?

    I dont want it to snap like that for ceilings/walls/etc.. Just where the player can walk. Obviously I'm aware i can just do this manually, but Im just looking for a way to speed up/tweeking level creation.

    Ideally if I can "snap" along X axis in "steps" too, that'd also be great. So then I can plan my jumps better (1 unity unit being a short jump, 2 a long jump, etc).
     
  4. Kruemelkatze

    Kruemelkatze

    Joined:
    Sep 5, 2014
    Posts:
    10
    Hey!

    We also wondered how to snap the terrain vertices to the grid. And it only took us 3 months to notice the Ferr menu bar on top of the scene view, d'oh. Anyway, I noticed that the snapping only works in 1 unit steps, apparently ignoring Unity's snap settings. Looks like Ferr uses some obsolete EditorPrefs API for those settings.

    To fix this, make following changes:
    Code (CSharp):
    1. // file: Ferr/Editor/2D/Ferr2D_PathEditor.cs, line 140 and 656
    2. // replace following code
    3. new Vector3(EditorPrefs.GetFloat("MoveSnapX"... // OLD code
    4. // with this
    5. EditorSnapSettings.move
    6.  
    7. // file: Ferr/Editor/Common/EditorTools.cs, line 54
    8. // before:
    9. return new Vector3(EditorPrefs.GetFloat("MoveSnapX", 1), EditorPrefs.GetFloat("MoveSnapY", 1), EditorPrefs.GetFloat("MoveSnapZ", 1));
    10. // replace with:
    11. return EditorSnapSettings.move;
    You can then adjust Unity's snap settings (see pic). Ferr uses those snap settings once you disable Smart Snapping (afaik).

    Hope that helps! :)
     

    Attached Files:

    Fibonaccov likes this.
  5. streetjustice

    streetjustice

    Joined:
    Feb 12, 2014
    Posts:
    6
    Did you find a work around for deleting points?
     
    sergioschiavo likes this.
  6. sergioschiavo

    sergioschiavo

    Joined:
    Feb 11, 2014
    Posts:
    28
    Yes it has been posted before by @Kruemelkatze

    1. Code (CSharp):
      1. // file: Ferr/Editor/2D/Ferr2D_PathEditor.cs, line 140 and 656
      2. // replace following code
      3. new Vector3(EditorPrefs.GetFloat("MoveSnapX"... // OLD code
      4. // with this
      5. EditorSnapSettings.move
      6. // file: Ferr/Editor/Common/EditorTools.cs, line 54
      7. // before:
      8. return new Vector3(EditorPrefs.GetFloat("MoveSnapX", 1), EditorPrefs.GetFloat("MoveSnapY", 1), EditorPrefs.GetFloat("MoveSnapZ", 1));
      9. // replace with:
      10. return EditorSnapSettings.move;
     
    Kruemelkatze likes this.
  7. Kruemelkatze

    Kruemelkatze

    Joined:
    Sep 5, 2014
    Posts:
    10
    It's actually that code: ;)

     
    linh60bpm likes this.
  8. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    Hello Guys,
    I have an issue with the Wavy shader. When my camera is near of the X;Y value of my sprite renderer. Then this one have a "jump" onto the wave.

    EDIT: Happen not when XY of camera is near of XY of sprite renderer but when two sprite renderer are on the screen.

    I look into the shader source but do not see why this glitch appear.

    Code (CSharp):
    1.  
    2. #if defined(FERR2DT_WAVY)
    3.     float4 world      = mul(unity_ObjectToWorld, input.vertex);
    4.     float  waveOffset = (world.x + world.y + world.z) / _PositionScale;
    5.     float  wave       = (_Time.z + waveOffset) * _WaveSpeed;
    6.     result.position   = UnityObjectToClipPos(input.vertex + float4(cos(wave) * _WaveSizeX, sin(wave) * _WaveSizeY, 0, 0));
    7.  

    FIX: I create instance of material in script and all is ok now. This is because shader share the same variables if material is the same
     
    Last edited: Jun 28, 2021
  9. maltakereuz

    maltakereuz

    Joined:
    Mar 29, 2015
    Posts:
    54
    Some terrains are rendered wrong in build. Fill texture is rendered fine in Editor, with regular repeating pattern. But in build in some places of level i am getting this strange line-breaks and something similiar to tearing. Rebuilding or editing terrain does not help. But if i copy terrain in another scene then suddenly visual artifacts are gone. What could be the reason behind such strange behavior and how can i fix it?

    (unity 2019.4.8, ferr2d v2.0.3)

    upd: changing terrains to another seems to fix the problem, but if i change terrain back the stripes are here again.



     
    Last edited: May 6, 2021
  10. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    409
    I just bought ferr2d a few minutes ago and imported it into an Unity 2020.3.3f1 URP project and received two errors, probably a minor thing and easy to fix but fyi:

    Code (CSharp):
    1. Assets\Ferr\2DTerrain\Scripts\Ferr2DT_PathTerrain.cs(272,78): error CS0117: 'TransparencySortMode' does not contain a definition for 'Orthographic'
    Code (CSharp):
    1. Assets\Ferr\2DTerrain\Scripts\Ferr2DT_PathTerrain_Legacy.cs(224,78): error CS0117: 'TransparencySortMode' does not contain a definition for 'Orthographic'
    the reason probably is ambiguity between ferr2d TransparencySortMode and UnityEngine.TransparencySortMode :)
     
  11. Miketysonjr

    Miketysonjr

    Joined:
    Mar 15, 2018
    Posts:
    23
  12. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    @fleity maybe try to modify ferr2d code and add Ferr2D.TransparencySortMode. prefix (kinda things like this)

    Is Ferr2D will be update for Unity 2020?
    In 2019.4 I have sometimes a bug with a prefab. The path data in an instance reset to the original prefab one. This is really annoying in production.
     
    DevWish likes this.
  13. Vincenzo-Merenda

    Vincenzo-Merenda

    Joined:
    Nov 19, 2017
    Posts:
    1
    Any experienced user able to tell me what may be causing this?
    upload_2021-7-21_17-6-35.png

    There's no way to get rid of those lines, even setting all the various "caps".
    I set split distance to a ridiculously low value too, but nothing seems to work against this. Whenever I have any rounded corner the lines seem to be there to stay.

    Would you know about any other ways to do rounded corners that don't rely on the Circle control type?
     
  14. JCPhlux

    JCPhlux

    Joined:
    May 27, 2018
    Posts:
    17
    Was thinking about getting this Asset but it looks like an abandoned project to me. The Asset owner has not posted in the forum in sense Mar 18, 2018 and the last update to the Asset was Apr 13, 2019.
     
  15. OmranRA

    OmranRA

    Joined:
    Jan 12, 2018
    Posts:
    3
    I noticed that control points are not changing the terrain shape anymore after updating to 2020.3.15. Can anyone help me please?
     
  16. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    819
    Any errors in the console?

    edit: I just opened our project in Unity 2020.3.14f1 and moving points rebuilds the mesh as expected.
     
  17. OmranRA

    OmranRA

    Joined:
    Jan 12, 2018
    Posts:
    3
    Ferr wasn't able to find the mesh of the terrain. I made a prefab of the terrain and deleted it. Magically, all terrains started to work fine :D
     
    flashframe likes this.
  18. Rachan

    Rachan

    Joined:
    Dec 3, 2012
    Posts:
    808
    and how to set a size of collider ? it very bigger than terrain edge
     
  19. indie6

    indie6

    Joined:
    Dec 15, 2012
    Posts:
    101
    Hi! Did you face any other issue in Unity 2020.3? I am planning to buy it but just want to make sure it works fine in 2020
     
  20. san40511

    san40511

    Joined:
    Oct 20, 2019
    Posts:
    29
    Hey guys. Can somebody tell me why it is not working. I installed everything but I don't see any control points after adding of the ferr2d object. I see standard unity rectangle with 4 points and that's it
     
  21. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    819
    Do you have the Path component expanded in the inspector?
     
  22. san40511

    san40511

    Joined:
    Oct 20, 2019
    Posts:
    29
    Last edited: Sep 17, 2021
  23. san40511

    san40511

    Joined:
    Oct 20, 2019
    Posts:
    29
    Resolved! Gizmos were disabled.
     
    Last edited: Sep 17, 2021
    flashframe likes this.
  24. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    409
    you probably already went ahead and bought the asset anyway but no apart from that ferr2d worked exactly as expected.
     
  25. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    199
    Ferr2D handles used to be visible with gizmos turned off. It changed around I think 2020.1 or 2019.3 where they're only visible with gizmos on. I wonder if it's possible to make it so they're always visible again even with gizmos turned off.
     
  26. Antoniusaft

    Antoniusaft

    Joined:
    Feb 28, 2013
    Posts:
    10
    Hello. Can someone tell me whether or not I can expect Ferr2D to function correctly if imported into a new version of Unity (currently I am on 2021.1.23)
    The limited functionality using Sprite Shape is making me furius on a daily basis and is hindering my level design flow, so I am looking for better tool alternatives!
     
  27. tripplejaz

    tripplejaz

    Joined:
    May 11, 2019
    Posts:
    3
    So Ferr2D will work, sort of, in URP. Currently it's unlit shaders work, but not the lit. I think you can easily make an unlit shader in URP though and it'll work. Everything else functions normally, though you're going to need a fix for deleting anchor points as a future version of Unity added ALT as a hotkey for Pan View. So you can't delete anchor points unless you edit the code.

    Also if you want something that's comparable to Ferr, check out Kolibri 2D. It has really powerful tools (better than Ferr), is in active development and you can chat with the dev about stuff. The biggest downfall is its collision is very basic. But everything else is very competent.
     
  28. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    198
    there is something called Spline Terrain 2D:

    https://assetstore.unity.com/packages/tools/sprite-management/spline-terrain-2d-122383
     
  29. Antoniusaft

    Antoniusaft

    Joined:
    Feb 28, 2013
    Posts:
    10
    I am not using URP. I am using legacy standard render pipeline.
    To you think the Kolibri 2D tools are more powerful than Ferr? The videos don't show that much. The terrain object scattering tool looks pretty cool, but other than that, the spline manipulation looks basic? Maybe I'm wrong?

    Some of the things that I am missing from built-in spline editor is:
    1: More manual control over individual points (manipulating corners, setting corners individually, setting materials and material settings such as color, shader, ect, at each point individually)
    2: Option to tilt Shape Edge inwards for 3D effect ( I can see this is possible with Ferr )
    3: Ferr vertex painting options look awesome for creating seamless terrains
    4: More control in general for sizing, streching, tiling, and so on...

    With these points in mind, do you still recommend Kolibri 2D Spline terrain tool over trying to get Ferr2D terrain to work in modern unity?
     
  30. Rachan

    Rachan

    Joined:
    Dec 3, 2012
    Posts:
    808
    I have a problem on iPhone 13 Pro Max with only build from Unity 2021.2.2f
    it have a white glow on edge of all sprite that draw by custom shader



    it seem like custom shader on Unity 2021.2.2f and iPhone 13 Pro max is not blend properly
    I have send a lot of message to this team But no one answer me at all...
     
  31. HwangYeoeun

    HwangYeoeun

    Joined:
    May 31, 2017
    Posts:
    2
    Currently I am using Unity 2019.4.21 and I would like to use an older version of the Legacy Diffuse material. I changed the color of the ground arbitrarily through this function, but now it is unified into one color. What can I do?
     
  32. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    199
    Didn't Ferr2D use to batch multiple terrain gameobjects that used the same Terrain Material? Last time I remember checking was a few years ago and I could have sworn when I duplicated a bunch of Ferr2D objects within camera view they didn't add to the batch count since they used the same materials. But now it seems they don't batch anymore and each terrain object adds 2 batches. Maybe I'm misremembering, but if not then what would be causing 2 ferr2D objects with the same Terrain Material to not batch?
     
  33. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    199
    I just installed 2017.4 version of Unity and added Ferr2D to it, and multiple Ferr2D objects do 100% get batched together. So something done in a newer Unity version broke batching on Ferr2D objects somehow, but I don't know how or why. Possibly URP broke batching on Ferr2D objects somehow? Not sure, I'd have to investigate further.
     
    wedgiebee likes this.
  34. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    199
    I can confirm it's URP that breaks Ferr2D mesh batching, but I can't figure out why. Built-in RP still batches the meshes properly.
     
  35. eleon-games

    eleon-games

    Joined:
    Feb 19, 2015
    Posts:
    56
    i cant see control points even with gizmos turned on. Working with Unity 2020.1.17f. Is there any fix or similiar problem for others or just me?
     
  36. AbsoluteRelative

    AbsoluteRelative

    Joined:
    Nov 27, 2021
    Posts:
    9
    So Im seeing that Ferr2D is possibly abandoned and may not work well on the newest Unity version. Is it worth getting, or can anyone suggest a suitable replacement that does similar or better?
     
  37. OscarLeif

    OscarLeif

    Joined:
    Jul 17, 2016
    Posts:
    69
    The only asset that does something very similar is sprite shapes.
     
  38. tripplejaz

    tripplejaz

    Joined:
    May 11, 2019
    Posts:
    3
    The main solution I found is to make sure you only have a SINGLE inspector open. If you have 2 inspectors open, all sorts of finicky things will happen.
     
  39. wedgiebee

    wedgiebee

    Joined:
    Aug 9, 2016
    Posts:
    40
    @pastaluego Did you ever end up looking into this more? Or did you settle for non-batching URP or batched built-in renderer?
     
  40. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    199
    Yeah URP does batching differently than built-in. It batches materials with the same shader at GPU-level rather than CPU level with draw calls (or something like that I'm dumb and don't understand it). So the stats window is inaccurate. As long as the materials share the same shader, then all Ferr2D objects will get SRP batched assuming you have nothing breaking SRP batching (which some stuff does like MaterialPropertyBlocks), even though they're still shown as different draw calls in the stats window. So yeah it's nothing to worry about.

    But I'd look into how SRP batching works in URP to better understand the differences.
     
  41. wedgiebee

    wedgiebee

    Joined:
    Aug 9, 2016
    Posts:
    40
    Ohhh got it! So I gotta enable this SRP feature. Thanks for the info @pastaluego! Wishing many pastas upon you
     
  42. BimoKayoba

    BimoKayoba

    Joined:
    Dec 24, 2022
    Posts:
    4
    Anyone have this problem with Ferr2D before? I can't edit the 2D terrain
    upload_2023-9-10_16-58-39.png
     
  43. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    819
    This happens when you have 2 or more inspector tabs open. Close one of them and you should be able to edit it again
     
    BimoKayoba and wedgiebee like this.
  44. BimoKayoba

    BimoKayoba

    Joined:
    Dec 24, 2022
    Posts:
    4
    Thank you very much, it works ♥♥♥
     
    flashframe likes this.
  45. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    198
  46. UDN_46c91c6c-aeb1-471f-87fb-917fc1db02c9

    UDN_46c91c6c-aeb1-471f-87fb-917fc1db02c9

    Joined:
    Dec 3, 2017
    Posts:
    21
    Hello! I need to be able to build a filled PolygonCollider with no thickness that follows exactly the drawn shape. Is it possible?
     
  47. BusterTheWizard

    BusterTheWizard

    Joined:
    Jul 2, 2012
    Posts:
    55
    We are using Spline Terrain 2D but it has the same issue as Ferr2D...developer disappeared...also it's a .dll so you can't fix the issues.
    NOTE to use it in current Unity versions, when you import it it will ask if you want to update it to current Unity APIs. DO NOT UPDATE IT. It will not work. If you tell it not to update, it will work great.
     
  48. Matthewek

    Matthewek

    Joined:
    Apr 6, 2015
    Posts:
    49
    Is anyone still using this with more recent Unity version?