Search Unity

  1. 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,473
    Do not worry, "pinkish" normal map texture is correct and you can use it in runtime with bump shaders. It comes out "pinkish" because it is already encoded as normal map by Unity standards.
    Here (link) you can check why and how Unity converts those bluey-purple color normal maps (check Why the bluey-purple colours? chapter in the link).

    If exporting normal map in Editor, it comes out in bluey-purple colors.
    In runtime it is pinkish because it is already encoded.



    Amazing Assets - YouTube Facebook Twitter
     
  2. bisc67

    bisc67

    Joined:
    Apr 22, 2016
    Posts:
    8
    Unfortunately, the bump map doesn't appear to work correctly either. The lighting ends up all wrong. I'll post an image of what I get later today. But it *looks* like the normals are inverted.

    The color I'm seeing doesn't correspond at all with the description in the article. It's either inverted normals (which I did try changing in the shader), or somehow channels have been flipped in the texture.
     
  3. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    614
    HI @Arkhivrag !!!
    Terrain to Mesh supports HDRP?
    The only thing I need is to be able to generate the mesh for the terrain tiles at a long distance, so the shader that I would use in this mesh would be Unity.
    But does it also generate the albedo and normalmap texture from what is painted on the ground? I'm not sure how this works, so all the information on how your tool works to use it in HDRP helps me before buying


    Cheers
     
  4. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    In HDRP you can: 1) Convert terrain to mesh, 2) bake Basemap texture (albedo and normal).
    Only thing you can't - use T2M shader imitating terrain shader blending multiple paint textures using SplatMaps.



    Amazing Assets - YouTube Facebook Twitter
     
  5. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    614
    @Arkhivrag For when do you think you will have that Shader ready to use in HDRP? I'm not sure how to do "bake Basemap texture (albedo and normal)."

    I am very interested in buying, but I would need your shader to work or know how to do what you tell me to bake the texture ... well it would also be good to have a reference of what a transformed mesh would look like with your asset and you shader and the same but with the texture backeada as you tell me
     
  6. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Basemap baking is done using Terrain To Mesh plugin editor window.
    Basemap is a combination of all terrain panted textures into one.
    Basemap baking exports two textures: 1) Albedo (color map), 2) Normal map


    Final result comparison depends on exported mesh vertex count, Basemap resolution, your shader.



    Amazing Assets - YouTube Facebook Twitter
     
    ftejada likes this.
  7. jobobbel

    jobobbel

    Joined:
    Mar 22, 2018
    Posts:
    10
    @Arkhivrag I no longers use Vegetation Studio, just Gaia, where it works. Question now: Do I have to replace the Tree Prefabs in theTerrain with e.g. LOD3 Version of Tree Prefabs, before T2Meshing, to only have this light Version of Tree on the mesh? Otherwise I would have the complete tree LOD System on the Mesh? Or is T2M somehow extracting a light Version of tree? If I have to replace them, do I have to rename them to meet the original Prefab of already spawned trees on terrain? Thanks in advance!
     
  8. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    T2M extracts original tree prefabs used by terrain. If those prefabs have LOD, then they are extracted with their LOD. Nothing is changed / modified / optimized in those prefabs.



    Amazing Assets - YouTube Facebook Twitter
     
  9. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    614
    @Arkhivrag I did not know that characteristic of your asset. So, if I have a Unity terrain with trees that were put through the terrain tools, when converting my terrain to mesh, will your asset keep those trees in the converted mesh?
    this week I plan to start using your tool
     
  10. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Converted mesh will be separately.
    Trees are not converted, just extracted from Unity terrain system as gameobjects array, preserving position/rotation/scale. Without any terrain lod system, for example distance fade or billboard.



    Amazing Assets - YouTube Facebook Twitter
     
    ftejada likes this.
  11. DarkDeivel

    DarkDeivel

    Joined:
    Aug 31, 2016
    Posts:
    68
    Hi dude! I vitally need some features in Terrain To Mesh!

    1. Auto-Static on generated terrain. After each generation, I constantly have to put Stati with my hands. Add the "Set Static Mesh" feature please!

    2. The essence is the same as with Static, auto-add tag and layer.

    I generate a lot of terranes and I'm always tired of adding Static, Tag and Layer with my hands.

    I hope I will be heard.
     
  12. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Heard.
    But have similar 'quick' updates for 3 other assets. Try to update this in the next week.



    Amazing Assets - YouTube Facebook Twitter
     
    DarkDeivel likes this.
  13. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Download new update v2020.3.



    Amazing Assets - YouTube Facebook Twitter
     
    DarkDeivel likes this.
  14. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    188
    Is it possible to have more the 8 terrain textures? My current terrain has 15.
     
  15. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    It is not possible technically. In one pass shader can render 8 textures (+2 control maps and light/shadow textures). Additional textures will require more passes and T2M shader has only one pass.



    Amazing Assets - YouTube Facebook Twitter
     
  16. DarkDeivel

    DarkDeivel

    Joined:
    Aug 31, 2016
    Posts:
    68
    Hooray! How long have I dreamed about it! Thank!
     
  17. DarkDeivel

    DarkDeivel

    Joined:
    Aug 31, 2016
    Posts:
    68
    What about terrain holes? The thing is extremely useful, it is a pity that it does not convert holes.
     
  18. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Currently no plans for supporting holes. Sorry :(. May be in the future.



    Amazing Assets - YouTube Facebook Twitter
     
  19. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,039
    Just chiming in here: Holes are the key feature that would have made us pick Terrain to Mesh over alternative plugins. I hope the future comes soon!
     
    DarkDeivel likes this.
  20. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    It defiantly would be great. But I have no mesh cutting, slicing and hole making library and currently very busy with other asset updates.
    For now I can try to extract Terrain holes as a texture data (need to make research).

    [Edit]
    Yes. I can extract terrain Holes texture. Update will be on Monday - Tuesday.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: May 2, 2020
    DarkDeivel and JoeStrout like this.
  21. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    220
    @Arkhivrag

    cool tool, very handy :)

    would it be possible to add controls to specify an exact rectangular area of the terrain to convert to a mesh? chunking rules would then apply within that rectangle.

    we often start with a terrain that's larger than the actual intended play space. it would be great if it could generate meshes for only the relevant terrain that we want to keep.

    Thanks for reading :)
     
  22. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Currently not possible.
    Added to a wish-list.



    Amazing Assets - YouTube Facebook Twitter
     
  23. MutatedSoftware

    MutatedSoftware

    Joined:
    Dec 4, 2014
    Posts:
    5
    Hello @Arkhivrag, very useful asset you've created! Well done!

    I'm currently using it to get around the fact that DOTS doesn't have terrain support at the moment. Other work around for that gap that I've found unfortunately don't work with the Havoc Physics package (which is awesome). The generated meshes made by Terrain to Mesh work great in DOTS, however the meshes won't render due to the shader not being compatible with the SRP Batcher (I think): https://blogs.unity3d.com/2019/02/28/srp-batcher-speed-up-your-rendering/.

    I bought the SRP support asset and crossed my fingers, but alas :). Anywho, wanted to mention it in case you get bored some day and wanted to help a happy consumer with their unreasonable request :D. No worries though.

    All the best
     
  24. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Have 0 experience with DOTS.
    Just a quick question - does Unity Shader Graph supports DOTS by default? I plan to re-write SRP shaders using Shader Graph for the next update for supporting HDRP too.



    Amazing Assets - YouTube Facebook Twitter
     
  25. MutatedSoftware

    MutatedSoftware

    Joined:
    Dec 4, 2014
    Posts:
    5
  26. DarkDeivel

    DarkDeivel

    Joined:
    Aug 31, 2016
    Posts:
    68
    Hello! Have you implemented hole texture extraction? How to use it?
     
  27. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Holesmap can be extracted. But plugin does not provide any additional usage of it. It is completely up to you how to use.



    Amazing Assets - YouTube Facebook Twitter
     
  28. Srokaaa

    Srokaaa

    Joined:
    Sep 18, 2018
    Posts:
    127
  29. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
  30. Srokaaa

    Srokaaa

    Joined:
    Sep 18, 2018
    Posts:
    127
    @Arkhivrag Thanks! I see that there is a shadergraph called "SRP Default.shadergraph" included. Advanced dissolve has an ability to be integrated in shadergraph generated shaders. Is it worth for me to tinker with it or should I wait for official support? If later, do you have any ETA? Not pushing, I just want to know to be able to priotirize work on my TODO list
     
  31. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Included "SRP Default.shadergraph" is just a simple diffuse shader, not T2M shader.
    T2M shaders supporting ShaderGraph are available here.
    Yes, Advanced Dissolve can be integrated into shaders created by ShaderGraph (currently only for Universal render pipeline).

    Note, there is texture samplers limitation in shaders. It is 16 texture samplers for DX11.Some old mobile devices support even less, about 8.
    T2M shaders use maximum 10 textures (8 paint textures + 2 control maps). Additionally Unity uses some more for shadows, lightmaps, etc. If you need to integrate T2M and Advanced Dissolve avoid using triplanar effect and keep textures used by dissolve effect as low as possible or your final shader may fail to compile.




    Amazing Assets - YouTube Facebook Twitter
     
  32. Srokaaa

    Srokaaa

    Joined:
    Sep 18, 2018
    Posts:
    127
    @Arkhivrag Regarding conversation above - I was able to integrate AdvancedDissolve in TerrainToMesh shadergraphs easily just by following AdvancedDissolve integration guidelines. Your assets are awesome, thanks!
     
    Arkhivrag likes this.
  33. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Pay attention to the used texture count.



    Amazing Assets - YouTube Facebook Twitter
     
  34. shi946

    shi946

    Joined:
    Jun 3, 2019
    Posts:
    11
    Is it possible to mesh only a section of the terrain? For example, can I specify a square or circular matrix of terrain coordinates to mesh?
     
  35. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    No, it is not possible.
    But it a good feature to have. Added to a wish list.



    Amazing Assets - YouTube Facebook Twitter
     
  36. Cris_2013

    Cris_2013

    Joined:
    Nov 25, 2017
    Posts:
    28
    Hi, thanks a lot for this plugin.
    In my case I fragmented the terrain in 16 parts (4x4), and I would like to edit them using a 3D software like 3Ds Max. However these parts are .asset files - who can I convert those .asset files to .fbx or .obj?
    I know there is a .obj object created, but it is a single object (instead of the 16 parts).

    Many thanks for your help
     
  37. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    OBJ exporter can not split generated mesh, it was add as a solution to export mesh with unlimited vertex count (Unity limits it to 65.000 vertices).
    OBJ mesh split is on todo list for the next big update.
    For now you can try any third party asset or script from the Asset Store to convert generated .asset mesh into OBJ file format.



    Amazing Assets - YouTube Facebook Twitter
     
  38. karam89

    karam89

    Joined:
    Aug 23, 2015
    Posts:
    9
    Hello,
    First of all thank you for your nice asset

    It's working well for me, but I only have one concern

    I've one big terrain, and I want to convert it to mesh using your asset

    Since the terrain is big, I divided it into 4 meshes (2 by 2)

    The result is good, but all of the 4 meshes are sharing the same textures (your asset handles the UVs between them)
    (IE: the result is 4 meshes, sharing the same textures)


    what I want is:
    I want to have 4 meshes, each has its own textures,
    (IE: even the textures should be divided, just like the meshes)

    This gives me better control of textures quality

    How can I do that?
     
  39. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Do not export Splatmap texture then. It can not be divided. Purpose of the Splatmap is that you can have the highest texture render quality. But it is limited to 8 paint textures only.

    If your terrain uses more than 8 paint textures you have to bake Basemap texture. It can bake unlimited painted textures and can be divided per-chunk. Just enable Export Per-Chunk property.




    Amazing Assets - YouTube Facebook Twitter
     
  40. EightBitRemix

    EightBitRemix

    Joined:
    Dec 14, 2015
    Posts:
    3
    Hi, thanks for the great plugin! I used it several months ago and it worked perfectly, however after reinstalling for some new terrains, I'm having some issues. I was wondering if you could tell me where I'm going wrong. Basically, when converting a terrain to a fbx the diffuse map does not seem accurate at all, it's as if the opacity of the layers is getting messed up. I've attached pictures for reference, on the terrain photo the left is before the conversion, right is after. Any help you can offer would be greatly appreciated.
     

    Attached Files:

  41. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    From screenshot it is difficult to understand what may be a problem. Use support e-mail support@amazingassets.world with some more details:
    1) Unity version.
    2) Render pipeline.
    3) Project color space.
    4) Target build platform.
    5) OS.
    6) Is problem constant and happens with all terrains?
    7) If problem exist only for specific terrains, attach to e-mail one such problematic terrain with all its used painted textures as a package.
    8) Include asset purchase invoice.



    Amazing Assets - YouTube Facebook Twitter
     
  42. Silasi

    Silasi

    Joined:
    Jul 25, 2016
    Posts:
    48
    Hello! Great asset!

    I'm having trouble building to android(a scene with just the terrain for testing purposes). Shaders provided don't work as expected. On android the terrain doesn't seem to be affected by lightmaps. In editor/playmode it works perfectly but building on android results into an unlit terrain. Happens with all of the OneDirectionalLight/Diffuse shaders.

    Converting to mesh a terrain with only one texture fixes the problem as it uses Mobile/Diffuse. However, I cannot use a terrain with only one texture...

    Unity 2020.1, Deferred Rendering, Gamma Color Space
     
    Last edited: Jul 30, 2020
  43. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Do you include fallback shaders into build too? There are in Terrain To Mesh\Shaders\Fallback folder.



    Amazing Assets - YouTube Facebook Twitter
     
  44. Silasi

    Silasi

    Joined:
    Jul 25, 2016
    Posts:
    48
    Yes, the shaders in that folder are included in Edit/Project Settings/Graphics/Always included Shaders
     
  45. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    Just tested with Unity 2020.1 and all shaders work without problem with baked lightmaps.
    How much painted textures (Layers) your terrain uses? May be your mobile device can not handle that amount of textures.
    When main shader fails to compile Unity automatically switches to the Fallback shader. And for such case all T2M shaders have BaseMap texture property. If it is not assigned material just will render white color in case of Fallback.



    Amazing Assets - YouTube Facebook Twitter
     
  46. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    614
    Hi @Arkhivrag :

    I have a doubt. I use Unity 2019.4.0 f1 and HDR Pipeline 7.4.3

    I have purchased Terrain To Mesh and Terrain To Mesh Scriptable Render Pipeline as I believed that without TTM-SRP would not work well TTM for HDRP.

    When importing TTM SRP I get the errors that appear in the photo that I attach here below, although everything seems to work fine:
    PreblemTTM.jpg

    When transforming a terrain to mesh, the shader that assigns in the conversion the material of the terrain mesh is Universal Render Pipeline / Lit / 6Textures.

    Shouldn't it be called the Shader High Definition Render Pipeline / Lit? I leave video for you to see:





    -Is TTM-Scriptable Render Pipeline working correctly?

    - What is this asset for? if using only TTM it was assigning to material a shader SRP Default and everything seemed to work fine.

    - Could you explain to me the advantages of having and using TTM-SRP? Because I don't understand the advantage of having bought it.

    Regards.
     
  47. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    1) Terrain To Mesh - Scriptable Render Pipeline asset is a shader collection for TTM designed for SRP. Those shaders are used to imitate Unity terrain shading on mesh.
    SRP Default shader is used if above shaders are not installed, to avoid creating 'pink' mesh render result.

    2) Shader names in Terrain To Mesh - Scriptable Render Pipeline asset use Universal Render Pipeline prefix. They are used in all scriptable render pipelines.

    3) Shader 'errors' you receive after importing package may be fixed by opening shader file inside ShaderGraph and clicking Save button there. This re-saves shader file using your ShaderGraph version.
    It is not a shader error, but some Unity Editor's warring as shader file is created not in the same ShaderGraph version as you are using.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Aug 17, 2020
  48. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    127
    I've seen the 64k mesh vertex limit was mentioned here but it was an old post. Does this plugin support using a 32 bit mesh index buffer now, so that it can convert to a larger mesh?
     
  49. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,473
    32bit index buffer will be supported in the next update, planed for the beginning of October.
    Currently you can achieve unlimited vertex count for converted terrain using integrated mesh splitting system (chunk).



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Aug 31, 2020
    wlad_s likes this.
unityunity