Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. 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

Stitch / Blend Neighbor Terrains Together

Discussion in 'General Discussion' started by UserNobody, Aug 30, 2020.

  1. UserNobody

    UserNobody

    Joined:
    Oct 3, 2019
    Posts:
    108
    Hello,
    How can I stitch / blend neighbor terrains together? I know that Unity is now able to paint multiple terrains at once, but the issue is that I create terrains in the other software (World Creator), then I export the terrain heightmap and I apply it to the terrain.
    And I do this for all the neighbor terrains. Having different heightmaps leaves sometimes pretty big gaps..

    Is there a tool somewhere that I could buy that would stitch all the terrains together and would blend between them so would create nice transition between the two?
     
  2. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    2,880
    Terrain Composer allows you to use one heightmap for multiple terrains (you define the number of terrains you want, it's squared I think so 1, 4, 9, 16, etc.) and it handles the stitching together and such.
     
  3. UserNobody

    UserNobody

    Joined:
    Oct 3, 2019
    Posts:
    108
    Hey there, thanks for the reply! Terrain Composer looks awesome, but can you just stitch already placed terrains? I am looking for something like Stitchscape, just maybe a bit more polished / flexible.
     
  4. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    2,880
    Sorry, that's the only tool that I've used with that functionality.

    The only thing I can think of is rolling up your sleeves and doing some pixel manipulation on the heightmaps directly (to merge them together). You might query the average of two edge pixels (or of the whole side), then change a few pixels on either side going into the center to merge at that average value.
     
  5. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,346
    I rolled my own by just querying the vert positions on the XZ plane and taking the average for the Y. I have no idea if it's optimized, but it's fine for me for now. If I ever need some sort of optimization, I'll just keep doing passes until it's fast, or just cache the terrain for quicker loading. Stitchscape is interesting though. I'll have to investigate that some more.
     
unityunity