Search Unity

[FREE]MicroSplat, a modular terrain shading system for Unity Terrains

Discussion in 'Assets and Asset Store' started by jbooth, Aug 9, 2017.

Thread Status:
Not open for further replies.
  1. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    @jbooth fixed here also thanks for the patch
     
  2. wumn

    wumn

    Joined:
    Jan 11, 2018
    Posts:
    25
    • Where is the link to the patch
     
  3. wumn

    wumn

    Joined:
    Jan 11, 2018
    Posts:
    25
    Maximum number (256) of shader keywords exceeded, keyword _AXF_BRDF_TYPE_BTF will be ignored.
    You will have to delete some shaders or make them use less keywords.
    upload_2018-12-24_17-11-8.png

    upload_2018-12-24_18-3-34.png
    unity2018.3.0f2 HDRP Import error. And there is no way to work properly
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Like 2 messages up
     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MicroSplat doesn’t support HDRP yet, as they are still changing things rapidly. You can read up on shader keyword limits in Unity’s manual.
     
  6. Spiral-Organ

    Spiral-Organ

    Joined:
    Aug 20, 2015
    Posts:
    26
    I'm on version 2018.2.17, and I set the graphics settings to low, and the shadowmask feature doesn't seem to be working. It's just the normal Unity shadow drawing behavior as seen below. Is it suppose to render shadows in an infinite distance or does it follow unity's shadow distance?

    upload_2018-12-24_11-52-57.png
     
  7. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It’s a surface shader, so Unity compiles all the lighting code; there’s not really lighting or shadowing code in MicroSplat.
     
  8. wumn

    wumn

    Joined:
    Jan 11, 2018
    Posts:
    25
    Thank you for your reply. I use Chinese, so I can only communicate with you through Google translate. I hope you can answer another question
    我现在创建了一个6X6 总共36tile的地形,有没有能批量设置36 tile地形Tint Texture的办法?
    I have now created a 6X6 Texture of 36 tiles. Is there a way to bulk set the Tint Texture of 36 tiles?
    upload_2018-12-25_10-56-54.png
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You can set it on the template material if you want them all to share it. The options on the terrain component are for when you want each tile to have a unique texture.
     
  10. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    @jbooth Hi Jason, have you seen my last post about an issue?
     
  11. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yes, I have not had a chance to look into it being Christmas and the 2018.3 release. Do you have a repro project you can send?
     
  12. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Ah, sorry I forgot its Christmas now, don't have it in my country.
    Unfortunately I can't provide a repo project, but I'll try to delete all microsplat components and all already made materials, shaders and reimport it again and remake my texture arrays and see if it can work.
    My project use .Net 4.x equivalent, don't know if it is relevant, though this caused a lot of other issues in my game.
    Merry Christmas! And I'll come back after the festival :)
     
  13. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Very unlikely any of it is Net 4.x related, it's all done in the shader.
     
  14. wumn

    wumn

    Joined:
    Jan 11, 2018
    Posts:
    25
    Hello, I used unity2018.3.0f2, and I found that when I started Draw instanced, it did not work.In my screenshot.The white part is unity's terrain material, the brown part is MicroSplat's material, and the brown part obviously lacks a lot of details.
    Also, when I opened Draw instanced, the terrain became unselectable.What's the reason?
    upload_2018-12-26_16-22-53.png
     
  15. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You need to regenerate the shader after the upgrade.
     
  16. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Ok, for those on 2018.3, here is a version of the restore prototypes function that serializes the terrain layers to disk automatically, which should prevent the issue when reloading the scene of having to sync the terrain or regenerate the arrays.

    Code (CSharp):
    1. void RestorePrototypes()
    2.    {
    3.       if (templateMaterial != null)
    4.       {
    5.          Texture2DArray diffuseArray = templateMaterial.GetTexture("_Diffuse") as Texture2DArray;
    6.          if (diffuseArray != null)
    7.          {
    8.             var cfg = JBooth.MicroSplat.TextureArrayConfig.FindConfig(diffuseArray);
    9.             if (cfg != null)
    10.             {
    11.                int count = cfg.sourceTextures.Count;
    12.                if (count > 32)
    13.                   count = 32;
    14. #if UNITY_2018_3_OR_NEWER
    15.                var protos = terrain.terrainData.terrainLayers;
    16.                bool needsRefresh = false;
    17.                if (protos.Length != count)
    18.                {
    19.                   needsRefresh = true;
    20.                }
    21.                if (!needsRefresh)
    22.                {
    23.                   for (int i = 0; i < protos.Length; ++i)
    24.                   {
    25.                      if (protos[i] == null)
    26.                      {
    27.                         needsRefresh = true;
    28.                      }
    29.                      if (protos[i] != null && cfg.sourceTextures[i] != null && protos[i].diffuseTexture != cfg.sourceTextures[i].diffuse)
    30.                      {
    31.                         needsRefresh = true;
    32.                      }
    33.                   }
    34.                }
    35.                if (needsRefresh)
    36.                {
    37.                   Vector4 v4 = templateMaterial.GetVector("_UVScale");
    38.  
    39.                   Vector2 uvScales = new Vector2(v4.x, v4.y);
    40.                   uvScales = MicroSplatRuntimeUtil.UVScaleToUnityUVScale(uvScales, terrain);
    41.  
    42.                   protos = new TerrainLayer[count];
    43.                   for (int i = 0; i < count; ++i)
    44.                   {
    45.                      TerrainLayer sp = new TerrainLayer();
    46.  
    47.                      sp.diffuseTexture = cfg.sourceTextures[i].diffuse;
    48.                      sp.tileSize = uvScales;
    49.                      if (cfg.sourceTextures[i].normal != null)
    50.                      {
    51.                         sp.normalMapTexture = cfg.sourceTextures[i].normal;
    52.                      }
    53.                    
    54.                      protos[i] = sp;
    55.                      string path = UnityEditor.AssetDatabase.GetAssetPath(cfg);
    56.                      path = path.Replace("\\", "/");
    57.                      path = path.Substring(0, path.LastIndexOf("/"));
    58.                      path += "/microsplat_later_";
    59.                      if (sp.diffuseTexture != null)
    60.                      {
    61.                         path += sp.diffuseTexture.name;
    62.                      }
    63.                      path += "_" + i;
    64.                      path += ".terrainlayer";
    65.                      UnityEditor.AssetDatabase.CreateAsset(sp, path);
    66.                   }
    67.  
    68.                   terrain.terrainData.terrainLayers = protos;
    69.                   UnityEditor.EditorUtility.SetDirty(terrain);
    70.                   UnityEditor.EditorUtility.SetDirty(terrain.terrainData);
    71.  
    72.                }
    73. #else
    74.  
    75.  
    76.                var protos = terrain.terrainData.splatPrototypes;
    77.                bool needsRefresh = false;
    78.                if (protos.Length != count)
    79.                {
    80.                   needsRefresh = true;
    81.                }
    82.                if (!needsRefresh)
    83.                {
    84.                   for (int i = 0; i < protos.Length; ++i)
    85.                   {
    86.                      if (protos[i].texture != cfg.sourceTextures[i].diffuse)
    87.                      {
    88.                         needsRefresh = true;
    89.                      }
    90.                   }
    91.                }
    92.                if (needsRefresh)
    93.                {
    94.                   Vector4 v4 = templateMaterial.GetVector("_UVScale");
    95.  
    96.                   Vector2 uvScales = new Vector2(v4.x, v4.y);
    97.                   uvScales = MicroSplatRuntimeUtil.UVScaleToUnityUVScale(uvScales, terrain);
    98.  
    99.                   protos = new SplatPrototype[count];
    100.                   for (int i = 0; i < count; ++i)
    101.                   {
    102.                      SplatPrototype sp = new SplatPrototype();
    103.                      sp.texture = cfg.sourceTextures[i].diffuse;
    104.                      sp.tileSize = uvScales;
    105.                      if (cfg.sourceTextures[i].normal != null)
    106.                      {
    107.                         sp.normalMap = cfg.sourceTextures[i].normal;
    108.                      }
    109.                      protos[i] = sp;
    110.                   }
    111.  
    112.                   terrain.terrainData.splatPrototypes = protos;
    113.                   UnityEditor.EditorUtility.SetDirty(terrain);
    114.                   UnityEditor.EditorUtility.SetDirty(terrain.terrainData);
    115.                }
    116. #endif
    117.  
    118.             }
    119.          }
    120.  
    121.       }
    122.    }
    123.    #endif
     
  17. wumn

    wumn

    Joined:
    Jan 11, 2018
    Posts:
    25
    upload_2018-12-26_19-42-29.png
    As you said, I upgraded my shader, but I reported an error.
     
  18. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You might have to turn off tesselation w/ instancing until unity fixes this; they have some issue in the surface shader compiler w/ the new instancjng system, and since they broke everything through the whole beta cycle the release is their beta. Or conversely turn off instancing.
     
  19. threeguysgamestudio

    threeguysgamestudio

    Joined:
    Dec 1, 2017
    Posts:
    25
    I'm working on figuring out what causes this error, it happens really consistently for me but at different times. Here's the thing: once the error happens, bits of the Unity core terrain system are broken. If I create a new Terrain, there are immediate errors without even touching MicroSplat - these errors show lost references to internal Unity variables (M_Targets) and base Unity materials.

    If I restart Unity after this happens, it will let me know that there is a problem with some core assets and I need to rebuild the project.

    The most recent encounter of the error was painting terrain on a MicroSplat terrain (21 total terrain textures, set to a 32 maximum) and using the "Undo" hotkey. Upon "Undoing", the error happened (It has happened at different times as well, though - selecting new Layers, painting Layers, etc...):

    MissingReferenceException: The object of type 'TerrainLayer' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Object.get_name () (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:198)
    UnityEditor.Experimental.TerrainAPI.PaintTextureTool.DrawFoldoutEditor (UnityEditor.Editor editor, Int32 controlId, System.Boolean& visible) (at C:/buildslave/unity/build/Modules/TerrainEditor/PaintTools/PaintTextureTool.cs:71)
    UnityEditor.Experimental.TerrainAPI.PaintTextureTool.OnInspectorGUI (UnityEngine.Terrain terrain, IOnInspectorGUI editContext) (at C:/buildslave/unity/build/Modules/TerrainEditor/PaintTools/PaintTextureTool.cs:147)
    UnityEditor.TerrainInspector.ShowPaint () (at C:/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:1549)
    UnityEditor.TerrainInspector.OnInspectorGUI () (at C:/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:1950)
    UnityEditor.InspectorWindow.DoOnInspectorGUI (Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, Boolean wasVisible, UnityEngine.Rect& contentRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1625)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


    Maybe it has something to do with the way you are serializing the TerrainLayers, it seems to conflict with the Painter in the Editor?

    Now, after the error, when I create a new TERRAIN (*edit) from scratch in a new scene, upon creation I get the following error:


    MissingReferenceException: The object of type 'Material' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Object.get_name () (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:198)
    UnityEditor.Experimental.TerrainAPI.PaintTextureTool.DrawFoldoutEditor (UnityEditor.Editor editor, Int32 controlId, System.Boolean& visible) (at C:/buildslave/unity/build/Modules/TerrainEditor/PaintTools/PaintTextureTool.cs:71)
    UnityEditor.Experimental.TerrainAPI.PaintTextureTool.OnInspectorGUI (UnityEngine.Terrain terrain, IOnInspectorGUI editContext) (at C:/buildslave/unity/build/Modules/TerrainEditor/PaintTools/PaintTextureTool.cs:115)
    UnityEditor.TerrainInspector.ShowPaint () (at C:/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:1549)
    UnityEditor.TerrainInspector.OnInspectorGUI () (at C:/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:1950)
    UnityEditor.InspectorWindow.DoOnInspectorGUI (Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, Boolean wasVisible, UnityEngine.Rect& contentRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1625)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
     
    Last edited: Dec 27, 2018
  20. threeguysgamestudio

    threeguysgamestudio

    Joined:
    Dec 1, 2017
    Posts:
    25
    This works to resolve the problems!
     
  21. Ivoryjw

    Ivoryjw

    Joined:
    May 20, 2018
    Posts:
    31
    This solved my issue as well. Thanks Mr.Booth for providing this.
     
  22. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    Hi Jason,

    Can i use the terrain blending shader with vegetation studio pro?? Can i spawn a lot of rocks?
    thx
     
  23. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Not sure; it would require some setup on the VS side and I don’t know if Lenart has done that work.
     
    eaque likes this.
  24. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    ok, thanks !
    I will check with him..
     
  25. Ivoryjw

    Ivoryjw

    Joined:
    May 20, 2018
    Posts:
    31
    So I'm having a bit of a problem with streams. Every time I boot back into Unity, the streams disappear off the terrain. Tried repainting it and didn't work. Using unity 2018.3.
     
  26. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Press the save button on the painter.
     
  27. Ivoryjw

    Ivoryjw

    Joined:
    May 20, 2018
    Posts:
    31
    Silly me. Thanks.
     
  28. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    404
    Hi Jason, I'm having a few issues with 2018.3.0f2. I find that changing the tiling settings doesn't seem to make a difference to the tiling of the textures, and I'm getting repeating errors as follows...

    Code (csharp):
    1.  
    2. NullReferenceException: Object reference not set to an instance of an object
    3. JBooth.MicroSplat.FeatureDescriptor.DrawPerTexVector2Vector2 (System.Int32 curIdx, System.Int32 pixel, System.String keyword, UnityEngine.Material mat, MicroSplatPropData propData, UnityEngine.GUIContent label, UnityEngine.GUIContent label2) (at Assets/Packages/MicroSplat/Core/Scripts/Editor/FeatureDescriptor.cs:289)
    4. JBooth.MicroSplat.MicroSplatBaseFeatures.DrawPerTextureGUI (System.Int32 index, UnityEngine.Material mat, MicroSplatPropData propData) (at Assets/Packages/MicroSplat/Core/Scripts/Editor/MicroSplatBaseFeatures.cs:739)
    5. MicroSplatShaderGUI.OnGUI (UnityEditor.MaterialEditor materialEditor, UnityEditor.MaterialProperty[] props) (at Assets/Packages/MicroSplat/Core/Scripts/Editor/MicroSplatShaderGUI.cs:190)
    6. UnityEditor.MaterialEditor.PropertiesGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1606)
    7. UnityEditor.MaterialEditor.OnInspectorGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:393)
    8. UnityEditor.Experimental.TerrainAPI.PaintTextureTool.DrawFoldoutEditor (UnityEditor.Editor editor, System.Int32 controlId, System.Boolean& visible) (at C:/buildslave/unity/build/Modules/TerrainEditor/PaintTools/PaintTextureTool.cs:87)
    9. UnityEditor.Experimental.TerrainAPI.PaintTextureTool.OnInspectorGUI (UnityEngine.Terrain terrain, UnityEditor.Experimental.TerrainAPI.IOnInspectorGUI editContext) (at C:/buildslave/unity/build/Modules/TerrainEditor/PaintTools/PaintTextureTool.cs:115)
    10. UnityEditor.TerrainInspector.ShowPaint () (at C:/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:1549)
    11. UnityEditor.TerrainInspector.OnInspectorGUI () (at C:/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:1950)
    12. DecoratorEditor.OnInspectorGUI () (at Assets/Packages/AwesomeTechnologies/VegetationStudioPro/Editor/Common/Editor/Utils/DecoratorEditor.cs:144)
    13. ExtendedTerrainEditor.OnInspectorGUI () (at Assets/Packages/AwesomeTechnologies/VegetationStudioPro/Editor/Common/Editor/ExtendedTerrainEditor.cs:80)
    14. UnityEditor.InspectorWindow.DoOnInspectorGUI (System.Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, System.Boolean wasVisible, UnityEngine.Rect& contentRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1625)
    15. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    16.  
    and

    Code (csharp):
    1.  
    2. Unexpected top level layout group! Missing GUILayout.EndScrollView/EndVertical/EndHorizontal?
    3. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    4.  
     
  29. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Looks like the propdata got unassigned somehow- open the debug panel and make sure it's set.
     
  30. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    404

    Image1.jpg

    Looks to be set ok. Not sure about the other items.
     
  31. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    And your getting this error when you enable per-texture UVs and adjust the slider?
     
  32. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I was having some problems with blendable objects since upgrading to 2018.3, so I got the latest Microsplat Core and Terrain Blending updates from the Asset Store, and now having new problems. Generating terrain data on one terrain takes over five minutes, as does regenerating the microsplat material does also. In the console (Mac), I can see that Unity is working on the terrainlayers during each process, generating miles and miles of log like pasted below. I wasn't seeing anything like that before updating the MS stuff.

    And the original problem persists: The Blendable Object component says "Terrain shader is not setup for blending" (even though it is, and I've disabled and enabled Blending on the material to try to force it), and so the blendable objects are either black or pink. (Same problem I had a few months ago, but you managed to fix that....) (and FWIW, the blendable shader hasn't been regenerated in weeks at least.)

    Any suggestions?

    thx
    Dave


    Preloading 1 native plugins for Editor in 1.50 ms.
    Updating Assets/09 Terrains/02 Amesthyst Terrain/Amethyst terrain TC2/MicroSplatData/microsplat_later_WQT SoilSand0113_1_seamless_5.terrainlayer - GUID: 322125f05e48d43d5a548fdf8162607a...
    ----- Compute hash for Assets/09 Terrains/02 Amesthyst Terrain/Amethyst terrain TC2/MicroSplatData/microsplat_later_WQT SoilSand0113_1_seamless_5.terrainlayer.
    done. [Time: 6.308871 ms]
    Script Compilation Pipeline Post Process Assets time: 0.000009s
    Assembly Updater Post Process Assets time: 0.000043s
    gstr.c:876: assertion 's2 != NULL' failed
    gstr.c:876: assertion 's2 != NULL' failed
    gstr.c:876: assertion 's2 != NULL' failed
    gstr.c:876: assertion 's2 != NULL' failed
    gstr.c:876: assertion 's2 != NULL' failed
    gstr.c:876: assertion 's2 != NULL' failed
    gstr.c:876: assertion 's2 != NULL' failed
    gstr.c:876: assertion 's2 != NULL' failed
    gstr.c:876: assertion 's2 != NULL' failed
    gstr.c:876: assertion 's2 != NULL' failed
    gstr.c:876: assertion 's2 != NULL' failed
    gstr.c:876: assertion 's2 != NULL' failed
    Refreshing native plugins compatible for Editor in 4.44 ms, found 3 plugins.
    Preloading 1 native plugins for Editor in 1.60 ms.
    Updating Assets/09 Terrains/02 Amesthyst Terrain/Amethyst terrain TC2/MicroSplatData/microsplat_later_GRS_sq_003_paler_6.terrainlayer - GUID: a2adfc1e8c40b4010938dac371958f5a...
    ----- Compute hash for Assets/09 Terrains/02 Amesthyst Terrain/Amethyst terrain TC2/MicroSplatData/microsplat_later_GRS_sq_003_paler_6.terrainlayer.
    done. [Time: 4.933424 ms]

    etc.
     
  33. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I’ll see if I can repro it..
     
  34. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    @jbooth I've had the same in my console.
     
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Ok, played around with terrain blending in 2018.3 today and didn't run into any of these issues- can someone send me a repro case?
     
  36. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    164
    Is it compatible with open gl es 3.0 for mobile ? Android ? Thank you
     
  37. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yes
     
    mukki014 likes this.
  38. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    164
    Thank you for a quick reply.
     
  39. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I have a repro for the blending issue, but not for the slow regeneration issue, just can't get that to happen in a simpler project yet. Will try some more. I'll send you link to blend repro via Discord after uploading.
     
    jbooth likes this.
  40. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The BlendMat has become unassigned in your terrain (under the debug section). Not sure why this is, but I noticed the entire MicroSplat folder structure has been re-arranged in the project for some reason. Anyway, assigning the blend mat again fixes your issue.

    But this doesn't look like the issues others have reported about terrain blending not actually working correctly in 2018.3, which I have not been able to repro.
     
  41. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Ah, right. Thanks! Dunno how that went missing, but I've added it back, and that mostly fixes it. Some meshes still show the "no terrain below" error, can't figure out why, but I can duplicate one that works and replace those with it.

    We've reorganized the folder structure in order to use Assembly Definition files.
     
  42. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    Does anybody know if there's a way to use Map Magic to control more aspects of Microsplat, for example to define where the Terrain will be Wet/Lava.

    I tried with the Custom Shader and had somewhat success, however I can not even control the 4 Textures, only 2. I'm guessing the Custom Shader Node won't work since it doesn't have the correct output format for Microsplat?

    Thanks for any pointers.

    upload_2019-1-8_17-58-59.png
     
    Last edited: Jan 9, 2019
  43. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    560
    I'm wondering. If I buy MicroSplat Terrain Blending. Will this work on Unity terrain also ?
     
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MicroSplat works on Unity Terrains, but it's not for Unity's included terrain shader- you use the MicroSplat shader instead.
     
  45. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    560
    So, If my terrain doesn't have shader "Stander Terrain", will "MicroSplat Terrain Blending" will work on it and blend with other meshs " rocks" ?
     
  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The blending feature blends objects with the underlying Unity Terrain (using the MicroSplat shader), not with other meshes.
     
    Quast likes this.
  47. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    560
    Good. I understand you.
    Thank you.
     
  48. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I'm still having a weird problem with a couple meshes not working with mesh blending. Most of my meshes work great, but two just refuse -- the MS Blendable Object component says: "Terrain not detected below object, nothing to blend with."

    So now I've tried it with some Unity cubes and spheres...and *those* give the same error! Even though right at the same location, one of my meshes blends beautifully.

    And they throw this error. Any idea what could be the problem?

    thanks!
    Dave

    NullReferenceException: Object reference not set to an instance of an object
    MicroSplatBlendableObjectEditor.OnInspectorGUI () (at Assets/MicroSplat/Editor/MicroSplatBlendableObjectEditor.cs:46)
    UnityEditor.InspectorWindow.DoOnInspectorGUI (System.Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, System.Boolean wasVisible, UnityEngine.Rect& contentRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1625)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Screen Shot 2019-01-10 at 3.13.30 PM.png Screen Shot 2019-01-10 at 3.13.21 PM.png
     
  49. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461

    Ah, so basically there needs to be another null check in there to prevent the null ref from throwing, but it's already failed at that point because it cannot find the terrain below it. If you raise the object up, does it start to work?
     
  50. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Nope, that doesn't help. I've moved the cube all around, above, below, interesting several terrains in the setup, no help.
     
Thread Status:
Not open for further replies.