Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

► Terrain to Mesh ◄

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

  1. crowmaster

    crowmaster

    Joined:
    Jul 6, 2012
    Posts:
    89
    This means physically there is no holes? Any plans on fixing this?
     
  2. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Yes, no physical holes.
     
  3. crowmaster

    crowmaster

    Joined:
    Jul 6, 2012
    Posts:
    89
    Why not add real holes support?
     
  4. tgaldi

    tgaldi

    Joined:
    Oct 28, 2015
    Posts:
    102
    Hey, I'm testing this on Unity's HDRP Terrain Demo (using 2021.3.8f1) but not having great results:

    upload_2022-10-20_15-42-28.png
     
  5. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Results depend on settings you use.

    Unity built-in Plane mesh has 121 vertices.
    Unity Terrain HDRP Demo scene consists of 16 high detailed terrains. You expect that entire terrain landscape converted into a mesh with just 625 vertices gives you the "great" results?

    Increase generated mesh vertex count.

    Advice, do not export original amount of detail meshes, scene consist of about 4 million detail meshes and each one has more than 1K vertices.
    Try export only mesh first, then add trees and after that grass and details (with 0.1 or even 0.01 for multiplier).
     
    Last edited: Oct 20, 2022
  6. tgaldi

    tgaldi

    Joined:
    Oct 28, 2015
    Posts:
    102
    The main problem I'm seeing is the material flickers (the blown out bits in the screenshot flicker when you move around in the scene).

    Is there another doc on how to tweak settings in more detail?
     
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    At my side no problems found.

    Can you capture video of that material flickering, it is difficult to see on the screenshot.
    Send me it on the support e-mail (support@amazingassets.world) with asset purchase invoice. I will check it. May be it is not because of material at all, but some other settings for example shadow or post processing.
     
    tgaldi likes this.
  8. tgaldi

    tgaldi

    Joined:
    Oct 28, 2015
    Posts:
    102
    I just wanted to follow up that the developer quickly responded and we were able to fix the issue.
     
  9. Yunittie

    Yunittie

    Joined:
    Jun 27, 2022
    Posts:
    10
    Hello, the description of the asset Terrain to Mesh 2021 says "tool works only with Unity TerrainData object and exports mesh, textures and materials only from it." Does terrain to mesh work with MapMagic 2 terrain? Have someone tried it before? Thanks a lot
     
  10. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    785
    I just purchased Terrain To Mesh, but I'm having problems getting the shaders to compile and run. I'm using Unity 2021.3.11 with URP 12.1.7 and Hybrid Renderer 0.51.1.

    I followed the directions for "Update Splatmap Shader" in the documentation ( https://docs.google.com/document/d/1d-m1U0_ZnErRpfidkCw4bmhf0kdxvsnTvHQFkqjdP_c ). Copied Shader from ShaderGraph and then did right-click on shadergraph and Generate Shader for both Splatmap.shader and Splatmap (Holes).shader.

    At first I was having tons of problems and it crashed unity a couple of times. Now it seems to have calmed down, but I'm stuck in a catch-22.

    In the inspector, I saw the error:
    "SRP Batcher not compatible
    Material property is found in another cbuffer than "UnityPerMaterial" (_T2M_Layer_0_uvScaleOffset)"


    So in Variables.cginc, I put a CBUFFER_START(UnityPerMaterial) around float4 _T2M_Layer_0_uvScaleOffset; and float4 _T2M_Layer_0_ColorTint; That fixed the problem, but then it complained:
    "SRP Batcher not compatible
    Material property is found in another cbuffer than "UnityPerMaterial" (_T2M_Layer_1_uvScaleOffset)"


    So I added float4 _T2M_Layer_1_uvScaleOffset to the same CBUFFER in Variables.cginc as I did the others, but when I did that, I started getting the error:
    "redefinition of '_T2M_Layer_1_uvScaleOffset'".

    So it's a catch-22... If I define it in the cbuffer then it complains that it's being redefined (no idea where the old definition is), and if I don't define it, then it complains that the material property is found in another cbuffer.

    I can't disable SRP Batching because Hybrid Renderer V2 (HRV2) requires it.

    Any ideas?
     
  11. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Compatibility with SRP Batcher will be included in the next week update.
     
    Last edited: Nov 18, 2022
    lclemens likes this.
  12. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    785
    OMG that just made my day!!!
     
  13. Sciallalo

    Sciallalo

    Joined:
    Dec 5, 2021
    Posts:
    1
    I was trying to use your package but this error come up.
    Do you have any clues?

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. VacuumShaders.TerrainToMesh.TerrainToMesh_EditorWindow.ClearConsole () (at <618a058459b344658e15ea370d61bc08>:0)
    3. VacuumShaders.TerrainToMesh.TerrainToMesh_EditorWindow.Generate () (at <618a058459b344658e15ea370d61bc08>:0)
    4. VacuumShaders.TerrainToMesh.TerrainToMesh_EditorWindow.Draw_GenerateButton (System.Boolean _isReadyToGenerate) (at <618a058459b344658e15ea370d61bc08>:0)
    5. VacuumShaders.TerrainToMesh.TerrainToMesh_EditorWindow.OnGUI () (at <618a058459b344658e15ea370d61bc08>:0)
    6. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <786b546700bc48b68852821de5e46ca9>:0)
    7. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <786b546700bc48b68852821de5e46ca9>:0)
    8. UnityEditor.DockArea.OldOnGUI () (at <786b546700bc48b68852821de5e46ca9>:0)
    9. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <c735460d95a241ccbea413909634f410>:0)
    10. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <c735460d95a241ccbea413909634f410>:0)
    11. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <c735460d95a241ccbea413909634f410>:0)
    12. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <c735460d95a241ccbea413909634f410>:0)
    13. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <c735460d95a241ccbea413909634f410>:0)
    14. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <c735460d95a241ccbea413909634f410>:0)
    15. UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <c735460d95a241ccbea413909634f410>:0)
    16. UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <c735460d95a241ccbea413909634f410>:0)
    17. UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <c735460d95a241ccbea413909634f410>:0)
    18. UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <c735460d95a241ccbea413909634f410>:0)
    19. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <c735460d95a241ccbea413909634f410>:0)
    20. UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <c735460d95a241ccbea413909634f410>:0)
    21. UnityEngine.UIElements.EventDispatcher.OpenGate () (at <c735460d95a241ccbea413909634f410>:0)
    22. UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <c735460d95a241ccbea413909634f410>:0)
    23. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <c735460d95a241ccbea413909634f410>:0)
    24. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <c735460d95a241ccbea413909634f410>:0)
    25. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <c735460d95a241ccbea413909634f410>:0)
    26. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <c735460d95a241ccbea413909634f410>:0)
    27. UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <c735460d95a241ccbea413909634f410>:0)
    28. UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <c735460d95a241ccbea413909634f410>:0)
    29. UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <c735460d95a241ccbea413909634f410>:0)
    30. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <681fdbd9389e4d6e8755fe4f632bfbbe>:0)
     
    Last edited: Nov 21, 2022
  14. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    That's very old version you are using.
    Download new one using package manager, but before that clear Asset Store cache folder.
     
  15. ashetynw

    ashetynw

    Joined:
    Feb 25, 2018
    Posts:
    5
    I'm using the 2022.13 (Oct 22, 2022) version of TTM on Unity HDRP 2021.3.9f1. I've followed the instructions in the manual to recompile shaders, but when I build the project i get the following console output. Any ideas how I can resolve this issue?

    Code (CSharp):
    1. Shader error in 'Amazing Assets/Terrain To Mesh/Splatmap (Holes)': Fragment program 'Frag': Unrecognized sampler 'sampler_t2m_layer_0_diffuse' - does not match any texture and is not a recognized inline name (should contain filter and wrap modes).
    2. at line 3580 (on d3d11)
    I'll also note, I have tried a full uninstall, re-download and re-import of the package with the same result.
     
  16. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Can you paste the full error message?
     
  17. ashetynw

    ashetynw

    Joined:
    Feb 25, 2018
    Posts:
    5
    Code (CSharp):
    1. Shader error in 'Amazing Assets/Terrain To Mesh/Splatmap (Holes)': Fragment program 'Frag': Unrecognized sampler 'sampler_t2m_layer_0_diffuse' - does not match any texture and is not a recognized inline name (should contain filter and wrap modes).
    2. at line 3580 (on d3d11)
    3.  
    4. Compiling Subshader: 0, Pass: MotionVectors, Fragment program with WRITE_NORMAL_BUFFER _T2M_LAYER_0_MASK _T2M_LAYER_0_NORMAL _T2M_LAYER_1_NORMAL
    5. Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PASS_MOTIONVECTORS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    6. Disabled keywords: INSTANCING_ON SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING WRITE_DECAL_BUFFER WRITE_MSAA_DEPTH _ADD_PRECOMPUTED_VELOCITY _ALPHATOMASK_ON _DISABLE_DECALS _DISABLE_SSR _DOUBLESIDED_ON _T2M_LAYER_10_MASK _T2M_LAYER_10_NORMAL _T2M_LAYER_11_MASK _T2M_LAYER_11_NORMAL _T2M_LAYER_12_MASK _T2M_LAYER_12_NORMAL _T2M_LAYER_13_MASK _T2M_LAYER_13_NORMAL _T2M_LAYER_14_MASK _T2M_LAYER_14_NORMAL _T2M_LAYER_15_MASK _T2M_LAYER_15_NORMAL _T2M_LAYER_1_MASK _T2M_LAYER_2_MASK _T2M_LAYER_2_NORMAL _T2M_LAYER_3_MASK _T2M_LAYER_3_NORMAL _T2M_LAYER_4_MASK _T2M_LAYER_4_NORMAL _T2M_LAYER_5_MASK _T2M_LAYER_5_NORMAL _T2M_LAYER_6_MASK _T2M_LAYER_6_NORMAL _T2M_LAYER_7_MASK _T2M_LAYER_7_NORMAL _T2M_LAYER_8_MASK _T2M_LAYER_8_NORMAL _T2M_LAYER_9_MASK _T2M_LAYER_9_NORMAL _T2M_LAYER_COUNT_10 _T2M_LAYER_COUNT_11 _T2M_LAYER_COUNT_12 _T2M_LAYER_COUNT_13 _T2M_LAYER_COUNT_14 _T2M_LAYER_COUNT_15 _T2M_LAYER_COUNT_16 _T2M_LAYER_COUNT_3 _T2M_LAYER_COUNT_4 _T2M_LAYER_COUNT_5 _T2M_LAYER_COUNT_6 _T2M_LAYER_COUNT_7 _T2M_LAYER_COUNT_8 _T2M_LAYER_COUNT_9 _T2M_TEXTURE_SAMPLE_TYPE_ARRAY
    7.  
     
  18. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Should be fixed in tomorrow's update.
     
    lclemens likes this.
  19. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    785
    Today is Friday so I was getting worried that the update wouldn't come this week and I was waiting to see if the fix came because if I couldn't get it to work, I was considering getting a refund.

    But just like you said - the update arrived the next week, and it works with URP and HRV2! Hats off to you sir.

    So for anyone wondering how to use this in a DOTS authoring component (baking in 1.0) such that any changes you make to the terrain automatically get converted to a mesh whenever you convert/bake your subscene:

    Code (CSharp):
    1.  
    2. // Use Amazing Assets to make a mesh from the terrain data.
    3. Mesh mesh = terrain.terrainData.TerrainToMesh().ExportMesh(256, 256, Normal.CalculateFromMesh, null);
    4. // This creates a material that uses the Amazing Assets splat-map shader.
    5. UnityEngine.Material material = terrain.terrainData.TerrainToMesh().ExportSplatmapMaterial(false);
    6. // Use the rendermesh utililty to add the mesh and mesh renderer to the entity.
    7. RenderMeshUtility.AddComponents(entity, dstManager, new RenderMeshDescription(mesh, material, UnityEngine.Rendering.ShadowCastingMode.On, true));
    And wala! 3 lines of code and I now have a fully rendered terrain with splatmaps in the scene as an entity instead of a game-object, and it looks spectacular!
     
    shyamarama likes this.
  20. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Hi there, I just picked up the asset today for use in my URP project (Unity 2020.3.43). I unpacked the Universal installer for URP.

    Unfortunately, when following the instructions for the example scene 'Quickstart', after hitting the run button, I get Pink textures for the exported mesh. I've attached the errors from my console.
     

    Attached Files:

  21. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Did you recompile Splatmap shaders?
     
  22. sylvain

    sylvain

    Joined:
    Feb 19, 2013
    Posts:
    46
    Hi,

    I have a couple of questions. Maybe they are stupid questions, as I am new to TTM.

    My first goal is to create a TTM prefab, from a Terrain, and move it into a new project.
    My second goal is to create, from such prefab, an AssetBundle, to import the Mesh during runtime mode.

    - I have tested TTM on a Terrain, and in Basemap mode, was able to create the prefab. The prefab was created with an EdgeFall, pointing to a Texture. But, when importing in an other project, the mesh for Edge Fall seems present ("<name> Edge Fall.mat"), but is no way looking as original material (see screenshots). Do I miss something ?

    - for creating an AssetBundle, is there an easy way to affect an Asset Bundle name to all files implied in the prefab ?
     

    Attached Files:

  23. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    From screenshot it looks like you are missing EdgeFall texture. Check the folder with the main prefab, texture must be there.
     
  24. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Yes, I did a reimport to the Splatmap Shader. No luck unfortunately.

     
  25. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
  26. mailfromthewilds

    mailfromthewilds

    Joined:
    Jan 31, 2020
    Posts:
    219
    TerrainToMesh works in editor for me, but I may be doing something wrong cuz it doesnt work runtime.

    I get a terrainlike mesh in editor
    But I only get a huge, flat plane in runtime


    using this code:
    Code (CSharp):
    1. Mesh s = randomMainTerrain.terrainData.TerrainToMesh().ExportMesh(1000, 1000, Normal.None);
     
  27. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Editor uses the same API. If it works, then problem may be in your script or game objects settings. Check transfrom scale, may be it is set to 0?
     
  28. AwesomeZY

    AwesomeZY

    Joined:
    Feb 21, 2023
    Posts:
    1
    Hello, does TerrainToMesh support exporting a hexagon mesh (to be used in a hex tiled 3D game)? If not, would it be easy for me to modify the code to achieve it?
     
  29. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Exports only common mesh, not hexagon.

    [Edit]
    It is funny that some time ego I already started some experiments with hexagon terrains.
    But if it will be released, only as a separate asset.
    hexagon.gif
     
    Last edited: Feb 21, 2023
    AwesomeZY likes this.
  30. LegacySystem

    LegacySystem

    Joined:
    Jan 28, 2021
    Posts:
    61
    Hi we are using Terrain To Mesha Asset with dynamic ligting. If the ligth comes from tilted angle, oposite side of the terrain becoms really dark. Is there way to change this behaviour ? I tried disabling shadow but it still there. We are using Gradient ambient ligting. If the Equator color intensity is high enough to get rid off darkness, everything else becomes white. I tried couple of things with shader graph method you provided but couldn't get anything to work actually. How can I reduce this darkness.

    shadow on:
    upload_2023-3-16_11-28-57.png

    No shadow
    upload_2023-3-16_11-30-6.png
     
  31. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Those screenshots actually don't demonstrate any problems. They look correct.

    Are there similar problems if using Basemap (instead of Splatmap) shader?
     
  32. LegacySystem

    LegacySystem

    Joined:
    Jan 28, 2021
    Posts:
    61
    I am not saying there is a problem. I want a brighter back side. Adding an emission effect every part of the terrain. Changing it to URP/Lit does result a little better.

    upload_2023-3-16_19-21-57.png
     
  33. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Splatmap shader imitates Unity's built-in terrain shader and it does not support emission.
    upload_2023-3-17_0-6-42.png
    1) Left one is Unity's built-in terrain.
    2) Middle on is generated mesh with TTM Splatmap shader.
    3) Right one is generated mesh with URP/Lit shader with baked Basemap.
    Nothing is darkend.

    You can try to manully modify Splatmap.shadergraph file and add emission or other effect, and after that re-generate Splatmap.shader as described in the Manul file page 12.
     

    Attached Files:

  34. Laxic

    Laxic

    Joined:
    Jun 15, 2022
    Posts:
    1
    hello,Does this have an effect on Gaia Pro?
     
  35. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    What kind of effect?
    If you are asking if terrain created using Gaia can be converted to a mesh, then remove Gaia from project and change any custom terrain shader to Unity's default shaders. What kind of terrain asset is left after that, will be converted to a mesh.
     
  36. UserNobody

    UserNobody

    Joined:
    Oct 3, 2019
    Posts:
    145
    How can I export grass details patches in the script? I am working on my own tool and want to build mesh and details from my own code. I have figured it out how to build the terrain mesh, by using `TerrainToMeshDataExtractor.ExportMesh()`, however, I can't find a way to build grass patches to meshes. How do I do that? What steps do I need to take to export all the grass details patches and get all meshes?
     
  37. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Using ExportGrassData method, explained in Manual file (page 18) and demonstrated in the 6. Run-time (Export Trees, Grass and Details) example scene.
     
  38. UserNobody

    UserNobody

    Joined:
    Oct 3, 2019
    Posts:
    145
    Thank you for the reply! I have looked at the examples and have managed to get it to work. However, I noticed that the grass patches are combined like this:

    upload_2023-3-22_21-21-13.png

    Is there a way to instead have it combined in a grid type? Something like this where each patch is like a cell in a grid:

    upload_2023-3-22_21-24-2.png

    This would be more useful in terms of creating a LOD system. Thank you
     
  39. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Grass mesh can be exported per-chunk too (API includes 3 methods). After that you can manually check position of each element (DetailPrototypesData.position) and decide grid/cell it belongs to and combine them that way.
     
  40. cjhxajh

    cjhxajh

    Joined:
    Jan 3, 2018
    Posts:
    3
    Hi, is it possible to support that grass and detail grid can be set in separate layers?
    Thank you.
     
    Last edited: Apr 8, 2023
  41. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Like this?
    upload_2023-4-8_18-8-47.png
     
    cjhxajh likes this.
  42. cjhxajh

    cjhxajh

    Joined:
    Jan 3, 2018
    Posts:
    3
  43. Thall33

    Thall33

    Joined:
    Sep 18, 2013
    Posts:
    134
    Is there an option to export the mesh at local and or world position - I want to export terrains as modelling references for Maya
     
  44. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Always exported in local space with pivot point at (0,0,0).
     
  45. cjhxajh

    cjhxajh

    Joined:
    Jan 3, 2018
    Posts:
    3
    Hi, when will this feature be updated to the Asset Store?
     
  46. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    It will be included in the next week update:
    upload_2023-4-21_17-1-44.png
     
  47. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,759
    when are you adding support for holes? it's the biggest and largest problem at the moment. Recreating holes on the terrain when we have made a bunch on Unity terrain, it's a pain in the ass. No package does it.
     
  48. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    3,008
    Not planned.
     
  49. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,759
    for any specific reason? I mean, it's a clear issue. Imagine having a terrain with many holes... you have to create the mesh and then go into blender a match the same hole as closely as possible. If you have many holes, it is a lot of work and you keep forgetting some. If the package was doing this automatically, it would save so many hours.
     
  50. BlaASterR

    BlaASterR

    Joined:
    Dec 13, 2015
    Posts:
    2
    Hello, I have a problem trying to export the terrain to mesh saying there is a problem with shader. I tried on a whole new terrain without any Terrain Layers but still the same error :
    ArgumentNullException: Value cannot be null.
    Parameter name: shader

    What can I do ?
     

    Attached Files: