Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[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. m506

    m506

    Joined:
    Dec 21, 2015
    Posts:
    93
    Hi jbooth,

    Unfortunately providing a repro is not something easy for me due to the size of my project, so I will wait for more updates before committing to that, since I can live with 3.8.7 for the moment. I will get back to you at some point with my feedback on this if the issue persisted.

    As you suggested, I recently acquired the decal asset and it has indeed fulfilled my expectations. It is actually much better than I expected because I can modify tessellation with it, which adds a lot more details than just a flat picture. However, I was not being able to see any decals until I disabled and re-enabled them, so after I patched the "MicroSplatDecal.cs" with the following code I fixed the issue, so you might want to double check:

    Code (CSharp):
    1. private void InitDecal()
    2.     {
    3.         oldMtx = transform.localToWorldMatrix;
    4.  
    5.         if (targetObject != null)
    6.         {
    7.     #if UNITY_EDITOR
    8.             registeredAsDynamic =
    9.     #endif
    10.         targetObject.RegisterDecal(this);
    11.         }
    12.     }
    13.  
    14.     private void Start()
    15.     {
    16.         InitDecal();
    17.     }
    18.  
    19.     private void OnEnable()
    20.     {
    21.         InitDecal();
    22.     }
    Thanks
     
  2. Tony347

    Tony347

    Joined:
    Mar 10, 2019
    Posts:
    19
    Hey,

    Does anybody know if MicroSplat terrain blending tool work in any way with the grass on the terrain? I want to blend the grass texture with the texture of the ground underneath it.

    Thanks.
     
  3. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    Question about MicroSplat. I've tried the free module to get a feel and it seems with 2-3 other modules I'll get all I need (anti-tiling, wetness, etc.)

    However, I noticed that MicroSplat generates a 120 MB texture for my terrain. I have more than a dozen levels in my game, each with its own terrain, and I'm worried I'll blow up the game's size by over a GB. Is that how MicroSplat is supposed to work, basically generate a huge terrain texture, or did I play with some settings I shouldn't have touched?
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MicroSplat generates a texture array for all of your terrain textures in a tightly packed format. The pixel size of that array is set on the config, and should be the same or less memory than all your separate textures would have been combined anyway. MicroSplat can automatically reduce your source textures size so you don't duplicate memory as well (it doesn't do this by default in case you are using them elsewhere). Multiple terrains can share the same array data. See the docs or faq for info on working with multiple terrains.
     
  5. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    Now THAT would help a lot. Most of my levels could be done with 2, maybe 3 shared texture arrays. Brilliant.

    One question before I go to experiment more: For an RTS-style game (i.e. camera mostly flying at least 10m above ground, often higher), would you recommend the Anti-Tiling plugin or the Texture Clusters as an anti-tiling feature?
     
  6. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    That's more about performance- if you can afford stochastic or texture clusters, it's always the best looking option.
     
    Tom163 likes this.
  7. Cyron_

    Cyron_

    Joined:
    Feb 16, 2017
    Posts:
    2
    Any plans on adding support for later URP versions such as URP 12?
     
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    yes, as I've answered hundreds of times in the past, I generally release adapters around the time that SRPs go into LTS release cycles, because they break way too much and take too much work to upkeep before that.
     
    Willbkool_FPCS likes this.
  9. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    How do I re-use a microsplat layer? There seems to be no way to assign it in the config.

    I have a bunch of scenes each with their own terrain object, but I want to re-use the same textures over a set of them. It doesn't make sense to me that each would need its own layer as they would be identical. Do I have to re-use the entire microsplat material and config? Or can I somehow assign a layer, instead of textures, in the config?
     
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MicroSplat doesn't use terrain layers, really - they are a vestige of Unity's system which aren't extensible.

    You can have completely different MicroSplat materials use the same textures (just assign the same texture arrays), or have multiple terrains share the entire setup (assign the same material), either will work. As the documentation notes, once you switch to MicroSplat you don't use terrain layers anymore.
     
  11. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    Yes. I didn't mean terrain layers, but the microsplat_layer_* files that MicroSplat generates when I assign textures to the Config.

    So I get the thing to do is to re-use the entire config among terrains, Config, MicroSplat Material and all.
     
  12. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    You only use the Unity terrain system to paint, right?
     
  13. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    To paint terrains textures, yes, though MS contains other painters for effects or meshes.
     
    PolyMad likes this.
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You don't have to use the whole thing. For instance, most of the MicroSplat samples use the texture arrays from the core module, so you're not downloading the same textures over and over. The only ones that don't are ones that needed unique textures or terrain to show off the features.
     
  15. Ratslayer

    Ratslayer

    Joined:
    Feb 6, 2014
    Posts:
    37
    Hey. I upgraded to the new Unity Tech Stream, 2021.2.1f1. Tried out deferred rendering but microsplat does not seem to work (terrain just disappears). Am I doing something wrong or is deferred rendering not supported yet?
     
  16. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    the URP adapter lists which versions of URP it supports.
     
  17. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    I'm using deferred rendering just fine, with 2021.2.0b16 - but I have noticed that the terrain sometimes goes pink or disappears. I toggle it off (the whole terrain object, set to inactive in the inspector) and on again and there it is with everything fine. Something that needs to init, I suppose.
     
  18. scottylewin

    scottylewin

    Joined:
    Apr 25, 2014
    Posts:
    4
    Hi Jason,
    I’ve taking a deep dive into your products and am loving the results thus far. Great job!!
    Just a quick one.
    Is it possible to link or instance the terrain Matt with the mesh workflow material?
    I’m trying to match the mesh with the terrain and would like a way to link all material properties between both materials.
    Thanks
     
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    There's not really any kind of automatic way to do that.
     
  20. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    108
    Looks like there is something wrong when I turn on volumetrics light on Terrain Blending.
    Please check this out:
    QQ截图20211115113905.jpg QQ截图20211115113855.jpg

    The second picture got some shadow when volumetrics turn on.

    Could you please help?
     
  21. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Which volumetric lighting system, render pipeline, unity version, etc, etc?
     
  22. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    The more I play with this system the more I'm impressed. Jason you are a courageous man, the bug hunt must be horrible at times in such a complex system. I have no Idea how you manage it.

    Mandatory praises aside ;P I wanted your feedback on something. When changing a texture on my project it takes a long time to "update" the changes. Would it be possible to update a single layer or even texture at a time instead of the entire thing? Seems like it could save a lot of time.

    At the moment, It takes over a minute. Not a big deal, but we haven't started painting our terrain yet. I was just testing different normal maps on a 4 layer terrain (with all the texture maps filled in) and I fear the moment we will start adding layers for real.

    We do use 4k textures, we could reduce the quality but we want them large.

    This is the cpu usage while updating, seems to only really load 4 cores. Not sure you have any control over it.
    upload_2021-11-16_14-7-45.png
     
  23. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Doing individual texture updates would be a massive complexity increase in the texture packing system, as well as potentially introduce all kinds of statefull bugs where things get out of sync and cause support requests, so I have no plans to do that.

    With that said, Unity has speed up texture compression/import times considerably in newer versions of unity, and may have moved some of it to the GPU, though I'm not sure about that. Note that formats such as ATSC and ETC2 are much slower to compress than DXT/BCN. Also consider reducing your texture resolution while iterating and bumping them up either in the build step or when you want to see them larger.
     
  24. homemacai

    homemacai

    Joined:
    Jul 22, 2020
    Posts:
    74
    Hello Jason, so again with the MeshTerarin feature, I am using low poly mesh terrains for distant areas. They are loaded from the resources folder as prefabs, it works while in play mode, but in the build the mesh terrains are pink. Normal terrains with Microsplat work normally.
    I tried putting the shaders on Alwaysincluded and the Resources folder, but no luck.
    Is there an extra step for doing this? thanks
     
    Last edited: Nov 17, 2021
  25. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Excellent suggestions. Thank you!
     
  26. chris73it

    chris73it

    Joined:
    Oct 15, 2013
    Posts:
    21
    New user here. A gentle suggestion: add this explanation to the description of "MicroSplat - URP 2020 Support" on the asset store. Frankly, I imagined that you might only support LTS releases, but - being super new to the MicroSplat ecosystem - I wasn't sure and came here to ask that exact question.
     
  27. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    This question is answered in the FAQ, along with the hundreds of other questions people might suggest I put on the asset store description, which has limited space and isn't really designed to be a FAQ. And in my experience, it really doesn't matter if I littered it in blinking flashing text all over the asset description, I'd still get the question, which is why the FAQ is half things that could be answered by reading the asset description or included documentation.
     
  28. Taratus

    Taratus

    Joined:
    Sep 8, 2020
    Posts:
    8
    Hello,
    I am using the MicroSplat Vertex Painting Mesh Workflow and my new self modeled mesh has distortion on the vertical polygons. On an other mesh there is no such distortion although using the same microsplat material. How to get the material distortionfree? UV coordinates should be not important as I understood. Has this something to do with the normals of the mesh?
     
  29. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Don't stretch your UVs? By default, it's going to use whatever UVs your mesh has, unless you enable triplanar with the triplanar module.
     
  30. Taratus

    Taratus

    Joined:
    Sep 8, 2020
    Posts:
    8
    I just understood what went wrong. By modeling the mesh itself gets distorted in its transform. In blender I applied all transforms and now the material also lost it's distortion. Thanks ^^
     
  31. RvtL

    RvtL

    Joined:
    Oct 20, 2018
    Posts:
    11
    Hi, When I enable SSS while also having the day-night cycle enabled (OverCloud) the bright part of the terrain flickers. I think I've narrowed it down to the reflection probe refreshing every frame. Is this something fixable or is that combination not possible?
     
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    microSplat doesn’t render reflection probes. Most likely it’s to do with whatever is rendering them.
     
  33. RvtL

    RvtL

    Joined:
    Oct 20, 2018
    Posts:
    11
    Good to know, that gives me an idea in what direction I should be looking. Thanks!
     
  34. Quittern

    Quittern

    Joined:
    Oct 9, 2018
    Posts:
    19
    Hi, I'm testing out the terrain to mesh tool, but it doesn't keep the trees and grass in the conversion. Would I have to use another tool to paint trees on the mesh-version of my terrain to use this?
     
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yes, it only handles the terrain itself. You can use VSP on meshes, or what some people do is keep the original terrain and turn off it's draw so it's only used for trees (especially if you have the terrain loaded for close ups anyway)
     
  36. Quittern

    Quittern

    Joined:
    Oct 9, 2018
    Posts:
    19
    Alright, thanks for the quick reply!
     
  37. SDC2X

    SDC2X

    Joined:
    Apr 4, 2017
    Posts:
    8
    Heya all, MicroSplat have discord channel ? ty..
     
  38. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It's listed on every asset store description for every MicroSplat asset, as well as in the documentation.
     
    dsilverthorn likes this.
  39. Quittern

    Quittern

    Joined:
    Oct 9, 2018
    Posts:
    19
    I'm having the same problem that the person you replied to a while back here. Just made a build for android and getting pink terrains, and the terrain blend doesn't work on the rocks I put it on (obviously, I guess it couldn't work when the terrain doesn't). My test phone is newer though, from this year.

    I don't really understand where you can check for texture array support? Is this a setting in Unity, or something only certain phones can do?
     
  40. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Anything supporting OpenGLES3.0 or greater should support texture arrays. Usually a pink shader means a compile error, so see if there's anything in the build logs.
     
  41. m506

    m506

    Joined:
    Dec 21, 2015
    Posts:
    93
    HI, I can confirm this issue disappeared as of the latest version. Thanks

     
  42. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    I have an issue that's not a game breaker, but if anyone knows why it happens it will help my workflow.

    I use microsplat with MapMAgic terrain. As long as I leave one terrain generated when I save teh scene, the terrains will load on an iPad with all the materials as expected.

    But if I save the scene without any terrain generated, then on iPad teh terrain will be black.

    I am guessing that when I generate and leave a terrain in the scene its generating the Microsplat textures or somehow adding them to the scene and compiled project?

    If so is there a way or something I need to do that could "preload" or forcibly include these micros plat terrain materials into my builds?
     
  43. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    we’ve seen things like this when using asset bundles; particularly with draw instanced on my n Android. However, if this is happening on iOS I suspect map magic is not including some needed data; for instance, it doesn’t set the keyword file on terrains which is needed for some features.
     
    protopop likes this.
  44. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    Thank you. This helps a bit. A few things, not expecting a solution straight out but including this incase anyone sees anything and as I look into it. Like I said though its not a breaker because I can keep including a microsplat terrain in my build and that solves everything.

    You mentioned draw instance. It works if I include a microsplat terrain.

    If I dont include a terrain I tested it and the terrain becomes invisible with draw instance turned on, and visible with 1 micro-last texture if I turn int off.

    In the Xcode notes I think the trouble starts here:

    WARNING: Shader Unsupported: 'Hidden/Nature/Terrain/Utilities' - All passes removed
    WARNING: Shader Did you use #pragma only_renderers and omit this platform?
    Shader 'MicroSplat/Terrain 0,0': dependency 'BaseMapGenShader' shader '/Terrain 0,0_Base808519755' not found

    I guess when I include a terrain it somehow makes sure this dependency the basemapgenshader is included? It gives me a starting point to look into it.

    These three messages dont appear if I include a terrain so I will keep looking into it. If anyone has any ideas that could help please let me know, even if they seem unrelated. sometimes an outside perspective helps:)
     
  45. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461

    Well, MicroSplat doesn't use a basemapgenshader, so that error shouldn't matter much. That said, Unity just got back to us on the addressable issues with a "Won't Fix"

    https://issuetracker.unity3d.com/is...ncorrectly-when-terrain-instancing-is-enabled

    So it seems the official solution is to include a terrain in the main build or Unity is just broken.
     
    protopop likes this.
  46. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    Does Hdrp support all the extensions
     
  47. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    faq
     
  48. prg-liulie

    prg-liulie

    Joined:
    Dec 23, 2017
    Posts:
    13
    Mesh Terrain material seams to receive no light in URP in Unity 2020 LTS, please have a check :)
     
  49. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    I bought Trax on the sale and am trying to add it to my game, which is already using the Microsplat Terrain Collection.

    As soon as I add the TraxManager component to a gameObject, the Unity editor just hard crashes. I've reproduced this four or five times now, adding it to an empty gameObject, adding it to the Terrain object, adding it to a scene with Microspalt already enabled and without Microsplat - always the same result. I can also reproduce it when the scene doesn't even have a terrain.

    I'm doing this in a test scene which is essentially empty (camera, light, terrain and one building for scale).

    Unity version is 2021.2.4f1 on MacOS, using the built-in render pipeline.

    The last message in the editor log is:

    Code (csharp):
    1. [./Runtime/Graphics/RenderTexture.cpp line 521]
    2. RenderTexture.Create failed: colorFormat & depthStencilFormat cannot both be none.
    3. UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
    4. JBooth.MicroSplat.TraxManager:LateUpdate () (at Packages/com.jbooth.microsplat.trax/Scripts/TraxManager.cs:286)
    5.  

    ---

    Update:

    I can reproduce this on a completely new project. Create new project, import just Microsplat Core (version 3.9.4) and Trax (version 3.9.1), add empty game object to default scene, add Trax Manager component - hard crash, same log message as above.
     
    Last edited: Nov 28, 2021
    Whatever560 likes this.
  50. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461

    Give it a try on an LTS version and send the repro to Unity- it doesn't crash on 2020.3LTS, so this must be some kind of regression in the tech release.. The warning you see is a warning, fixed in a newer release, but that shouldn't have any real effect except stopping that warning from being printed out.
     
    protopop likes this.
Thread Status:
Not open for further replies.