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

► Terrain to Mesh ◄

Discussion in 'Assets and Asset Store' started by Arkhivrag, Oct 1, 2015.

  1. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Hi,
    I've decided to release my ultra fast terrain converter (included in Mesh Materializer) as a separate tool.

    1. Ultra fast converter algorithm.
    2. Vertex count control - you will always know how much vertices will have final mesh.
    3. Terrain can be split in any amount of pieces - perfect for occlusion culling (especially for mobiles).
    4. Splatmaps exporter*.
    5. Basemap exporter*.
    6. Heightmap exporter.
    7. Tree exporter.
    8. Optional uv, uv2, normal and tangents calculator.
    9. All above works in editor and run-time.
    10. OBJ file exporter

    *Terrain splatmaps and basemap exporter works in editor and run-time only in Unity 5. For Unity 4 works only in editor.


    ScreenShots_terrain_to_mesh.jpg



    Editor tool creates ready to use prefab and instantiates it in the scene.
    Terrain_to_Mesh_editor_window.png


    v2020.5
    • Fixed incorrect texture baking in Linear Color space for Unity 2019.3 and new versions.

    v2020.4
    • Added option to extract Holesmap Texture (requires Unity 2019.3)

    v2020.3
    • From editor window now can be set converted mesh Tag, Layer and Static options.

    v2020.2
    • Fixed conversion failing if source terrainData name is Null or Empty

    v2020.1
    • Updated for Unity 2019.3

    v2019.7
    • Added VertexLit shaders

    v2019.6
    • Fixed Splatmap exporter for Unity 2019.2

    v2019.5
    • Fixed OBJ exporter not assigning correct names to the meshes.

    v2019.4
    • Fixed mesh conversion failing with SRP

    v2019.3
    • Updated for Unity 2019.1

    v2019.2
    • Synchronized with "Terrain To Mesh - Lightweight Render Pipeline" plugin

    v2019.1
    • Removed restriction on installation location. Plugin folder can be placed anywhere inside project.

    v2018.7
    • Updated for Unity 2018.3

    v2018.6
    • Updated for Unity 2017.4 and 2018.2

    v2018.5
    • Improved T2M fallback shaders. Now they should work on all devices supported by the Unity engine, but need BaseMap baking too.

    v2018.4
    • Compatible with Unity 2018.1

    v2018.3
    • Added batch converter
    • Splatmap and Heightmap can be exported any resolution.
    • Fixed Basemap not baked correctly in Linear color space

    v2018.2
    • Added runtime OBJ exporter (example scene included).
    • Fixed Splatmaps having black spots.
    • Fixed Heightmaps not being exported.

    v2018.1
    • Fixed bug when material or Basemap were not generated.

    v2017.2
    • Added per-chunk Basemap exporter.
    • Added 'skirt' generating option.
    • Added vertex count controller for MeshCollider.
    • Improved shaders VR support.

    v2017.1
    • Unity 2017.1 compatible.

    v1.46
    • One Directional Light shaders support Lightmap Multiplier option.

    v1.45
    • Basemap baking supports Alpha channel.
    • Fixed Metallic and Smoothness calculation for T2M shader.

    v1.44
    • Can be selected default shader (Unlit, One Directional Light, Legacy, Standard) for generated material.
    • Bumpmap is automatically assigned to the shader if is used by terrain.
    • Basemap baking supports predefined resolutions.

    v1.43
    • Fixed: CompressedMeshLoader script attempting read empty mesh buffers in the build project.

    v1.42
    • Fixed: Exporting tree prefabs broke CompressedMeshLoader script.

    v1.41
    • Includes run-time CompressedMeshLoader script fixing visible seams on high compressed chunks in Game mode.
    Component is automatically added by T2M converter to the mesh prefab (parent).
    • Optimize option is not necessary any more, removed.

    v1.4
    • Added mesh asset compression option (generated file can be 3X smaller).
    • Added mesh asset optimization option (renders mesh faster).

    v1.31
    • Retina display support
    • Fixed run-time script property drawer

    v1.3
    • Unity 5.4 compatible
    • Added option for attaching mesh collider
    • UV, UV2, Normal and Tangent are generated by default.
    • Splatmaps and Basemap can be exported as TGA file (requires Encode To TGA plugin)
    • T2M shader has per-layer control for Shininess, Smoothness and Metallic parameters.

    v1.23
    • Fixed - Sometimes Unity imported splatmaps as Sprites, leading to wrong shade effect.

    v1.22
    • Fixed bug with basemap not being generated in run-time on Android devices.

    v1.21
    • Fixed bug with textures being rendered as pixelated.

    v1.2
    • Added tree extractor.
    • Removed Unity 4 support.

    v1.1
    • Added Heightmap extractor.
    • Added Basemap extractor. Tool bakes all terrain textures into one. Extracts diffuse and normal maps separately.
    • Editor now creates fully setup T2M material with Splatmaps, proper uv scale for multi-layer textuers or single texture material with Basemap only.
    • Editor tool will output conversion report, if it finds some exceptions.
    • Added run-time functions - ExtractHeightmap() and ExtractBasemap()
    • Example script now creates proper T2M material.

    v1.04
    • Terrain splatmaps can be exported at run-time (only in Unity 5)
    • Fixed 4+ texture blend shaders.

    v1.03
    • Fixed 'NaN' tangents, appearing on multi-chunk converted mesh edges.

    v1.02
    • VacuumShaders assets synchronization. Required update for all VacuumShaders assets.
    • Added full range of shaders with 2 to 8 texture blending, including bumped effect. Shaders support mobile (Unlit and One Directional Light), Legacy and Unity 5 Standard shading models. Shaders are Curved World compatible.

    v1.01
    • Fixed drag and drop problem for editor window.



    Amazing Assets - YouTube Facebook Twitter
     

    Attached Files:

    Last edited: Jul 1, 2020
    Amplify_Ricardo and Gozdek like this.
  2. Games-Foundry

    Games-Foundry

    Joined:
    May 19, 2011
    Posts:
    632
    Interesting. What about handling LOD cases where you want the number of boundary vertices to match your LOD0 so that you don't get gaps in terrain further away?
     
  3. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    524
    Looks cool. Would be fun if you could easily MM all the plants, trees and grasses as well.
     
  4. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    What about this?
     
  5. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    You can generate multiple version of mesh with different amount of vertices and chunks.
    But what you are asking - Having fixed vertex amount on chunk perimeter and reduce vertex count inside? No, currently Terrain To Mesh can not do that.


    Terrain plants, trees and grass are just planes with cutout shaders, if you try to MM :) (use Mesh Materializer) on them, they just will be converted to planes (most of them to cross planes). Do not see use of it.
    But thanks for question, I've just realized that I can add SpeedTree converter to Mesh Materializer (next update).


    Which of below features is there?
    1. Ultra fast converter algorithm.
    2. Vertex count control - you will always know how much vertices will have final mesh.
    3. Terrain can be split in any amount of pieces(chunks) - perfect for occlusion culling (especially for mobiles).
    4. Optional uv, uv2, normal and tangents calculator.
    5. All above works in editor and run-time.
    6. Can export terrain splatmaps.
    7. OBJ file exporter
    Only last one - OBJ file exporter.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    buttmatrix and theANMATOR2b like this.
  6. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
  7. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    8,754
    Very nice, can it convert multiple tarrains to one mesh too ?

    Thanks
     
  8. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    I have not thought about that. Added to a 'wish list'.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    nasos_333 likes this.
  9. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    8,754
    Would be rather useful.

    I just realized this pack is included in one i own too :)
     
  10. Games-Foundry

    Games-Foundry

    Joined:
    May 19, 2011
    Posts:
    632
  11. gterveen

    gterveen

    Joined:
    Dec 17, 2012
    Posts:
    22
    Will I keep the textures on the terrain?
     
  12. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Is Terrain to Mesh compatible with Relief Terrain Pack shaders?
     
  13. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Yes, I guess. That feature is not implemented.


    Terrain To Mesh can generate uv coordinates for new mesh so textures can be used.
    Also package includes one 'bonus' shader that blends 4 textures using splat map. It can recreate original textured terrain. You can modify shader to support more or less blend textures.


    Terrain To Mesh needs TerrainData not some custom shaders used by it. If Relief Terrain Pack uses Unity terrain then yes, it is compatible.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  14. spacetrotter

    spacetrotter

    Joined:
    Jun 22, 2015
    Posts:
    5
    there is a bug,on unity 5.13 upload_2015-11-2_2-3-0.png
     
  15. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Tested on Unity 5.1.2 and 5.2, no bugs found.
    Can you provide more details, or that image tells nothing. Maybe it's Unity's editor exception and not assets bug?



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  16. spacetrotter

    spacetrotter

    Joined:
    Jun 22, 2015
    Posts:
    5
    when i open the terrain to mesh window,it shows nothing
    upload_2015-11-2_2-30-23.png
     
  17. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Did you move VacuumShaders folder? It must be inside main Assets folder, not in any other subfolders.
    Do you have other plugins inside project?



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  18. spacetrotter

    spacetrotter

    Joined:
    Jun 22, 2015
    Posts:
    5
    i create a new project ,console show no error but i can't drag the terrain to window
    upload_2015-11-2_2-36-37.png
     
  19. spacetrotter

    spacetrotter

    Joined:
    Jun 22, 2015
    Posts:
    5
    upload_2015-11-2_2-37-56.png
    I can't choose a terrain,after i click snow terrain nothing happon
     
  20. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Try select terrain inside Hierarchy window and then use context menu inside window.

    terrain-to-mesh-pickup.png



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  21. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Above screenshot shows that you are trying to load terrain from assets.
    Terrain that you want converted must be gameobject not asset and it must be inside scene.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  22. spacetrotter

    spacetrotter

    Joined:
    Jun 22, 2015
    Posts:
    5
    ok i know thank you
     
  23. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    I'll try to reconstruct issue that terrain can not be dragged and fix it (if it is asset's bug of course).

    Edit
    Yes, it Unity's bug, but I've found how to overcome it. Will release update tomorrow.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  24. zugsoft

    zugsoft

    Joined:
    Apr 23, 2014
    Posts:
    451
    I just bought yuor Asset, and I have the same issue.
    I can't use the Terrain at all.

     
  25. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Yes, it is already fixed. Update will be available tomorrow.
    For now, select terrain inside hierarchy window and then use context menu pick up.





    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  26. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Update v1.01 released.
    • Fixed drag and drop problem for editor window.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    theANMATOR2b likes this.
  27. zugsoft

    zugsoft

    Joined:
    Apr 23, 2014
    Posts:
    451
    I can export my terrain to mesh with splat map for Mobile.
    With a Mobile Shader it will be perfect.
     
  28. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Is it a question or just a statement?



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  29. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,153
    Please, could I see the docs before purchasing?
    Thanks
     
  30. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Last edited: Mar 2, 2020
  31. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,153
    Is the shader included as a bonus suitable for using on mobile (SM 2.0)?
     
  32. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Included shader is for example scene and it blends 4 textures using control texture.
    It uses Unity surface shader.

    But as I have received several messages about that exactly shader to make it mobile, I plan to add shaders with 2 to 8 textures blend support, including bump map. There will be Unlit, One Directional Light and PBR shaders.
    Will try to make next update for the next week.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    theANMATOR2b likes this.
  33. zugsoft

    zugsoft

    Joined:
    Apr 23, 2014
    Posts:
    451
    Your asset wor
    It's just a statement, your Asset works very fine, and very easy to use.
    I bought TerrainComposer to transform my Terrain to mesh, and use splatmap, but I didn't find the process to achieve this.

    Your Asset is better and eaysier.

    With a Mobile shader it will be perfect.
     
  34. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    820
    Please do mobile shader and I will buy this asset at once
     
  35. zugsoft

    zugsoft

    Joined:
    Apr 23, 2014
    Posts:
    451
    With your shader, my mobile game fps drop by 33%
    With the mobile bump mapping shader I have between 58-60 fps, and only 30-40 fps with your's
    I am a C# developer, I never understood Shader lol
     
  36. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,153
    I think now TM4 is DEPRECATED, and no more mesh terrain for mobile is available on the asset store I think Arkhivrag has the opportunity to make a good product to create and texture mesh terrains for mobile with many potential buyers.
     
  37. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Package is for fastest converting Terrain to Mesh.
    Shader you guys are talking about is just for example scene and purpose of this asset has never been any 'mobile' or any other type of shaders.

    But as I have received much (too much) shader requests I will update package (as wrote above) with full range of shaders with 2 to 8 textures sampling and bump effect. Shaders will be for mobile (Unlit and One Directional Light) and PBR type.


    Edit:
    Shaders will be Curved World compatible!



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    twobob and 99thmonkey like this.
  38. zugsoft

    zugsoft

    Joined:
    Apr 23, 2014
    Posts:
    451
    I created 3 Mobile shaders for Terrain to mesh.
    With 2 textures my fps is 59-60
    With 3 textures my fps is 56-58
    With 4 textures my fps is 54-55

    I am very happy with the result.
    I will make a apk
     
  39. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    820
    is there are a chance you can share it
     
  40. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,153
    +1
     
  41. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,153
    The price was raised to 25 $ in only 6 days...
     
  42. Analist-Group

    Analist-Group

    Joined:
    Dec 28, 2014
    Posts:
    1
    The public API can export terrain to obj format with splatmap texture in game time?
     
  43. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    386
    I apparently own this as part of Mesh Materializer.

    How do I get UVs and tangents for terrains within Mesh Materializer?

    My projectors, onto terrains, gave issues. So I thought I'd try this and I'm getting the same problems, presumably due to normals/tangents.

    Thank you
     
  44. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Price changed exactly after one week, as was written. Today is 8th day.

    No.

    Missing(New) features will be added to Mesh Materializer in next update (about in 2 weeks).
    Do you have normal/tangents problem with Terrain To Mesh asset?




    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    theANMATOR2b likes this.
  45. zugsoft

    zugsoft

    Joined:
    Apr 23, 2014
    Posts:
    451
  46. virtuali

    virtuali

    Joined:
    May 5, 2014
    Posts:
    1
    Hello, I've just bought this utility, and I have the following problem: if I have several adjacent terrains, exporting to .OBJ into 3DS Max seems to use coordinates relative to their own center, so all chunks end up in the same place, as if their Transformation is being ignored.

    Also, they appear to be rotated 180 degrees when seen in Max.
     
  47. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Converted terrain (Unity mesh assets and obj files) data is always calculated by local coordinates and pivot point is at (0, 0, 0). It is defined by Unity terrain itself and not by conversion script.
    Also, Unity transforms translate/rotation/scale are not applied.

    OBJ file is generated by this format https://en.wikipedia.org/wiki/Wavefront_.obj_file
    In different coordinate system mesh will be rotated/flipped and you will have to manually adjust it.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  48. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,505
    Update v1.02
    • VacuumShaders assets synchronization. Required update for all VacuumShaders assets.
    • Added full range of shaders with 2 to 8 texture blending, including bumped effect. Shaders support mobile (Unlit and One Directional Light), Legacy and Unity 5 Standard shading models. Shaders are Curved World compatible.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    99thmonkey likes this.
  49. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    820
    Hi! I am having trouble understanding how to use splatmaps...can you explain further, I don't have much experience with this. Here is what I did:

    1.) Select terrain I want converted
    2.) Open Terrain to Mesh (Choose export splatmaps,choose export Unity Mesh)
    3.) Click Generate

    I get prefab with mesh with standard shader and I get
    New Terrain 4_SplatAlpha 0
    New Terrain 4_SplatAlpha 1
    New Terrain 4_SplatAlpha 2
    New Terrain 4_SplatAlpha 3
    New Terrain 4_SplatAlpha 4

    Change standard shader to Vacuum Shaders/Terrain To Mesh/Diffuse (It has five slots)
    The question is in what slot goes what? Do I need to locate textures I used for painting on the terrain and put them there
    or I need to do something else?

    I plan this to be used on mobile, what settings you would suggest?
    Do i need both UnityMesh and Obj Mesh?

    I know this should be simple enough to get on the first try :) Help!
     
  50. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    820
    what settings you used for snow scene? I can't get one splat map
     
unityunity