Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

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

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

  1. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    If you are using assembly definitions in your code, you have to add a reference to MicroSplat's asmdef's.
     
  2. byCDW

    byCDW

    Joined:
    Jan 31, 2016
    Posts:
    14
    So today I updated MicroSplat, Tesselation and Parallax, Terrain Holes,Mesh Workflow and HDRP support to v. 3.8.0 hoping this might fix my previous issue with MWF. Now I get this compilation error:

    Assets\MicroSplat\Core\Scripts\TextureArrayConfig.cs(288,17): error CS0246: The type or namespace name 'Substance' could not be found (are you missing a using directive or an assembly reference?)

    Any idea how to fix this?

    Thank you
     
  3. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    132
    The asset no longer works. clean install of unity 2020.3.8f1 LTS I'm getting this error message,
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.Scripting.ScriptCompilation.Utility.FastStartsWith (System.String str, System.String prefix, System.String prefixLowercase) (at <015079d9a4ea4f97b4381e694d2310c1>:0)
    3. UnityEditor.Scripting.ScriptCompilation.GUIDReference.IsGUIDReference (System.String reference) (at <015079d9a4ea4f97b4381e694d2310c1>:0)
    4. UnityEditor.Scripting.ScriptCompilation.LoadingAssemblyDefinition.SetAllCustomScriptAssemblyReferenceJsonsContents (System.String[] paths, System.String[] contents) (at <015079d9a4ea4f97b4381e694d2310c1>:0)
    5. UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:SetAllCustomScriptAssemblyReferenceJsons(String[], String[])
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    What versions of Unity are you on? In the latest patch releases, Unity removed an enum from an API, and this has caused issues with some people in discord. If you search the core code for SelectionMode.OnlyUserModifiable and replace it with SelectionMode.Editable, then things should compile again.
     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    Ok, I just figured this one out- Something is wrong with the terrain collection when you download it as a single package. If you delete the Texture Clusters module and install it from the single package version, it will compile fine. Luckily I recently added upgrades so that every person who owns the terrain collection also owns the individual modules via a free upgrade, so if you do not see them in the package manager you can go to the store and add them for free.
     
    protopop and chrisabranch like this.
  6. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    Ok, so package-apocolypse fixes:

    - If you are a very new version of Unity 2020.3LTS, an enum was removed and must be removed from the terrain painter. Replace SelectionMode.OnlyUserModifiable with SelectionMode.Editable in TerrainPainterWindow (line 48)
    - If you are installing from the Terrain Collection, for an unknown reason the texture clusters module will cause a compile error. I suspect the file on the store is corrupted. However, owning the terrain collection now gives you the rights to the individual modules as well. So if you remove it and install it from the single asset on the store instead of the terrain collection, it will compile fine.
    - If you are using substance, you have to add select the assembly definition files in Core/Scripts/Jbooth.MicroSplat.Core and Core/Scripts/Editor/JBooth.MicroSplat.Core Editor and add the substance game dll as a reference.

    A fix for these should be available once approved by the asset store, likely on monday.
     
    Squize, protopop, byCDW and 1 other person like this.
  7. Foulcloud

    Foulcloud

    Joined:
    Mar 23, 2014
    Posts:
    14
    Please forgive but could you please elaborate on "add a reference to MicroSplat's asmdef's".
     
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    So assuming your not having one of the problems described above and your trying to write code that interacts with MicroSplat, and you have your code in it's own assembly, then you have to add a reference to MicroSplat's core or editor code from your assembly definition file. (Click on you asmdef file and go to assembly definition references and add one, select the microsplat core assembly). However, from your message I can't tell if this is what your trying to do or if your just running into the issues described above.
     
  9. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    600
    Has anyone else experienced Substance integration issues with Unity 2020.3.8f1?

    Failed to extract Substance.Editor.SubstanceImporter class of base type UnityEditor.Experimental.AssetImporters.ScriptedImporter when inspecting Assets/Allegorithmic/Plugins/Substance/Substance Engine/Editor/Substance.Editor.dll
    UnityEditor.AssemblyHelper:ExtractAllClassesThatAreUserExtendedScripts (string,string[]&,string[]&,string[]&)

    This leads to Microsplat failing to compile when using the Substance namespace. Tried it on a fresh project. I just need confirmation that it is a known issue and Allegorithmic aka Adobe is responsible.
     
  10. homemacai

    homemacai

    Joined:
    Jul 22, 2020
    Posts:
    21
    Hello, got it updated and everything working without any errors.
    Except Digger, it says i am missing the assembly references, tried to find in Digger folder the asmdf file to insert Microsplat assembly references. The only one there, is in the Native Collections folder, but adding the references in that file does not make the errors go away, all the files are imported with the digger integration package also imported.
    Any advice ?

    The errors:
    Code (CSharp):
    1. Assets\Digger\Sources\Digger\EditorUtils.cs(26,41): error CS0246: The type or namespace name 'MicroSplatTerrain' could not be found (are you missing a using directive or an assembly reference?)
    2.  
    3. Assets\Digger\Sources\Digger\MicroSplatSync.cs(66,58): error CS0246: The type or namespace name 'MicroSplatTerrain' could not be found (are you missing a using directive or an assembly reference?)
     
  11. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    not sure, I let everyone know about the asmdef update a few weeks ago. I’ll ping them all again and hopefully patches can be made relatively quickly
     
    homemacai likes this.
  12. kevhayes

    kevhayes

    Joined:
    Nov 8, 2015
    Posts:
    6
    I'm trying to get Microsplat procedural texturing to work in conjunction with Vegetation Studio Pro biome masks and their respective splat-maps. The splat-map that VSP generates always seems to completely override the output of the Microsplat procedural texturing even though I have "combine with splat" enabled in the Microsplat shader.
    What I'm trying to achieve is a base established by procedural texturing that blends nicely with masked biomes that have their own associated textures. Is this possible? Can anyone point me in the right direction for reference? Thanks!
     
  13. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    In combine with splat mode, one texture effectively means "This is where procedural texturing is used", and any other means "use this texture". So you'd need to get VSP to paint the procedural splat index texture where ever you want the MicroSplat procedural texturing to happen.
     
  14. kevhayes

    kevhayes

    Joined:
    Nov 8, 2015
    Posts:
    6
    Ah I think I understand now. What I'm looking for though is kind of the opposite I think - I want procedural texturing to be everywhere apart from within the area that the biome mask generates...
    I have a large terrain that has a nice layer setup using Microsplat procedural texturing creating my base layer of grass, stones, rock, etc, and I want to add a VSP biome in a specific area of the map to place one or more forests. I have the biome placing trees and ideally want the ground under the trees to be unique to the biome which means I have to use a splat-map in that area. I can get the splat-map to work but then it just seems to always nuke my procedural setup, or I can get the procedural texture layers to work correctly but then the biome splat texturing is lost. A visual breakdown of how to set this up would be really useful!
     
  15. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    How to setup VSP to do something is not a MicroSplat support issue, but as long as VSP sets every else to your splat index texture then MicroSplat's procedural texturing would show through.
     
  16. kevhayes

    kevhayes

    Joined:
    Nov 8, 2015
    Posts:
    6
    I completely appreciate that. I'm just simply trying to figure out how the two systems integrate with one another.
     
  17. Sisay

    Sisay

    Joined:
    Dec 6, 2012
    Posts:
    23
    I think I found a problem.
    Unity 2021.3.3, HDRP when another scene loads a terrain scene, the view range is about 50 units.
    If a scene is loaded from the terrain as the main level (and not read by another scene), the view range of the structures is for the whole area.
    I noticed that the tessellation setting max distance always overrides the base map distance terrain setting when save. Is this a bug?
    https://imgur.com/NGQ5z8X
    https://imgur.com/JQxz9IS
     

    Attached Files:

    Last edited: May 24, 2021
  18. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    No, it's by design- the base map shader is used to turn off tessellation in the distance.
     
  19. Sisay

    Sisay

    Joined:
    Dec 6, 2012
    Posts:
    23
    ok, but this distance also turn off all materials except id1

    this is tesselation max distanse 45(when i save scene, microsplat automatic override base map distance terrain)
    https://imgur.com/a/Qx34dFL
    when tesselation is 500
    https://imgur.com/undefined
     
  20. Foulcloud

    Foulcloud

    Joined:
    Mar 23, 2014
    Posts:
    14
    I am trying to access from plain script in assets folder. Old Microsplat version cleared out and latest installed to Packages. This worked before: Terrain2D terrainEffectsTexture = terrainGO.GetComponent<MicroSplatTerrain>().streamTexture; Now getting error: Type or namespace name "MicroSplatTerrrain" could not be found. I am not able to add any usings like JBooth or MicroSplat. I can see Micrssplat and modules folders in Packages.
     
  21. jeanpaul84

    jeanpaul84

    Joined:
    Jan 23, 2017
    Posts:
    2
    I'm getting the same issue, and our scripts also don't use asmdef.

    EDIT - It's because "Auto Referenced" is false on the MicroSplat asmdef files.
     
    Last edited: May 25, 2021
    jbooth likes this.
  22. Foulcloud

    Foulcloud

    Joined:
    Mar 23, 2014
    Posts:
    14
    Same fix found here.
     
  23. hepphep

    hepphep

    Joined:
    Feb 1, 2013
    Posts:
    22
    Hi,

    I'm running into some issues when trying to use existing MicroSplat material for new scene in new terrain. This used to work for me in the past, but it go broken in some update (not sure in which, as there was a while that I didn't create new scenes but was instead working on the existing ones).

    In my case, I create a new scene and new terrain. Then I have my own component where I have setup microsplat in place with following code:


    Code (CSharp):
    1.  
    2. var microsplat = GetComponent<MicroSplatTerrain>();
    3. if (microsplat == null)
    4. {
    5.       _microsplatTerrain = gameObject.AddComponent<MicroSplatTerrain>();
    6.       _microsplatTerrain.templateMaterial = _globalTerrainConfiguration.MicroSplatTemplateMaterial;
    7.       _microsplatTerrain.Sync();
    8. }
    However, now that I use the same way, I run into IndexOutOfRangeException in MicroSplatTerrain.cs:207
    In practice it is in the code line
    Code (CSharp):
    1.  
    2. if (controls == null || controls[0] == null)
    3.  
    So, apparently there is something that changed on splat map texture generation that I just don't get that likely changed at some point.

    Any suggestions what I'm doing wrong here and should be changed for newer versions?

    Unity version: 2020.3.4 (HDRP)
    Microsplat version: 3.793

    Microsplat add-ons in project:
    Anti-tiling module 3.8.0 (installed but not currently used)
    Dynamic Snow 3.77
    HDRP 2019 support 3.611
    Runtime Procedural Texturing 3.7 (installed but not currently used)
    Terrain Blending 3.76
    Tesselation and Parallax 3.77
    Texture Clusters 3.7
    Wind and Glitter 3.74 (installed but not currently used)

    As a sidenote, while looking the things I also noticed that there is also HDRP 2020 available now and I started to wonder if it something I should move to now as well?
     
  24. Pollawat

    Pollawat

    Joined:
    Aug 27, 2016
    Posts:
    179
    Hello sir. usually, I create a game world with 3D objects, not with terrain, but your tools look so interesting.

    - Can I use a custom shader such as "toon shade" or some kind of shader graph to paint on the terrain with your tool?
    - Do this shade work well with a mobile device? (using URP to create)

    Thank you.
     
  25. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    First, you can't mix 3.8 and 3.7 modules. You'd need to be entirely on a 3.8 line or the 3.7 line, otherwise I don't think things will even compile.

    Unity creates the actual splat maps for a terrain, not MicroSplat, so I suspect what is happening is that when you create your terrain it doesn't have any splat maps, and then MicroSplat can't read the splat maps from it. Perhaps Unity changed when/where they create them in some way at some point.
     
  26. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    No, it's not a painting system, it's a shader system.
     
  27. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    137
    Hello, I am having trouble with this issue as well:

    Assets\MicroSplat\Core\Scripts\MicroSplatObject.cs(41,14): error CS0246: The type or namespace name 'MicroSplatProceduralTextureConfig' could not be found (are you missing a using directive or an assembly reference?)

    These are my defines, can you please clarify which ones I can safely remove?
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    if you are downloading the 3.8 version you need to delete the version of MicroSplat in the assets folder; it’s installed into packages now.
     
  29. Victoralm

    Victoralm

    Joined:
    Dec 31, 2015
    Posts:
    29
    Hi all!
    Is there a step by step to use the packages with URP (Unity 2020.3.10), please!?
    For now, I just got my terrain all pink...

    PS:
    I have the Microsplat Terrain Collection asset. Do I need/have to buy the Microsplat URP !?
     
    Last edited: May 30, 2021
  30. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    Yes, you need to have the URP adapter for the correct version of the URP to run in URP.
     
  31. drbatuira

    drbatuira

    Joined:
    May 4, 2020
    Posts:
    7
    Hi, I bought all the packages, now I decided to go to URP.
    Will there be a URP 2021 package or can I buy 2020 that will be valid for 2021?
    If you're going to have a 2021, would there be an estimated date?
    (I'm interested in traxx, the others, whatever)
     
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    SRP adapters ship shortly after LTS versions of Unity ship, as I only support LTS versions officially.
     
  33. PiAnkh

    PiAnkh

    Joined:
    Apr 20, 2013
    Posts:
    126
    Hi Jason,

    I upgraded a project to 2019.4.24f1 and have also upgrade microSplat to the latest version.
    All is working as before except that changing the per texture properties no longer has any effect.
    Changing any other property on the microSplat material does have an effect. It is just the per texture properties seem to have no effect. I have recompiler the shader and am getting no errors.
    Anything obvious that you can think of?

    Thanks!!!!
     
  34. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    This usually happens when something has been renamed in the MicroSplatData directory, since the material looks up the propData based on material name. Most likely you have two of them in your data directory, and the one assigned to the terrain is not the one the material finds.
     
    PiAnkh likes this.
  35. PiAnkh

    PiAnkh

    Joined:
    Apr 20, 2013
    Posts:
    126
    That's it. THANKS!!!!!!!!!!!
     
  36. EveFreeman

    EveFreeman

    Joined:
    Jul 15, 2013
    Posts:
    3
    Hi Jason,

    I bought MicroSplat, Procedural Texturing, Mesh Terrain Blending, Decals and Support for URP yesterday, and I started encountering many weird bugs when creating terrains (I am using unity version 2020.2.7f1 URP Render).
    Reading the answers here I realized its always related to new unity or URP versions braking everything.

    So instead of asking you for help fixing this particular problem, I want to go the other way around.
    1_ Should I be using URP or the build in system? (I know the differences but at this point I don't care, I only care for Microsplat stability)
    2_ What is the most stable unity version that works with MicroSplat based on you previous answer?

    Thanks again, your work on this is amazing.
     
  37. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    2019,4LTS with Built in. That said, I believe unify has finally fixed all the bugs in 2020.3LTS with terrains, and URP should work fine there (though in general Built In is always going to be more stable than any SRP because if the fragile way SRPs are made).
     
  38. EveFreeman

    EveFreeman

    Joined:
    Jul 15, 2013
    Posts:
    3
    Excelent, 2019,4LTS hasn't given me a single error so far, I have also bought the triplanar package to improve the blending as you recommended in the tutorial video and it works fantastic, and all this is exactly what I wanted.

    With that said, I have found that a lot of files are being created in the MicroSplatData folder, and i'm starting to realize that the creation of multiple terrains and scenes is going to generate a huge volume MicroSplat Files, that I will need to sort through when trying to change anything in the future.

    I think I have read in some previous response that changing the name of those files was a big no-no.
    Is moving the files also a problem, can I move them as soon as they are created?
    What kind of File organization do you recommend when using MicroSplat?
     
  39. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    Depends - in most cases, people have one MicroSplatData directory for all of the terrains they have in the scene, then just let MicroSplat manage the files in there. However, if you need each terrain to have different materials/textures, then I recommend having a folder with the terrain data in it, with the MicroSplatData directory inside that. You can move the MicroSplatData directory to wherever you want, but renaming things inside of it can cause issues if you don't know what your doing.
     
  40. EveFreeman

    EveFreeman

    Joined:
    Jul 15, 2013
    Posts:
    3
    Perfect that did the trick.
    The MicrosplatData folder is created where you have your terrain data, fantastic.

    Thanks man, I really appreciate you taking the time to answer me.
     
  41. mohu_mohu

    mohu_mohu

    Joined:
    Jun 4, 2021
    Posts:
    5
    Hello,

    Could you enable UniversalFragmentBlinnPhong (_SIMPLELIT) and Unlit in Microsplat URP?
    SimleLit saves at least 2ms in my mid range mobile. That would be great.

    Thanks.
     
  42. fusion242

    fusion242

    Joined:
    May 16, 2014
    Posts:
    12
    Hi. Small thing I found while weight balancing splat maps using the MicroSplat Weight Limiter;
    In the file MicroSplatTerrainEditor_WeightLimiting.cs in the function WeightLimitTerrain [line 77 on my version] is the buffer allocation for reading the splat map layer values before sorting. It is hard coded to 16. I changed to:
    float[] data = new float[l];

    Using the l variable which is the number of alphamaps. I have 32 textures and it was crashing with index overflow.

    Thanks, Ben.
     
    jbooth likes this.
  43. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    Unlit is already there (look in debug mode), Simple Lit will come in the next patch.
     
    mohu_mohu likes this.
  44. 30035172

    30035172

    Joined:
    Jun 25, 2016
    Posts:
    11
    Hello! I am using URP module with Unity 2019.4.16f1 but I receive error when following the instructions (I think):



    I thought Microsplat will generate for me? Or is something else?
     
  45. 30035172

    30035172

    Joined:
    Jun 25, 2016
    Posts:
    11
    The shader recompiled to remove warning but Terrain is still pink =\

    upload_2021-6-8_15-33-8.png
     
  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    Switch the render pipeline on the material to UrP2019.
     
  47. 30035172

    30035172

    Joined:
    Jun 25, 2016
    Posts:
    11
    Hmm do I miss prerequisite maybe? I import both free and URP packages

    upload_2021-6-8_20-23-50.png

     
    Last edited: Jun 8, 2021
  48. 30035172

    30035172

    Joined:
    Jun 25, 2016
    Posts:
    11
    There is no URP2019. I import the assets and receive error (purchased 2)... How to resolve shader error?
     
  49. ivank

    ivank

    Joined:
    Nov 16, 2013
    Posts:
    58
    Hi @jbooth ,just quick question:
    Seriously considering purchase of MicroSplat Mesh Workflow + URP Support (urgently need to paint more than four blending textures to a terrain-like mesh).
    Does the current version work for URP 11 (Uni 2021.1)?

    I am aware it would be unofficial, as your most current release claims to support URP 7...
     
  50. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,901
    there’s the 2020 adapter for URP10, I make no guarantees of comparability with other versions.
     
unityunity