Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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. AbsolutelyAdrian

    AbsolutelyAdrian

    Joined:
    Jul 20, 2020
    Posts:
    2
    @jbooth
    See microsplat_terrain_unityld_adapter.txt for an example with the extra underscore:

    #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler_##name);

    I *think* our version of Microsplat is fairly up to date (within last month or so) ...
     
  2. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,639
    Hi @jbooth I'm using Microsplat in a Specular Terrain workflow, along with the Terrain Blending module.
    (Microsplat shader generator v.3.7, Unity Standard Renderer, Unity v.2019.4.22).

    All seems to work well with one small exception... On the blended object, in the blended areas only, the Smoothness value seems to be getting multiplied or combined additively instead of an a/b blend. This is not very noticeable in lit areas (though there is a slight color cast because of it) but it is very noticeable in shadow areas and looks like a mistake in the specular.

    I've gone through all the settings I can think of both in microsplat and on my textures and materials. Nothing I try changes this behavior which makes me think it's a bug. Do you have any advice regarding this?

    The below pic shows the problem more clearly.... blended areas show a combined specularity error, while non-blended areas on the object and terrain show the expected specular.



    Also just a version note, the shader generator is listed in my project as v.3.7, though I noticed the current version on Asset Store is 3.74. I've seen your recent complaints about installing through package manager, and downloaded/installed through the asset store window, but shader gen is still listed as 3.7... I downloaded this morning. I don't know if that has any bearing on the above problem or not.
     
  3. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    I suspect this is a bug in the terrain blended shader not handling specular workflow correctly, and if you were using a metallic workflow it would work. I'll glance through the code and see if it's anything obvious, but if not it would be useful to have a clear repro scene.

    The MicroSplat interface only shows the main version number - this is because it requires all versions be in sync, and releases like 3.74 are bug fix releases that don't require an API change between the modules (and everyone having to download them all). Had I realized Unity was going to break the package manager and leave it not working in a years worth of Unity versions, I'd have added some kind of "asset store version" system - but you know, I figured they could get asset updating right - boy was I wrong..
     
    chingwa and Lars-Steenhoff like this.
  4. ibernd

    ibernd

    Joined:
    Jun 24, 2019
    Posts:
    10
    Hi!
    the new snow sparkles are great. I've waited for that..

    I had hoped that this effect would be independent of snow (e.g. in wind & glitter module). so that it would be possible to also produce sand sparcles (like in "Journey")
    Is there a chance that this will be possible later?
     
    Last edited: Mar 14, 2021
  5. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    377
    Confirmed latest version has sampler##name instead of sampler_##name and it solved the problem :)

    Had to do a fresh install, whenever I tried updating without a fresh install of microsplat and its components I got some error from the previously generated shaders, after doing a fresh install I was able to use it on the switch URP with terrain meshes no problem ^^ Thanks!
     
  6. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    It could be done..

    I must have fixed that before this conversation started. You basically have to delete your package manager cache every time you update an asset, because basically the package manager doesn't work.
     
  7. Lorrak

    Lorrak

    Joined:
    Sep 17, 2019
    Posts:
    8
    Unity 2020.30f1(LTS?), clean asset install, android build, clean project, tried all compressions overrides if it changes something, it happens then i try to add textures to array config
    "astc" etc errors with other compressions
    Code (CSharp):
    1. 'ETC2_RGBA8' is not supported on this platform. Decompressing texture. Use 'SystemInfo.SupportsTextureFormat' C# API to check format support.
    2. UnityEngine.Texture2DArray:.ctor (int,int,int,UnityEngine.TextureFormat,bool,bool)
    3. JBooth.MicroSplat.TextureArrayConfigEditor:CompileConfig (JBooth.MicroSplat.TextureArrayConfig,System.Collections.Generic.List`1<JBooth.MicroSplat.TextureArrayConfig/TextureEntry>,string,bool) (at Assets/MicroSplat/Core/Scripts/Editor/TextureArrayConfigEditor.cs:1365)
    4. JBooth.MicroSplat.TextureArrayConfigEditor:CompileConfig (JBooth.MicroSplat.TextureArrayConfig) (at Assets/MicroSplat/Core/Scripts/Editor/TextureArrayConfigEditor.cs:1870)
    5. JBooth.MicroSplat.TextureArrayPreProcessor:CheckConfigForUpdates (JBooth.MicroSplat.TextureArrayConfig) (at Assets/MicroSplat/Core/Scripts/Editor/TextureArrayPreprocessor.cs:70)
    6. JBooth.MicroSplat.TextureArrayPreProcessor:OnPostprocessAllAssets (string[],string[],string[],string[]) (at Assets/MicroSplat/Core/Scripts/Editor/TextureArrayPreprocessor.cs:44)
    7. UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets (string[],string[],string[],string[],string[])
    8. JBooth.MicroSplat.TextureArrayConfigEditor:CompileConfig (JBooth.MicroSplat.TextureArrayConfig,System.Collections.Generic.List`1<JBooth.MicroSplat.TextureArrayConfig/TextureEntry>,string,bool) (at Assets/MicroSplat/Core/Scripts/Editor/TextureArrayConfigEditor.cs:1851)
    9. JBooth.MicroSplat.TextureArrayConfigEditor:CompileConfig (JBooth.MicroSplat.TextureArrayConfig) (at Assets/MicroSplat/Core/Scripts/Editor/TextureArrayConfigEditor.cs:1870)
    10. JBooth.MicroSplat.TextureArrayConfigEditor:DelayedCompileConfig () (at Assets/MicroSplat/Core/Scripts/Editor/TextureArrayConfigEditor.cs:1094)
    11. UnityEditor.EditorApplication:Internal_CallDelayFunctions ()
     
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    There are two known bugs with Unity compression right now:

    1. For ages, compressing into ETC2 on windows will throw this error- because the editor running on windows does not support ETC2 - but everything works fine.
    2. On 2020.3, they broke texture compression on some platforms. This bug is filed and repro'd, but I'm not sure when unity will fix it.

    Your screenshot is of the first, and can be ignored.
     
  9. Lorrak

    Lorrak

    Joined:
    Sep 17, 2019
    Posts:
    8
    okay, i will wait for unity to figure it out with texture compression, because if i go further and try using it(arrays) on microsplat shader standart or urp, unity goes crazy with all sorts of errors :D
     
  10. maky13

    maky13

    Joined:
    Jul 16, 2018
    Posts:
    7
    Hi!

    I have a question regarding changing texture quality at runtime? (something like a "Low/Mid/High" slider present in many games)
    I am using HDRP with 3 quality presets (Low = Quarter Res, Mid = Half Res, High = Full Res) and change between them. I think it is the same as changing QualitySettings.masterTextureLimit from code directly. However, this doesn't apply to the Microsplat texturearrays, and this is my dilemma.
    I am not very experienced with this, and I am worried that if I "hack" something together, it might end up more trouble than it is worth. Also, I saw an earlier comment in this thread about how changing QualitySettings.masterTextureLimit has its own issues, so I am having second thoughts about the whole process.

    What is the best practice for this?
     
  11. Unimacsima

    Unimacsima

    Joined:
    May 16, 2017
    Posts:
    2
    Hello! I am using Microsplat terrain blending on URP 2020.1.17f
    The blending works great! BUT, every time I play or save the scene it seems like the Terrain_normal gets reset because the blending has completely gone. I have to update the normal data to brings up the blending again. Is there any solution? thank you
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    Wait until you get comfortable with profiling your game before considering things like this- do you know that texture size is an actual factor affecting your frame rate yet?
     
  13. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    If you can provide a way to repro this I'd happily look into it- there seems to a few issues around saved introduced in 2020.3 reported by various people, but so far I've not managed to repro them myself or gotten a repro from anyone else that works.
     
  14. maky13

    maky13

    Joined:
    Jul 16, 2018
    Posts:
    7
    To be honest, I don't feel comfortable at all with graphics profiling (especially with all the HDRP options). I am just trying various configurations and looking at the fps, so nothing in-depth. Changing the texture sizes didn't seem to have a significant impact on my machine (maybe a few fps).
    I am used to seeing such option in most of the games I play, so I thought of it as a "must have in game" (perhaps not the best idea).
     
  15. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    432
    I've been looking into fixing repeating textures on our terrains. I really like the results of the "Stochastic Height Sampling Node for Amplify Shader Editor" asset:

    https://assetstore.unity.com/packag...ampling-node-for-amplify-shader-editor-143715

    It's from the same author, does anyone know if there is an implementation of it for MicroSplat?

    There is also the anti tiling module which appears to do something similar to an older asset called "Distingo" which worked ok but wasn't perfect.

    Last but not least there is the "Texture Clusters" module.

    Could anyone with experience using those comment on performance, effectiveness and usability?

    We also plan to use the "Tessellation and Parallax" module if that is of any consequence.

    Thank you.
     
    Last edited: Mar 16, 2021
  16. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    Texture Clusters has a stochastic option..
     
  17. Unimacsima

    Unimacsima

    Joined:
    May 16, 2017
    Posts:
    2
    Hello again Jason, I was able to reproduce the bug again and again. So FYI I'm using 2020.3 now because it was LTS.
    To repro, the bug just simply doing the basic thing
    - New Scene
    - Create Terrain
    - Insert the Microsplat script
    - Insert the Microsplat material to the terrain
    - Paint the terrain
    - Import the Microsplat Terrain blending
    - Activate the Terrain Blending on the Microsplat terrain
    - Put the 3D Object to the Terrain
    - Insert the Microsplat Blendable Object to the Object
    - It works!
    - SAVE / Ctrl +S same result
    - No blend
    - Adjust
    - Blend again
    - PLAY
    - No blend.

    And in 2020.3 the bug while saving and the terrain going black is occured.
    It is still bearable because the texture will pop up if you just play or adjust anything.

    Thank you, hope there's any way i can use the terrain blend it was so good! Thank you jason
     

    Attached Files:

  18. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    The terrain blending issue repro's and is fixed, but I still don't see black terrain on saves..
     
  19. development_unity92

    development_unity92

    Joined:
    Jul 16, 2020
    Posts:
    2
    Hello, @jbooth I am having a problem with tesselation on ios. When I enable tesselation it looks like this on iPhone XR, with unity version 2020.2.1 on highest quality settings. You can see the green lines and some darker areas. If you can help it would be much appreciated. Thank you. Screen Shot 2021-03-19 at 16.10.08.png
     
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    Unless you have some green texture coming through for some reason, I would expect this to be some kind of driver issue. Do any particular feature combinations cause this?
     
  21. vidugam

    vidugam

    Joined:
    May 2, 2019
    Posts:
    7
    Hello @jbooth I seem to be confused as to either how Unity handles normal maps or how this asset handles normal maps. I'm using HDRP and Tessellation and the landscapes seem to be incorrectly rendering the normals of the material I made in substance. You can see that the shadows of the gravel on the landscape are facing the lightsource. The same textures appear correctly on the cube and sphere. Do I have something set incorrectly in the config? The normals are in OpenGL format. Normal Channel Inverted Problem.png
     
  22. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    151
    World Creator + Quadspinner Gaea. HDRP 2020.3. Trees from Triforge fantasy pack. GPU Instancer for trees performance;)
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      421.8 KB
      Views:
      34
    • 2.jpg
      2.jpg
      File size:
      533.7 KB
      Views:
      33
    • 3.jpg
      3.jpg
      File size:
      418.4 KB
      Views:
      32
    • 4.jpg
      4.jpg
      File size:
      587.3 KB
      Views:
      33
    • 5.jpg
      5.jpg
      File size:
      489.3 KB
      Views:
      30
    Last edited: Mar 19, 2021
  23. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    Is that a standard unity shader on the sphere? MicroSplat internally stores its normals differently than Unity does, but should account for it in the shader- however, it's quite possible something got flipped somewhere it shouldn't have. Is this using HDRP2019 or 2020's adapter, and in which version of HDRP? Also, triplanar or UVs?
     
  24. vidugam

    vidugam

    Joined:
    May 2, 2019
    Posts:
    7
    @jbooth I've fiddled about and updated to HDRP 2020 and the supported version of Microsplat. Not much has changed, but I am however getting errors in the console when I edit the microsplat material which weren't appearing before. I'm not sure if they have any relevance to my problem since they seem to not effect anything. What's stranger is the material on the right in the picture seems to the being rendered perfectly fine. All of the other materials and textures on the terrain have inverted channels. I am not using triplanar or any other modules. Only HDRP and Tessellation. I doubt Tessellation is causing it since the maps were inverted before I had it installed. huh.png what.png
     
  25. vidugam

    vidugam

    Joined:
    May 2, 2019
    Posts:
    7
    Oh and this happens when I save the scene.
    It goes away when I rebuild the material though and comes back when I save again.
     

    Attached Files:

  26. pauldrummond

    pauldrummond

    Joined:
    Oct 30, 2014
    Posts:
    109
    I'm getting the same issue with Unity 2020.3.0. If I make any changes, or save the scene the terrain seems to lose its normal mapping. If I toggle something in the MicroSplat material the normal appearance is restored. Entering play mode also restores the correct terrain appearance.
     
  27. TheFoundation

    TheFoundation

    Joined:
    Jan 29, 2014
    Posts:
    19
    @jbooth I can confirm the shader errors reported by vidugam and pauldrummond using those versions:
    • Unity 2020.3.0f1 (with HDRP template)
    • High Definition RP 10.3.2
    • MicroSplat Core 3.76
    • MircoSplat HDRP 2020 Support 3.7
    The CoreHDRP2020 Example should produce those errors out of the box.
     
  28. vidugam

    vidugam

    Joined:
    May 2, 2019
    Posts:
    7
    Cool. I was beginning to think something was wrong with my installation.
     
  29. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    Yup, fixed this yesterday..
     
    TheFoundation likes this.
  30. pat0000

    pat0000

    Joined:
    Mar 22, 2021
    Posts:
    1
    Is there a step by step guide on how to install MicroSplat - HDRP 2020 into a fresh Unity 2020.3.0f1 project? I cant seem to find the option to turn on the rendering loop or where that would be located.
     
  31. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    Install core, install HDRP2020, and any other modules, then the render loop will be at the top of the material interface.
     
  32. Artini

    Artini

    Joined:
    Jan 29, 2016
    Posts:
    37
    I am using a Tesselation module and it looks very nice.
    Does anybody knows how to make a character (robot in my example) to actually walk on such MicroSplat terrain and not sink into it. Is it possible at all?
    Tesselation01.jpg
     
  33. vidugam

    vidugam

    Joined:
    May 2, 2019
    Posts:
    7
    @Artini The best thing you can do is to use occlusion mapping or to displace the geometry downward instead of up. Since displacement and tessellation run on the GPU you can't really get the information of the geometry to do anything with say IK.
     
  34. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    This is covered in the docs and in the faq.
     
  35. pauldrummond

    pauldrummond

    Joined:
    Oct 30, 2014
    Posts:
    109
    Was the fix in the latest Microsplat release? Unfortunately, I'm still having the same issue with Unity 2020.3.1 HDRP and Microsplat 3.77. If I change anything in my scene the terrain seems to lose normal information. Going into Play mode always fixes it. Here's a screenshot to illustrate:



    Whenever anything in the scene changes I get this alert in the console:

    Importer(NativeFormatImporter) generated inconsistent result for asset(guid:3c925592ae7f74e9abbf2a36ae9d54b4) "Assets/Coast House/Terrain Data/MicroSplatData/MicroSplat_propdata.asset"
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()
     
    Last edited: Mar 23, 2021
  36. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    You have to clear the package manager cache before downloading any assets, as the package manager is completely broken in most versions of Unity. It will say it has latest, but install an old version.

    I was referring to the REV_VP compile error (a patch shipped this morning for a number of issues). There have been several reports of people having issues after saving and having to adjust a property or regenerate normals to get it to snap back, but I can't seem to repro this myself.
     
  37. pauldrummond

    pauldrummond

    Joined:
    Oct 30, 2014
    Posts:
    109
    I have been clearing the cache for each update. Unfortunately, things are even worse now. My terrain textures are appearing far too light, almost as if they're in the wrong colour space. This screenshot shows the albedo debug view. The textures should be a lot darker. All other scene elements appear as expected. The Microsplat material has been set to the correct 'HDRP 2020' render loop and workflow.

     
  38. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    I haven't changed anything with color space or texture code in, well, years. There is a diffuse is linear option on the texture array config though.
     
  39. pauldrummond

    pauldrummond

    Joined:
    Oct 30, 2014
    Posts:
    109
    I saw that. I'm going to create a test scene and work through options to see if it's something dumb I'm doing.
     
    jbooth likes this.
  40. vidugam

    vidugam

    Joined:
    May 2, 2019
    Posts:
    7
    @jbooth So my normal problem seems to be fixed but there seems to be a problem with the texture compression now? The textures I have look really S***ty up close. These are 2048x2048 textures and should be far more detailed than this. You can see the artifacting? in this image where the color looks like it got converted into a jpg, and I get this error in the console when I go to create a new terrain. Am I doing something wrong? I went through the FAQ and nothing talks about this. Crust.png PossibleCrustError.png
     
  41. pauldrummond

    pauldrummond

    Joined:
    Oct 30, 2014
    Posts:
    109
    I give up for today. Now the terrain doesn't receive realtime lights/shadows and the textures look really weird; washed out and almost pixellated. I can't work out what's wrong with it. I may have to revert to my project version in Unity 2019.
     
    Last edited: Mar 23, 2021
  42. Artini

    Artini

    Joined:
    Jan 29, 2016
    Posts:
    37
    Thanks a lot. I have had no idea, how to fix this issue at all.
     
  43. Artini

    Artini

    Joined:
    Jan 29, 2016
    Posts:
    37
    Oh, I admit, I have not read the docs and the faq, yet. I am so impatient with testing things out.
     
  44. waffenwars

    waffenwars

    Joined:
    Mar 4, 2013
    Posts:
    4
    Hi, I got microsplat and the hdrp 2020 module, I'm using unity 2020.3 LTS. I cleared the package cache and re-downloaded the modules an hour ago. I get the following message when updating the texture array (either deleting a material or adding one). It doesn't seem to be causing any issues but I thought I'd let you know:
    upload_2021-3-23_19-53-45.png

    My workflow to get to this step was:
    Create a new terrain
    Add the microsplat component to the terrain
    Click convert (did not supply a material)
    Add textures to the slots for one of the materials in the array
    Click update

    Whenever i add or remove new materials from there the error pops up. I seem to be able to paint and erase new materials fine.

    This asset is awesome, thanks for supporting it!
     
  45. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    Yes, bug is logged with Unity, expecting a fix in a patch version or three..
     
  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    Nothing has changed with the texture compression code, except that bug that throws an error in Unity 2020.3, but I can't do anything but wait for them to patch that.

    Do you have your texture array config set to 2048? The default is 1024..
     
  47. waffenwars

    waffenwars

    Joined:
    Mar 4, 2013
    Posts:
    4
    Thanks for the response! I installed the blending plugin and found that the blend shader doesn't seem to respond to realtime shadows in hdrp. Is hdrp not supported for this module or am i missing a trick?
     

    Attached Files:

  48. andrew210

    andrew210

    Joined:
    Apr 23, 2014
    Posts:
    187
    Hi back again with this bug (iOS), and reading through the forum (im now on 2020.3.1f1, have deleted package manager cache and reinstalled / updated microsplat today),

    am still getting the error:

    Autoconnected Player async texture load: failed to load MicroSplatConfig_normSAO_tarray from /private/var/containers/Bundle/Application/C20D9C3A-4718-4187-9AA0-41E31E3DFF76/HorseAcademy.app/Data/sharedassets5.assets.resS


    To attempt to workaround i switched to packing mode quality and updated, which lead to a different (but very similar looking)

    Autoconnected Player async texture load: failed to load MicroSplatConfig_smoothAO_tarray from /private/var/containers/Bundle/Application/65CBCAB6-A1BF-41B1-BE07-6075DE5016C7/HorseAcademy.app/Data/sharedassets5.assets.resS


    Reading the forum, I'm guessing that my issue is related to these unity bugs, and they're aware of it and nothing we can do here apart from sit and wait for them to fix it up? If my issue is somehow different to the unity bugs mentioned above, if I can do anything to help in assisting debug I would be happy to do so. As always, support for your asset and patience with your support are to be admired.
     
  49. pauldrummond

    pauldrummond

    Joined:
    Oct 30, 2014
    Posts:
    109
    I reverted to a version of the project using Unity 2020.1.17. Everything is okay but I can't update the Microsplat assets because there's no HDRP module for this Unity version. Something in the jump to Unity 2020.3.1 is breaking my project. I need to work out what it is.
     
  50. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,766
    This was fixed recently- you likely need to delete your package manager cache and redownload, as the package manager is completely broken.
     
unityunity