Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

[RELEASED] Terrain Stitcher

Discussion in 'Assets and Asset Store' started by NatureManufacture, Aug 12, 2015.

  1. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,991
    https://gyazo.com/403c0d73bc16a9c774047f7b588b1ce3
    It works at this version. Did you check at clean project?


    Not possible.
     
  2. fairchild670

    fairchild670

    Joined:
    Dec 3, 2012
    Posts:
    69
    Sorry, I just deleted my original post. It did actually stitch the seems of the terrain together. I mistakenly thought it would also combine all terrains into a single terrain. Apologies!!
     
    NatureManufacture likes this.
  3. Bob3000

    Bob3000

    Joined:
    Feb 3, 2018
    Posts:
    33
    Adding the "TerrainNeighbours" script to the scene will get this error, as a result the Terrain LODs problem still exist. Do you know of a fix? Thanks!

    ArgumentException: An element with the same key already exists in the dictionary.
    System.Collections.Generic.Dictionary`2[System.Int32[],UnityEngine.Terrain].Add (System.Int32[] key, UnityEngine.Terrain value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
    TerrainStitch.TerrainNeighbours.CreateNeighbours () (at Assets/Terrain Stitch/Terrain Stitch Scripts/TerrainNeighbours.cs:54)
    TerrainStitch.TerrainNeighbours.Start () (at Assets/Terrain Stitch/Terrain Stitch Scripts/TerrainNeighbours.cs:28)
     
  4. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,991
    You coppied terrain and few terrains have the same terrain data.
     
  5. Bob3000

    Bob3000

    Joined:
    Feb 3, 2018
    Posts:
    33
    I fixed it before I saw your reply, & hope it doesn't come back.

    The terrains were indeed copied many times during their creation by a well known terrain composing addon, that tool bugged so much & regenerated the height of my entire game randomly once in a while, so I deleted the entire plugin & decide to use your Stitching Tool with the default Unity brush, works great. Stability is above all else.

    I fixed it by renaming the terrain folder & some pieces.
     
    NatureManufacture likes this.
  6. Harjawalda

    Harjawalda

    Joined:
    Sep 1, 2018
    Posts:
    15
    I stiched two terrains together but when I save my project the seam reopens and I get a small vertical wall. I added terrain neighbours script to both terrains.
     
  7. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,991
    It's LOD difference. You need terrain neighbour script to keep lod verts at same position
     
  8. Leila_Branwen

    Leila_Branwen

    Joined:
    Sep 13, 2018
    Posts:
    8
    I'm working in Unity 2019.1.1f1 and used neighboring terrains. I first created the terrains and then imported raw files as the heightmaps for each terrain it looked great until I started running around the terrain and finding some seams. It isn't visible across the whole seam, just parts of it. I attached an image of one of these areas. Is this something that Terrain Stitcher would be able to fix? Thank you for any assistance you may be able to provide.
     

    Attached Files:

  9. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,991
    All terrains have same ID?
     
  10. Leila_Branwen

    Leila_Branwen

    Joined:
    Sep 13, 2018
    Posts:
    8
    Yes, they all have a Grouping ID of 0.
     
  11. C10110

    C10110

    Joined:
    Jan 19, 2013
    Posts:
    55
    Hey Nature Manufacture! Long time fan of your assets! I never got this one as I am searching for a way to combine terrains of different sizes. It appears to be impossible even in mid 2019. Nobody seams to have any helpful info, I'm wondering if your asset may have changed by now or you know of anything that might work.

    I want to take existing Unity terrains and combine them while keeping all vegetation details. I don't want to export hieghtmaps and re place anything. I also have this fantasy where one could work on a small isolated terrain (say 200x200) and get the details just right, and use something like your multiple terrain brush to essentially merge this tiny location into a barren part of a larger map.

    I hope this makes sense. I don't think it's possible but thought you might have some insight. Thanks!
     
    entropicjoey1 likes this.
  12. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    Stitched the gaps no problem thanks.

    However I then found the issue in the image below.
    I am not sure what is causing it but only noticed it after stitching the terrains.

    I use Vegetation Studio Pro
    CTS Terrain Shader

    Have regenerated splatmaps and normals etc but cant seem to find a solution.

    I will post in CTS and VSPro forums just to make sure.

    2019-09-28.png
     
  13. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,991
    How unity 2018.3+ you simply paint same texture at the borders.
     
  14. Narkomic

    Narkomic

    Joined:
    Aug 16, 2015
    Posts:
    1
    Hi NatureManufacture.

    I have 4 terrains that are randomly spawning and come forward when you press play. i want to hear if there is a way to stitch them together as they load.

    Sincerely, Nicolai
     
  15. barge9

    barge9

    Joined:
    May 13, 2015
    Posts:
    12
    Greetings, I was hoping to seek assistance regarding the Terrain Stitcher tool: I attempted stitching Terrains, however couldn't determine whether any changes did in fact occur when I selected the: "Stitch Selected Terrains" button... It appears nothing has happened at all... Each terrain is saved as a prefab, would that matter? I also included the _TerrainNeighborsManager in the Scene, but to no avail... The terrains are duplicates, possibly that is the reason why too? I'm on v.2019.4... Could you or anyone here offer advice, Thanks so much, and Sincerely, Ev. Screen Shot 2020-06-22 at 9.48.12 AM.png
     
  16. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    Same here. Not working with latest 2019.4.4

    I'm trying with just 2 simple terrains, i select both and click the stitch button. It should be that simple right ?
     
  17. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    Is there an option to merge multiple terrains into one object?
     
  18. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,991
    nope.
     
  19. webflow

    webflow

    Joined:
    Jun 28, 2020
    Posts:
    1
    Hi NatureMaufacture,

    Is it possible to instantiate and stitch terrains at runtime?

    As an example. I go with my player near the edge of the terrain. A new terrain will be instantiated and automatically stiched to the existing one so i can walk to a new terrain.

    Thanks.
     
  20. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,991
    Hi
    It's only editor tool.
     
  21. MHDev2019

    MHDev2019

    Joined:
    Dec 12, 2019
    Posts:
    14
    Greetings, I jutst gut the stitcher and so far I am pretty happy with it, as it looks like t it will be able to save me some time.

    However, I wonder if I am doing something wrong, because if you look at my screenshot, you will notice that there is some minimal spacing between the terrains. Is there a way to get rid of such spacing between the borders.

    I am using Trend with a Trend Length of 100 to stitch.

    I added the _TerrainNeighboursManager to an empty object as you mentioned to do this a few times but it still happens.
     

    Attached Files:

    Last edited: Mar 29, 2021
  22. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,991
    Terrains have same ID group?
     
  23. MrPapayaMan

    MrPapayaMan

    Joined:
    Feb 16, 2021
    Posts:
    34
    Having issues. It say my terrains are smaller than stitch range. How can I resolve this?
     
  24. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,991
    its verts range not unity distance. Im not sure what is the smallest value but there shouldn't be problem. You have terrains 32x32? Could you share screen?
     
  25. MrPapayaMan

    MrPapayaMan

    Joined:
    Feb 16, 2021
    Posts:
    34
  26. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,991
    you have 32x32 verts on the whole terrain. They are copied. Did you add them coppied heightmaps or separated heightmaps? Each terrain should have its own terrain data file.
     
  27. MrPapayaMan

    MrPapayaMan

    Joined:
    Feb 16, 2021
    Posts:
    34
    It works when I move the average length to 1. I just lucked into it. Thanks for the support.