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. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yup, they will work fine.
     
    ftejada likes this.
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461


    New trainer video..
     
    hippocoder, zmaxz, Rowlan and 2 others like this.
  3. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    @jbooth For when Trax in HDRP ??? I imagine Tesselation is needed too?
    The video looks great
     
  4. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    I updated to the latest version
     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Can you provide a repro project? PM me a dropbox link or something so I can look at it?
     
  6. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    I’ll do it in the morning if I can re-create the issue in a empty project
     
  7. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @jbooth!! I think he forgot about me :). For when Trax in HDRP ??? I imagine Tesselation is needed too? Are you working on it or do you even want HDRP to consolidate something else?

    Regards
     
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It'll ship when it's done.. Tessellation is not required for trax.
     
    gavriloP likes this.
  9. TurboHermit

    TurboHermit

    Joined:
    Dec 20, 2011
    Posts:
    40
    I procedurally generate the terrains once in an automated process and add a MicroSplatTerrain component to each, then assign the template material. The template material is the references the same material on each terrain.

    After some searching it seems like an issue with Addressables/Asset Bundles that recompile all used shaders per scene, MicroSplat just happened to be the longest shader to do so it stood out. If anyone else runs into this issue, let me know, maybe by then I might have a solution.
     
  10. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    @jbooth

    Great work! Have you tested your assets with a footstep system? If so, which one(s). I'd like to be able to hear different walking sounds based on the texture.
     
  11. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You can use any of them, it's just standard Unity terrain, so there's nothing special to be done in this regard.
     
  12. PrecisionCats

    PrecisionCats

    Joined:
    Nov 19, 2017
    Posts:
    40
  13. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    I think the Microsplat...Editor>Resources folder is being included in builds. Is it safe to rename it to Resourcesx or something? I think this would prevent it being included and save 3mb or so.
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I had thought Resources folders inside editor folders weren't supposed to be included? It won't be able to find certain things if you change the name.. (though in build it would be fine, obv)

    https://docs.unity3d.com/Manual/SpecialFolders.html

    "Note that if the Resources folder is an Editor subfolder, the Assets in it are loadable from Editor scripts but are stripped from builds."
     
    Last edited: Apr 16, 2020
    protopop likes this.
  15. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    I didn't know that. Im just trying to remove all resources folders to reduce my Unity BuiltIn size on the build. Thanks for the tip and I will leave it as is:)
     
  16. PrivateFox45

    PrivateFox45

    Joined:
    Jun 29, 2018
    Posts:
    5
    just primitive question.. what is the difference between applying Microsplat script on multiple terrains and Microsplat on every single terrain separately? Does it have any performance advanteges?

    Is it also possible edit the quality settings template later (performance/balanced/quality), I mean, add some of your modules to existing Microsplat terrain.
     
  17. CastryGames

    CastryGames

    Joined:
    Oct 1, 2014
    Posts:
    77
    hello I have a question, integrate micro splat in a field and place everything as fast as you can, just using even texture and normal map nothing else, but in a high-end device I was at 30 fps, while unity standard shader was running at more than 60 fps, I don't know if I did something wrong or why this could be, or is its performance like this?
     
  18. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    I haven’t been able to recreate it yet, but if I do I’ll let you know and send the files needed.
     
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Those presets just turn on certain features for you as starting points. You can setup each terrain separately if you want them each to have their own shader and texture sets, but if you want them to share all that data, you can have them all point to the same material or set them up at once so you only generate one shader/material/texture config/etc.
     
    PrivateFox45 likes this.
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The unity standard terrain shader doesn't do height blending or a full PBR workflow, so on some devices (particularly mid/low end Android) and if you only have 4 texture sets on your terrain, it can be faster. However, you can disable a fair bit of that stuff in MicroSplat to get similar performance. On older devices, branch sampling *might* be faster off than on, though on everything I have tested on it's always been a win.
     
  21. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    Thanks for all your hard work on microsplat and answering everyone’s questions. I also appreciate all the technical feedback you give to unity about their roadmap and tech choices. I think you’re a shining example of a great dev.

    My game launched smoothly and microsplat has been a great part of the experience - I thought I’d share the trailer , and I’m looking forward to trying the newer MS modules .

     
  22. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Wow, this is very beautiful. On Steam? If you have any shots I can use for promotion, specifically ones with terrain that shows of MS, I'd love to use them!

    Oh, wow - iOS; that's some amazing quality.
     
    Last edited: Apr 17, 2020
    protopop likes this.
  23. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    I found myself a new toy :D Stochastic Texture Cluster mode is awesome.

    Unity Standard, i. e. texture tiling:

    stochastic off.jpg

    MicroSplat Texture Cluster Mode set to Stochastic, i. e. no more texture tiling

    stochastic on.jpg

    Performance is excellent

    sample.jpg
     
    protopop and camta005 like this.
  24. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    I made a video. Stochastic Texture Cluster sampling is just awesome. So is the Digger integration. Easy to use, very performant:

     
    camta005 likes this.
  25. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    World Creator Standalone PRO + Quadspinner Gaea PRO + Enviro + Microsplat

    Textures from Game Textures....posting screenshots instead of the artstation link -.-, so hopefully this one not deleted XD
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      2.8 MB
      Views:
      463
    • 2.jpg
      2.jpg
      File size:
      2.5 MB
      Views:
      450
    • 3.jpg
      3.jpg
      File size:
      2.4 MB
      Views:
      462
    • 5.jpg
      5.jpg
      File size:
      2.1 MB
      Views:
      460
    • 6.jpg
      6.jpg
      File size:
      2.5 MB
      Views:
      432
  26. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    Wow is this in the MicroSplat - Texture Clusters asset? I can't believed I missed this.

    Im going to pick it up and try it. Looks amazing and thanks for sharing:)
     
  27. knxrb

    knxrb

    Joined:
    Dec 16, 2018
    Posts:
    21
    Hello @jbooth, does MicroSplat work with voxel terrains such as Ultimate Terrains or Voxeland?

    Would one of the modules such as the Mesh ones add support for it?
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Not natively, though it would be possible to get the Vertex Workflow of the mesh module working with them, that’s essentially how the digger integration works, which is a voxel engine internally.
     
    knxrb likes this.
  29. knxrb

    knxrb

    Joined:
    Dec 16, 2018
    Posts:
    21
    That's interesting, thanks! Would that have any limitations for the features that can be used with it?
     
  30. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Same limitations as the Digger integration has- 24 textures and 4 effect channels, or 28 textures in total, no tessellation. And I don't have those pathways built for HDRP yet either. What Digger does is internally store the data in MegaSplat format, essentially packs 2 indexes and a blend weight into each voxel, with a few bits fo the FX channels. This gets unpacked into MicroSplat vertex format when meshes are generated, which stores 4 weights in each color component (first 16 weights in vertex color, the next in UV1.zw).
     
  31. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    There is a bug in MicroSplat HDRP, when lighting layers is enabled in HDRP settings, terrains start flickering. This does not happen with built in terrain shader. Appreciate it if this is fixed, since we need to use lighting layers :)
     
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It's on the list- if you disable Draw Instanced apparently it goes away. Problem is, I can't seem to find anything about lighting layers and shader code documented, or in the shader code, so I'm not exactly sure what has to change. And since the instancing code is nearly a duplicate of what's in the terrain shader, I don't think anything is wrong there.
     
  33. knxrb

    knxrb

    Joined:
    Dec 16, 2018
    Posts:
    21
    Okay, thanks for the info. I think I'll get MicroSplat and the modules and use mesh terrains for the distant views. I'll look into voxel terrains in the future when I'm better with Unity.
     
    olavrv likes this.
  34. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    I understand. I do not know much about lighting layers, except that it a layer system to control which lights effect which objects within certain lighting layers.

    We want to use it for our radar rendertexture camera, so that the terrain is rendered with a certain light which only effects this terrain.
     
  35. sas67uss

    sas67uss

    Joined:
    Feb 8, 2020
    Posts:
    81
  36. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Either use my MeshTerrain module, which converts terrains into meshes with MicroSplat shader support, or the Mesh Workflow module which lets you work with any mesh and MicroSplat. Alternatively I sell a Stochastic Sample Node for the Amplify Shader Editor if you want to roll your own shaders with Stochastic.
     
  37. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
  38. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    Hello, I've been using Microsplat for a while without any problems but recently I've tried making a build and the terrain is invisible. The log returns these errors:


    Code (Boo):
    1.  
    2. Direct3D:
    3.     Version:  Direct3D 11.0 [level 11.1]
    4.     Renderer: NVIDIA GeForce GTX 1070
    5.  
    6. WARNING: Shader Unsupported: 'Hidden/Nature/Terrain/Utilities' - All passes removed
    7. WARNING: Shader Did you use #pragma only_renderers and omit this platform?
    8. ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
    9. WARNING: Shader Unsupported: 'Hidden/Nature/Terrain/Utilities' - Setting to default shader.
    10. Shader 'Hidden/MicroSplat/Terrain_Base-646613864': failed to set fallback shader 'Nature/Terrain/Diffuse'
    11. Shader 'Nature/Terrain/Diffuse': dependency 'Tree0' shader 'Hidden/TerrainEngine/BillboardTree' not found
    12.  
    13. Shader 'MicroSplat/Terrain': dependency 'BaseMapGenShader' shader '/Terrain_Base-605202478' not found
    14. Material doesn't have a texture property '_MainTex'
    15.  
    Everything works fine in the editor and play mode and previous builds did not have this problem. Do you know a solution?

    Thanks.
     
  39. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    What changed? The errors are primarily about unity's shader, and the basemap gen shader is only used to render GI information, so likely none of these are the issue.
     
  40. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    The only thing that changed is that I added a second terrain that is connected to the first. But even when I disable the second one I get the same errors and an invisible terrain.
     
  41. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Something changed other than that- maybe check your VCS..
     
  42. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    I'm not sure if the issue is related to Microsplat but when I put the standard unity terrain shader on the terrain it's not invisible in the build. Nothing else related to the terrain other than adding a connected terrain has been changed. But the issue seems to be fixed when I check "Draw instanced", it used to be visible without it checked.
     
  43. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    If I want to disable Tessellation through a script, how would I go by doing this (or changing the tessellation min and max height)?
     
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Interesting, can you post a screenshot of the shader settings on the top of the material?
     
  45. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Disabling you'd compile a separate shader and swap to it. To adjust any of the parameters you can set them on the template material using mat.SetVector() and then calling MicroSplatObject.SyncAll() to sync the changes to all instances. The tess parameters are stored in _TessData1 and _TessData2, you can look at the editor code to see what data is in each channel.
     
  46. SalmanJaved

    SalmanJaved

    Joined:
    Sep 12, 2019
    Posts:
    10
    Can i use microsplat for custom terrain that are premade in Maya or Blender.....?
     
  47. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    For that you'd need to use the Mesh Workflow module..
     
  48. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    Here are the settings:

    Annotation 2020-04-25 173244.jpg
     
  49. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Other than being a much older version of MS I see nothing that would cause an issue.
     
  50. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    The question came up how I achieved wetness here:



    I thought maybe others might have the same question, so it's better to answer that here. In short: I used the MicroSplat - Puddles, Streams, Lava & Wetness module combined with the Enviro integration.

    When you install Enviro, you just click the "Add MicroSplat Support" button:

    wetness 1.jpg
    And when you convert your terrain to MicroSplat, you tick the Enviro checkbox:

    wetness 2.jpg
    That's the automatic way, can also be done manually by hitting the "G" button at the MicroSplat "Wetness Range" setting which makes a global variable be driven by Enviro during runtime.

    wetness 3.png
     
    camta005 and knxrb like this.
Thread Status:
Not open for further replies.