Search Unity

► Terrain to Mesh ◄

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

  1. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Package included Splatmap shader's purpose is to imitate Unity's built-in terrain shader. Adding any other effects to this shader is not planed.
    In several days will be released new Terrain To Mesh 2021 that has better implementation of the Splatmap shader with more options and textures support.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: May 22, 2021
  2. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Ok sounds good look forward to your new terrain to mesh solution.
     
  3. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    HI @Arkhivrag !!!
    I have the old Terrain to Mesh and the asset for HDRP ...

    I am considering upgrading to Terrain to Mesh 2021, but I have a couple of doubts ...

    I work with Microsplat and I want to know if Terrain to Mesh 2021 can convert a textured terrain with Microsplat or what limitations it would have when doing so.

    Since Microsplat has a tool that converts the terrain to mesh generating everything necessary to have the same textures, splatmap, puddles, lava, etc ... but it does not convert the trees or the grass detail

    Is it possible with Terrain to Mesh to convert the terrain with the trees and detail grass to mesh but to be able to use the trees and detail grass without the terrain mesh generated by Terrain to mesh?
    In this way I could use the microsplat terrain-> mesh converter to mesh the terrain with its textures and shader features and also be able to use the trees and detail grass converted by Terrain to Mesh 2021

    Can you think of a way to use the trees and grass detail converted with Terrain to Mesh 2021 without the terrain mesh it generates?



    Greetings
     
  4. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Terrain To Mesh can not extract and bake textures from terrains using custom shaders. In your case this is the only limitation. Other features will work.

    Tress and detail meshes exported by Terrain To Mesh are independent assets and are not connected with each other. They are original prefabs with their own shaders and LOD system. Nothing is changed here. Except they do not have features available in Unity terrain system itself like distance fade, billboard. But those features may be already implemented manually inside prefab, for example SpeedTree asset already have them.

    Grass is generated as separate mesh asset using Unity built-in Mobile/Diffuse shader and it can use almost any custom grass shader.

    So yes, you can export trees, grass and detail meshes from terrain using Terrain To Mesh and use them with any other mesh.

    ---------------------
    For the owners of the old Terrain To Mesh asset, upgrade price is 15$.
    If additionally was purchased SRP shader asset too, upgrade price is just 5$.



    Amazing Assets - YouTube Facebook Twitter
     
    ftejada likes this.
  5. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Thank you very much for the reply @Arkhivrag .
    Yes, yes ... I have seen the price of the update ... the truth is very good.

    So if I understood correctly "Yes" I could do the conversion from Terrain to mesh with your asset and do another conversion with Microsplat terrain to mesh. And then use the converted tree and grass detail data "without the terrain mesh" by Your Asset Terrain to Mesh 2021 and easily position them in the terrain mesh generated by Microsplat ... is that correct?

    Are the trees and grass detail converted / placed by Terrain to Mesh 2021 converted to a single mesh or do you just position the trees and grass prefabs where they were in the Unity Terrain in the conversion? it is not clear to me...
    How can I make the tree and grass data converted by Terrain to Mesh 2021 to be positioned exactly the same in the other terrain mesh converted by Microsplat? Is there any part of the manual to look at?

    I'm sorry if my confirmation is repetitive, but I don't understand English well and I want to make sure.
    Excuse.
     
  6. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    After exporting trees, grass and detail meshes, Terrain to Mesh editor tool automatically adjust their position and places them to the correct position related to the exported terrain mesh. You can replace this generated terrain mesh with any other one, but you have to manually adjust trees, grass and detail meshes position if it is required.
    • Each tree is original prefab, positioned on the generated mesh exactly in the same position as it was in Unity terrain.
    • Detail meshes can be merged into one mesh if they are from the same prefabs.
    • Exported grass mesh can be merged by used texture or material. Or can be generated entirely one big grass mesh that is a collection of all grass assets used by Unity terrain.


    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: May 26, 2021
    ftejada likes this.
  7. fgovaere

    fgovaere

    Joined:
    Apr 25, 2018
    Posts:
    1
    I have been trying this tool for 3 days now, and I can not get it to work, It seems to convert something, but the result is always a unity terrain and not a mesh. If I convert it to OBJ. all folders remain empty
     
  8. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    I replied to your e-mail (3 days ago), may be you have missed it. Check spam folder if you have not received it.

    In the case of conversion fail TTM window highlights terrain with red color and offers to export it as Unity package. Send me that package and I will check it.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Jun 10, 2021
  9. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Hi

    I just saw the new Terrain to Mesh 2021 and I used to have the old package. The stopped using the old package because it can't export the terrain holes.

    So here is my question, you talk about exporting terrain holes as a texture to the new mesh. My issue is not about how to visualize the holes, my issue is about the collision.

    Does the new package export the mesh cutting out the holes from the terrain? Because I have tunnels all over and with the Unity terrain I don't need to worry about any tricks. I just walk on the tunnels without a problem. Can I do this with the holes in the generated mesh?
     
  10. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Terrain To Mesh does not cut holes in mesh geometry.
    Holes in mesh are supported as Alpha Cutout effect using shader.



    Amazing Assets - YouTube Facebook Twitter
     
  11. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    well, that´s just a shader. Not a hole. If you paint a transparent area on a mesh it doesn't make it a hole. And that's a big issue because that means the colliders will continue to hit on the hole area.
     
  12. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    Hi, I just purchased this asset and it works great for converting a terrain into a single chunk, but whenever I change the chunks count to anything other than one, I get this error:-

    [Terrain To Mesh] Encountered an error with terrainData 'Name Of Terrain (UnityEngine.TerrainData)'.
    startIndex cannot be larger than length of string.
    Parameter name: startIndex

    I've tried it on various different terrains in different scenes, all with the same result.

    I guess I'm doing something wrong, but the docs didn't give me any clues as to what that might be.

    Using Unity 2020.3.6f1

    Hoping you can help me out, many thanks.
     
  13. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    It looks like original terrain asset name is in incorrect format or contains non-standard characters.
    Send me problematic terrain asset as Unity package using support email and I will check it manually.
    You can export terrain as package directly from TTM editor window.
    Unfortunately I'm out of the office until Monday and can not check it before it.
    Before that, try changing source TerrainData asset name, may be it will help.



    Amazing Assets - YouTube Facebook Twitter
     
  14. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    Thanks for getting back to me, I'll try renaming the TerrainData asset name, and if I still can't get it to work I'll send you the asset to check.

    Thanks.
     
  15. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    I tried renaming the terrain asset, but it still resulted in an error. I'll send you a PM with the terrain asset Unity package for you to have a look at when you get time.

    Thanks
     
  16. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Fixed. Download new 2021.3 update.



    Amazing Assets - YouTube Facebook Twitter
     
    Munchy2007 likes this.
  17. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    Thanks :)
     
  18. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    If problem occurs during conversion, export problematic terrain (highlighted in red color) using TTM editor window and send me that package on support email. I will check it.
    If it is editor bug, you can provide more step-by-step details that will help me to reconstruct the problem at my side to find the bug. In this case screenshots or video will be very helpful too.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Jul 13, 2021
  19. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Unfortunately I do not have Map Magic asset and do not now how it works.
    Download new update 2021.4, invalid path related errors should be fixed.



    Amazing Assets - YouTube Facebook Twitter
     
  20. allentin

    allentin

    Joined:
    Sep 26, 2012
    Posts:
    11
    Hi, I am still using Unity 2017 on my project. Can I use this version on that? If not, can I export the mesh and the texture from Unity 2019 then make a new map with an Unity 2017 compatible shader? Or can I simply buy the older version of Terrain to Mesh?
     
  21. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Unity 2017 version is not supported any more and it is not possible to purchase it.
    TTM does not work in Unity 2017 or 2018. Minimum required Unity version is 2019.4.

    From generated files by TTM in Unity 2019.4 you can use in Unity 2017 only:
    1) Generated terrain mesh file in OBJ format.
    2) Generated grass mesh in OBJ format.
    3) Baked basemap textures.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Jul 26, 2021
  22. allentin

    allentin

    Joined:
    Sep 26, 2012
    Posts:
    11
    Can I purchase the latest version and you send me an older version of TTM?
     
  23. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Yes, but note that it is not supported any more and in case of any bugs or problems, it is up to you to fix them.
    Also old version does not export grass, Splatmap shader can blend only 8 diffuse textures, no holes, etc.
    After purchase latest version, old version will be considered as free addon as is, without any guarantees.



    Amazing Assets - YouTube Facebook Twitter
     
  24. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    I just upgraded to 2021. Thanks for including discounted pricing.

    I like to use a different material on the generated meshes, but running Terrain To Mesh 2021 always replaces it.
    How can I specify the material that is assigned to the new meshes?
     
  25. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    TTM always creates new material for generated prefab. You can specify your shader for that material by enabling Use Custom Shader checkbox.
    upload_2021-8-5_16-9-41.png



    Amazing Assets - YouTube Facebook Twitter
     
  26. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
     
  27. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Splatmap is special TTM material and it uses only one shader. It can not be changed.



    Amazing Assets - YouTube Facebook Twitter
     
  28. GameFlik

    GameFlik

    Joined:
    Aug 4, 2021
    Posts:
    1
    Hello, just purchased TTM and loving it so far!

    Just would like to ask, if I were to export my terrain to obj, the texture are not applied. I realized that you can generate splatmap. How do I go about applying my texture to my terrain.obj using splatmap? Any recommendation on how to do it? Or with any other software? The end result I would like to achieve is a terrain.obj with texture. Thank you!
     
  29. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    What do you mean by "the texture are not applied"?

    What type of material are you generating Splatmap or Basemap?
    If it is Splatmap - inside exported folder should be Splatmap material with Splatmap textures.
    If it is Basemap - inside exported folder should be Basemap material with Diffuse and Normal map textures.

    In both cases generated mesh (OBJ or .asset) should uses this material regardless used shader.

    Note, TTM reads texture data only from Unity TerrainData object and if your Terrain uses custom shader then texture exporter/baker may not work.



    Amazing Assets - YouTube Facebook Twitter
     
  30. MrPapayaMan

    MrPapayaMan

    Joined:
    Feb 16, 2021
    Posts:
    42
    Hi.

    I have the newest version of terrain to mesh.

    Any other options available for shaders? Testing this on a Google Pixel 5. Which is a relatively modern phone (2020). Using the splat map shader knocks the frame rate in near half from 90 to 45-50 with a small terrain under 20k triangles and nothing else in scene.

    Any options I can check/uncheck on the shader to make it more performant? Or am I just out of luck?
     
  31. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Hi,
    Compared to what frame rate has dropped? Unity terrain, mesh with Basemap material or what?
    How much textures are used by Splatmap material?
    Do you use original textures in Spatmap material or baking them in TextuteArray?



    Amazing Assets - YouTube Facebook Twitter
     
  32. DarkDeivel

    DarkDeivel

    Joined:
    Aug 31, 2016
    Posts:
    127
    Hey! I have an old version of TTM, does it make a lot of sense for me to buy a new version?
    - Does the new version work with unity 2019?
    - Is there anything better for optimization on mobile devices? Or are there the same shaders and nothing that can give me a stronger performance?
    - Do I need to uninstall the old version to install the new one, or can they be compatible with each other?
    Thanks for answers.
     
  33. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Check documentation in the description and decide if features described there are interesting for you.
    New version is designed for Unity 2019.4+ versions and is not compatible with previous TTM versions.



    Amazing Assets - YouTube Facebook Twitter
     
  34. DarkDeivel

    DarkDeivel

    Joined:
    Aug 31, 2016
    Posts:
    127
    In the old version, I was uncomfortable with one nuance.

    Saving the conversion window settings did not apply to a specific project, but to the unity editor as a whole. When I switched between projects for work and I needed to use TTM, I did not like that the conversion settings were from the last working project. Sometimes I could already forget what were my optimal settings in the project to which I returned In this version also?
     
  35. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    New version saves editor settings per-project.



    Amazing Assets - YouTube Facebook Twitter
     
    DarkDeivel likes this.
  36. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    Hi when I try to run I get these errors and terrain is pink (something is wrong with the shader). I am on URP and 2020.16. Terrain uses microsplat, I am not sure if this is an issue. And I imported the URP package. Let me know if you need more info. Thanks!

    upload_2021-9-3_17-6-50.png

    upload_2021-9-3_17-7-19.png
     
  37. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Check Manual file, page 13.



    Amazing Assets - YouTube Facebook Twitter
     
    FlightOfOne likes this.
  38. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
  39. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    Hello, one more question. What does this script do (I was going to open and check but it is a dll)? Is there a purpose to keeping this at run-time, can I remove it? Thanks.

    upload_2021-9-6_8-43-16.png

    I mainly ask because, Everything look great for a while after creating meshes. I keep getting these effect (e.g. after baking lights, or on play) at random. I have a feeling that this script is doing something since nothing else have access these meshes.

    One thing I should mention is, I do is check static (with children) on the root object because despite saying "static" in the setting, when backing the child meshes do not get set as static. Not sure if this has anything to do with what is happening.

    upload_2021-9-6_9-50-24.png
     
    Last edited: Sep 6, 2021
  40. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    It is run-time script for loading compressed meshes correctly. It aligns edges on a perimeter.
    Without it mesh chunks may have visible seams because of compression.



    Amazing Assets - YouTube Facebook Twitter
     
  41. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    Thanks.
    I see, so it is what's causing the problem, but it seems like this it is better to have this script active at runtime.

    This happens along the seams. Now the question is, how do I prevent this from happening, what could be causing this?

    here are my settings:
    upload_2021-9-6_11-36-36.png
     
    Last edited: Sep 6, 2021
  42. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Static meshes can not be modified in run-time. Those artifacts may be result of the mesh been marked as static and script trying to adjust vertices on perimeter fails and produces incorrect results. Uncheck static checkbox.



    Amazing Assets - YouTube Facebook Twitter
     
  43. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    Alright, that makes sense. My concern is with physics, as this will adversely affect collisions.

    I am a little new to mesh terrains and I trying to understand this so I can make an informed decision so please bear with me here.

    You mentioned this (above) earlier. I am not clear what you mean by "loading compressed meshes" at run-time. Do you mean like if I instantiate it from a prefab?

    If so, does this mean if I do not load these at run time (I leave this mesh in the scene and build) I can safely remove the script without worrying about seams? Because as of now, it makes perfect seems in the scene.

    Thanks!
     
  44. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Script is always required for meshes that are generated using Compression enabled to correctly align vertices on the chunks perimeter (in editor and build). Without this script there will be visible seams on the perimeter because of mesh compression. Script requires mesh Static flag to be disabled.
    If you need Static mesh for any reason, regenerate terrain meshes with Compression disabled.



    Amazing Assets - YouTube Facebook Twitter
     
    FlightOfOne likes this.
  45. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    Alright, understood. Thank you!

    There are no benefits to compressing other than reducing the size on disk right?
     
  46. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Yes, only reducing the size on disk.



    Amazing Assets - YouTube Facebook Twitter
     
    FlightOfOne likes this.
  47. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    Hi,

    Does it have option to generate LODs? like LOD1 for close up detailed mesh. and LOD3 Super low poly with lo res texture like 256x256?¿?

    I've a dataset of like 2000 terrain 2x2km tiles and if all load for conversion will go over mem limit. It would be great to batch convert a folder option be present, is there?

    Thats it.
     
  48. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    LOD groups are not generated. Based on the chosen settings only one prefab is created for each terrain.
    Generated files can be saved anywhere on the hard drive (inside and outside of a project).
    Before converting terrains, it is necessary to load them inside conversion window. If there is not enough memory to load 2000 terrains at once, you have to split them in several groups and convert that way.



    Amazing Assets - YouTube Facebook Twitter
     
  49. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    Looking at your first image in the thread it really seemed like you could create multiple resolutions in batch and LOD theese. Is this feature in the roadmap, because I would not mind to work with Lod 0 during development if the LOD feature is coming on time, after all adding LOD should be almost trivial.

    The batch conversion I could do manually in packs of several hundreds of tiles as you say, also adding funciotnality to process a complete folder should not be much of a deal like add this file, process, remove file and add some extra.

    If you think you can implement theese in not too long I'll get the asset :D
     
  50. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Unfortunately LOD system currently is not in the roadmap :oops:.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Sep 15, 2021