Search Unity

► Terrain to Mesh ◄

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

  1. OcypodeStudios

    OcypodeStudios

    Joined:
    Aug 24, 2015
    Posts:
    6
    Which is the best in terms of performance?
     
  2. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    1. Unlit
    2. One Directional Light
    3. Legacy Shader
    4. Standard

    Even better to bake all terrain textures into one BaseMap, then you can use any shaders.



    VacuumShaders - Facebook Twitter YouTube
     
  3. LeeJiHoon

    LeeJiHoon

    Joined:
    Aug 4, 2016
    Posts:
    14
    I have a problem with mobile. (Galaxy s4)

    Example Scenes 1. SnowTerrain works well.

    However, the problem occurs in 2. Runtime.

    The terrain looks pink.

    I wasted time because of this.

    Help
     
  4. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Example 2 scene contains:
    1. Terrain mesh.
    2. Run-time generated mesh (Converted_2x2_100) using T2M material.
    3. Run-time generated mesh (Converted_1x1_50) using Legacy Bumped shader.

    Which one of this is pink? and what Unity version are you using.



    VacuumShaders - Facebook Twitter YouTube
     
  5. LeeJiHoon

    LeeJiHoon

    Joined:
    Aug 4, 2016
    Posts:
    14
    2. Converted_2x2_100 <--- Pink
    3. Run-time generated mesh (Converted_1x1_50) <---- Only White

    Unity Version Unity 5.6.0b3
     

    Attached Files:

  6. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Unity beta versions are not supported. Use official releases e.g 5.5



    VacuumShaders - Facebook Twitter YouTube
     
    theANMATOR2b likes this.
  7. LeeJiHoon

    LeeJiHoon

    Joined:
    Aug 4, 2016
    Posts:
    14
    Last edited: Mar 2, 2017
  8. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    UVs are in [0 ,1] range.
    Check your build settings, may be there is mesh vertex data compression enabled



    VacuumShaders - Facebook Twitter YouTube
     
  9. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi,

    you don't really telling us why we should use this asset. Maybe you name in your description some use cases.

    If I understand it correctly, one terrain has 4 maps for different purposes. Two of them are in the scene and two of them are in files. My biggest problem is that the maps in the files will be changed/overridden at runtime. At the next start of the scene these two maps are changed (correct me, if this isn't true).

    4 Maps:

    - Height map (in file)
    - Splat Map (in file)
    - Tree Map (in scene)
    - Grass Map (in scene)

    I'm working on an RTS game where I want to change the splat map and the height map. Short version, I need some terrain deformation at placing buildings and also need some texture changes under the buldings and e.g. if the shot hit the terrain.

    If you change the terrain to mesh, then you have a copy of these 4 maps (in a way). I would then copy the terrain to mesh at starting the game, then I would play on this, change the mesh and texture. I guess I could save the mesh terrain for my saved games and if the player re-starts the scene, I copy again. So the terrain should be un-touched.

    Could your asset provide that what I wrote?

    Edit: ***Height, Splat, Tree, Grass all in TerrainData.
     
    Last edited: Mar 14, 2017
  10. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    I would like to request the ability to move this asset anywhere in the project instead of just the root. It gets really messy and I prefer to put all of my asset store items in a folder called "thirdparty"
     
    mh114 likes this.
  11. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Terrain To Mesh will convert any terrain into mesh, regardless used texture count or custom material.
    Converter works in editor and run-time.

    If you are using custom terrain shader and want it to be used on generated mesh then you will have to rewrite it to be compatible with mesh.

    As for deformations is its up to you. You can first deform terrain and then convert it to mesh or modify generated mesh (using script or custom shader).



    VacuumShaders - Facebook Twitter YouTube
     
  12. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    All my assets are interconnected and I need some kind of 'root' for their flawless functionality. This 'root' is the main Assets folder inside project and all my plugins have to be there.
    E.g. Terrain To Mesh is connected to Encode To TGA and Curved World assets.

    Unfortunately what you are asking currently can not be done.



    VacuumShaders - Facebook Twitter YouTube
     
  13. WQ-Charles

    WQ-Charles

    Joined:
    Feb 27, 2017
    Posts:
    5
    Your plugin is very good, but I try to bake lightmap, the result is not perfect.There are many seams between in chunks.
    I think it is a question of uv2,or something else?

    Another problem, can support the chunk directly exported to obj?I want to editor the uv2 in Max
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      38.2 KB
      Views:
      900
    • 2.jpg
      2.jpg
      File size:
      18.7 KB
      Views:
      930
    • 3.jpg
      3.jpg
      File size:
      82.4 KB
      Views:
      922
    Last edited: Mar 18, 2017
  14. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Do you use mesh compression? Seam should be fixed automatically when enter game mode.
    For individual mesh exporting you can use free obj exporters from the Asset Store.



    VacuumShaders - Facebook Twitter YouTube
     
  15. Kazuya-Chang

    Kazuya-Chang

    Joined:
    Feb 1, 2016
    Posts:
    2
    There are many plants(grass, tree, flower) on my current terrain. Do I need to replant them on a new mesh?
     
  16. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Trees can be exported from original terrain. Grass will have to be replant on a new mesh.



    VacuumShaders - Facebook Twitter YouTube
     
  17. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    hi,
    I have converted terrain and trees,because when the player is far the main terrain is disabled and a low mesh of the terrain a bit lower than the terrain appears.When i am near the original terrain , the main terrain is enabled over the mesh and works , but , are the trees billboards ?if the mesh with trees that i have converted has the trees enabled, the polycount is really big, seems that they are not billboards.

    Another question.I have terrains with 10 and 14 textures, is possible somehow to generate all the splatmaps?
    thanks
     
  18. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    T2M exports tree meshes from the terrain, not billboards. (BTW good idea for future update).

    T2M exports all splatmaps, but T2M material can blend maximum 8 textures using only 2 splatmaps. You can bake them all inside one Basemap texture.



    VacuumShaders - Facebook Twitter YouTube
     
  19. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    Yes, i think because to use it as a far replacement of the terrain and trees would be usefull in multi terrain .Meanwhile there is an update with this feature, any idea how to convert the tree prefab in a billboard prefab somehow?anybody can give a suggestion on this?
    thank you
     
  20. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    I'm pretty sure I understand this asset's functionality, but want to make sure. Will it allow me to convert a single terrain into, say, 9 chunks (meaning your asset would split the mesh into 9 tiles), and then spit out global diffuse, normal, etc. maps for each? It's not immediately apparent if this is the case.
     
  21. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    helo i have a huge terrain and I use the asset to convert to a mesh, al works very good, but my problem is that my terrain is split in 4 parts and went I test the terrain shows all 4 parts in the terrain, how I can fixs that? I want all terrain in 1 terrain, Than you.
     
  22. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    Wait, does this asset require working in Gamma? I use Linear exclusively.
     
  23. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    Hmm, I might make this more clear in your presentation/documentation. I distinctly got the impression that this tool would allow you to split the terrain into tiles while converting to mesh.
     
  24. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Terrain can be converted into any amount of chunk mesh.
    All maps extracted from a terrain (splatmaps, heightmap, basemap diffuse/bump) are a single textures and not e.g. 9 textures for individual 9 chunk mesh.

    Basemap baking requires Gamma. You can switch back after baking it.

    Terrain is not split only generated meshes.



    VacuumShaders - Facebook Twitter YouTube
     
  25. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    T2M does not combine terrains or meshes.



    VacuumShaders - Facebook Twitter YouTube
     
  26. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hi , is it possible for future version to add a min sea level, this way we could create mesh and exclude any terrain below sea level.
    Thanks
     
  27. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    I think, no.
    You can export meshes in OBJ format and modify them for your needs.



    VacuumShaders - Facebook Twitter YouTube
     
  28. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    But TTM creates 16x Unity Meshes with 10k verts, but only one obj for the same terrain.
    Should it not create 16 obj as well?
    How would I replace mesh in each tiles?

    Thanks
     
  29. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    T2M OBJ exporter does not work with chunks, but only with one mesh asset with unlimited vertex count.
    Other meshes can be easily exported with free OBJ exporters that you can find on the Asset Store.



    VacuumShaders - Facebook Twitter YouTube
     
  30. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    So basically your obj exporter is useless for tiled terrains. Surely you can see how misleading this is.
    I understand you don't want to add an ignore height level.
    Perhaps then you could revise the obj export facility to create an obj per chunk.
    The reason ppl buy your asset is to make things easier for them, by adding an ignore height you save hours of work for them.
    Thanks
     
  31. Cuttlas-U

    Cuttlas-U

    Joined:
    Apr 11, 2017
    Posts:
    38
    Hi
    tnx for nice plugin;
    it helps me a lot cause my fps really become better from 220 to 310 and it a lot difference;

    but i still have 2 problems;

    1 - when i use the shader with 8 texture ( no diffrent wich one ) the whole texture wont work on terrain and its there but has no texture ;

    i did try shader with 5 textures and it works; i just dont know its shader problem or the texture ;

    2 - my second problem is in android test the textures look like pixels and its a bad thing :(

    i did search a lot for this and did some advice like reducing the resolution of textures or other thing but it still has problem;


    any way tnx for this plugin i like it :)
     
    Last edited: Apr 13, 2017
  32. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Would you mind emailing me at vacuumshaders@gmail.com (with asset purchase invoice from the Asset Store).



    VacuumShaders - Facebook Twitter YouTube
     
  33. cyberwhip

    cyberwhip

    Joined:
    Jun 7, 2015
    Posts:
    11
    Can this conversion to mesh help to create a hole in mesh to add cave? I have the asset but haven't really looked at it yet. Any pointers to make a hole would be helpful.
     
  34. zwcloud

    zwcloud

    Joined:
    Mar 15, 2016
    Posts:
    377
    I'm afraid you will have to do that in 3D modeling software instead. Or try MTE. It can cut a hole in mesh vertically.
     
    Last edited: Apr 21, 2017
  35. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    I may but this, but just want to make sure if will do what I want. I want to be able to convert a terrain, and it's associated textures into a mesh with a material. Essentially I want to reproduce my current terrains, and have them look close to the original as possible. I'd like to have this functionality so that I can scale and rotate the terrain in the game. Strangely, there seems to be no way to rotate a Unity terrain, and scaling them also doesn't seem to work very well (if you scale a large terrain to a small size, the geometry changes drastically).
     
  36. JecksonLiu

    JecksonLiu

    Joined:
    Nov 25, 2016
    Posts:
    6
    Hello, I would like to ask this after the draw draw with the number of face will be a lot of Well?
     
  37. crypt0

    crypt0

    Joined:
    May 25, 2015
    Posts:
    55
    Good morning together,

    @Arkhivrag Do you have an idea, why I can't baked lightmaps? It's getting stuck at 5/11 Clustering | 1 Jobs. When I activate my original Terrain, it works fine. For testing, I have only the TerrainMesh activated in the scene. I will add a screenshot.

    terrain_mesh_bake.png

    I don't understand whats going wrong... with the original Terrain, it takes 3min for baking.

    Cheers
     
  38. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Can not be T2M problem.
    May be game object scale does not equal to 1. Unity has problems calculating lighting for such objects.



    VacuumShaders - Facebook Twitter YouTube
     
  39. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    Hi, do you have a video example of convertion of terrain with trees ?

    How is the LOD of trees managed after de conversion ?
     
  40. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Have no video, it's just a one button click 1sec process.
    From terrain are extracted original tree prefabs. There is no LOD.



    VacuumShaders - Facebook Twitter YouTube
     
  41. Favor_89

    Favor_89

    Joined:
    May 15, 2013
    Posts:
    8
    Hi!

    I have the following problem: I want to use TerrainToMeshConverter static methods to achieve the same effect as while using Window->VacuumShaders->Terrain to Mesh->Generate. Unfortunately it looks like code implementing your editor mechanism is inside DLL. The only available reference script is RunTime_Terrain_Convertion.cs.

    While using my script (based on RunTime_Terrain_Convertion implementation) I was getting game objects that look good, however when I made prefab of them and dragged onto the scene again I saw the Mesh objects are missing. I improved my script to save each Mesh as an asset, which helped with Meshes, but now after making prefab and dragging onto the scene the terrain mesh is pink. I tried to create an asset from shared material, but then the mesh becomes black (because of some reason Control Map of shader becomes none).

    Could you please either tell me how to fix my issue or (the best) provide source code of generating Meshes by your editor mechanism?
     
  42. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    So TerrainToMeshConverter static methods generates and returns converted mesh and then you are using your custom script for creating prefabs, mesh assets, materials and something goes wrong?

    I can only help with TerrainToMeshConverter method (if it does not work), but I can't with your custom scripts.



    VacuumShaders - Facebook Twitter YouTube
     
  43. Favor_89

    Favor_89

    Joined:
    May 15, 2013
    Posts:
    8
    Actually what I need is functionality of Window->Vacuum Shaders->Terrain to Mesh->Generate, but in code. I thought RunTime_Terrain_Convertion.cs is something like that, but it doesn't work if I want to make prefabs of generated terrain, and in case of Window->Vacuum Shaders->Terrain to Mesh->Generate it works with prefabs (all meshes and materials are saved as assets and hooked up well).
     
  44. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    RunTime_Terrain_Convertion.cs script shows how to export everything from Unity terrain(meshes, textures, material). All you have left is save them as assets using AssetDatabase.CreateAsset, setup gameobject and finally create your custom prefab with PrefabUtility.CreatePrefab.



    VacuumShaders - Facebook Twitter YouTube
     
  45. aliakbo

    aliakbo

    Joined:
    Jan 28, 2012
    Posts:
    35
    Hi,

    I'm running into issues with the Unlit 8 Texture Shader from Terrain to Mesh. It works fine in the editor but is pink on some android devices. Any idea what might be causing this?
     
  46. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Unlit 8 Texture shader requires 10 texture rasterization inside shader (8 paint textures + 2 control textures). Some mobiles just are too 'weak' for that.
    Solution: Reduce paint textures count inside terrain or bake them all inside one Basemap.



    VacuumShaders - Facebook Twitter YouTube
     
  47. aliakbo

    aliakbo

    Joined:
    Jan 28, 2012
    Posts:
    35
    Thank you, I changed the shader to a 6 texture shader and it worked perfectly on the device it was previously showing pink.
    Does this mean the 6 texture shader could show pink on lower end devices?
     
  48. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    295
    Hi @Arkhivrag , thanks for this useful asset! One feature request (apart from having it function outside root Assets): any chance for adaptive mesh simplification? So basically when you have lots of flat regions in the terrain mesh, reduce the amount of quads (probably just reduce the vertices and triangulate) on the flat parts where the extra vertices are not needed. I know this can be done with a modeling program using the OBJ-export, but I don't want to do that, complicates the workflow quite a bit.
     
  49. CDUnityDev

    CDUnityDev

    Joined:
    Jan 31, 2017
    Posts:
    25
    Hey @Arkhivrag - I'm working on a game that requires a terrain and right now it's not getting the desired frame-rate. I'm thinking that this is because I used the Unity terrain system, and that it might improve performance to use your converter instead. There are lots of trees and plants, and those are hurting performance in addition to the sheer magnitude of the terrain itself.

    Do you think that using your converter/splitter would do the trick?
     
  50. CDUnityDev

    CDUnityDev

    Joined:
    Jan 31, 2017
    Posts:
    25
    Better question: I went ahead and bought your script, and I'm trying to optimize the 10,000 trees it spat out. How do I assign a LoD that influences all of them so that I can get proper culling and billboarding? (And so that they don't require a million polygons to render)