Thursday, 5 December 2013

Unity split terrain script





"Cut, cut, cut, cut "
This Guy
DOWNLOAD:
https://www.dropbox.com/s/6drt9vccbl4bzgf/Dvornik-Split-Terrain.unitypackage?dl=0

How to use it:
Unity Main Menu-> Dvornik-> Terrain-> Split Terrain. Press split terrain. Now your selected terrain is splitted into 4 parts with all details, trees, colors and stuff like that.

NOTE: old terrain is not deleted. If you want to remove it, please remove manually.

If some problems occurs please see Log Console



16 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hallo,
    i don't know how you do it. but it is great.
    However i want to do a little more. i used your tool and i realized, that the height map resolution of the new terrains decreased by half. Can we keep the old resolution or increase it?
    Thanks for your help.

    ReplyDelete
    Replies
    1. If you select the new terrain, then go to the settings tab you can set a new resolution. The reason the resolution decreases is because the terrain size does. Meaning that to have the exact same detail, it needs to have less total resolution.

      So, what you are asking is like, why does my half sandwich have less bread than the whole sandwich did before I cut it in half? ;) don't fret, you can still increase the resolution if you want more for painting, etc.

      Delete
    2. Nice to hear something from you. I understand what you said absolutly. Yes, what I meaned is, the 4 new Terrains have the same resolution (heightmap resolution, basemap, detailmaps... resolution) as the origin terrain. I have tried to do it and I did it, but it is not perfect. After i cut the terrain with your tool, i increase the heightmap resolution to double (by code). However, I think the map is shifted and the corners are missed. Is there a way to increase the heightmap resolutions and don't loose the data?

      Delete
  3. Hey I loaded in your script but now my terrain is gone. The entire terrain, all my work gone.

    ReplyDelete
    Replies
    1. :O Yeap, thanks for saying this. I came back because the importer is telling me that it includes replacement textures. Dvornik, can you just make the split-terrain script available?

      Delete
  4. Thankyou, Just what I needed so I can make my city in smaller sections.

    ReplyDelete
  5. Haha look at me trying code from a random blog spot, and yet it worked. and really, really well! Thank you so much man, I really appreciate it!

    ReplyDelete
  6. A really useful script, but I couldn't get it to work for dividing the terrain into 9 parts.

    ReplyDelete
  7. I used this script which was really useful for what I need. However, after dividing the terrain and leaving the scene I divided it in and returning to the scene. There is a seam that is between the cuts. Do you have any suggestions as to how to prevent that from happening or fixing it all together? I have tried a terrain stitcher but the problem remains and it’s noticeable in a build as well.

    ReplyDelete
  8. I can be reached at SokaGameDesign@gmail.com

    ReplyDelete
  9. Really like this tool. Makes my job easier. Thank you for making it. That said I ran into a issue recently.
    I don't know if I just didn't realize it before, But when splitting the terrain I lost my "Paint Holes" details in the new terrain splits. Is there a possibility to get an update that retains those properties?
    Using Unity 2020.3.4f1

    ReplyDelete
  10. Hi, I would use your script in an other open source library of me hosted on openupm.com. I optimize your script with a selection of a terrain and a splitting option (how much peaces shoud be created).
    I would add a notification to your name "Dvornik" in the Unity Tool Bar and a link to this post.

    I cannot find any licence so I ask you is it ok for you?

    https://github.com/KleinerHacker/unity-extension or
    https://package.openupm.com, scope org.pcsoft(.extension)

    Thanks.

    ReplyDelete
    Replies
    1. PS: Here is the code i optimized: https://github.com/KleinerHacker/unity-extension/blob/master/Scripts/Editor/Actions/SplitTerrain.cs

      Delete
  11. This comment has been removed by the author.

    ReplyDelete