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

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    246
    Thank you.
    I will try to figure it out.
     
  2. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    Can you help me with MicroSplat under Unity beta9? I have a job to do under the beta9 for a client :/ don't ask my why :/ and microsplat sends me an error message on the texture array script "invalid texture size". I used the same four textures already with micrsplat without problems. If you need more information, I can make a screesnhot of the error message, when I am back at my pc.

    Appriaciate every help!
     
  3. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Don't use Beta's, Unity broke Graphics.CopyTexture.
     
  4. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    I don't suppose this is the fix we've been waiting for? (It's listed under Features, not Fixes, for b10, so I assume not...)
    • Graphics: Added texture 3D CopyTexture support.


     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No, that’s what broke it in version 4.
     
  6. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    I see, I misread it entirely. So do you know if Unity is working on this...or aware of it? What can we do to get it moved to high priority?
     
  7. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It's been bugged, posted on the beta forums by several users, and @Tim-C said he'd poke the dev's about it but no luck so far. It basically breaks all 13 of my assets, along with a bunch of other ones, so hopefully they won't ship 2018.3 with it.
     
    Walter_Hulsebos likes this.
  8. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    I see. Thanks for the info!
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    PM me, along with a description of what issues your actually having..
     
  10. FastKillteam1

    FastKillteam1

    Joined:
    Sep 20, 2017
    Posts:
    50
    Oh so please bring support for hdrp, I love microsplat and the results achieved, but I would love it even more if I could use it with hdrp
     
    PROE_ likes this.
  11. Willbkool_FPCS

    Willbkool_FPCS

    Joined:
    Jun 13, 2018
    Posts:
    169
    I'm sure/know he will after 2018.3 has a stable release. No point in doing it many times for beta releases.;)
     
    Walter_Hulsebos likes this.
  12. FastKillteam1

    FastKillteam1

    Joined:
    Sep 20, 2017
    Posts:
    50
    I totally agree, just showing my interest in the product :)
     
    PROE_ and Willbkool_FPCS like this.
  13. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi, I'm trying to build my game in unity 2018.2
    I've used microsplat in previous versions of unity, like 5.6.
    It worked fine in editor and build.
    But in 2018.2, it shows error in the build, several hidden shaders are not found, this was not in the old builds, any ideas how to avoid these errors? Should I include microsplat shaders in some places?
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Can you post the error?
     
  15. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    I don't know about @Harekelas but this has been a problem in my builds for a very long time and I have not been able to resolve it despite your suggestions. You did say it was not a big deal (just an early out) so I have not really followed it up.

    Shader 'MicroSplat/Landscape': dependency 'AddPassShader' shader 'Hidden/MicroSplat/AddPass' not found
     
  16. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461

    Oh, this thing. Yeah, never been able to figure out what it wants, but it doesn’t cause any problem and it actually finds the shader at runtime anyway..
     
    Baraff likes this.
  17. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    So I got 2018.3b12 and opened my project...and get this error-- any suggestions?

    Assets\MicroSplat\Editor\TextureArrayConfigEditor.cs(1308,123): error CS0104: 'TextureCompressionQuality' is an ambiguous reference between 'UnityEditor.TextureCompressionQuality' and 'UnityEngine.TextureCompressionQuality'
     
  18. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    I think Unity 2018.3 betas are still broken for CopyTexture anyway. At least it seemed to be still broken in the latest b12 when I did a quick test yesterday, so maybe no point trying it with Microsplat just yet.
     
  19. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Darn it, they said that was fixed in b12!
     
  20. FuzzyShan

    FuzzyShan

    Joined:
    Jul 30, 2012
    Posts:
    182
    are microsplat shader for terrain will be support for beta 3's terrain instancing?
     
  21. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    246
    It will, or does. If only that CopyTexture bug in Unity would be fixed in time..
     
  22. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi,
    I've met this error when building my game in unity 2018, it was not present in unity 5.6:

    Shader error in 'Hidden/MicroSplat/Survisland_High_Ultra_Base2035933029': maximum ps_4_0 sampler register index (16) exceeded at line 1553 (on d3d11)
    Compiling Fragment program with UNITY_PASS_FORWARDADD SPOT SHADOWS_DEPTH SHADOWS_SOFT
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR

    here are the features I've enabled:
    upload_2018-12-1_9-50-6.png

    Would love to know the sampler cost for each feature. I've tried to tweak some settings: enable/disable parallax or tessellation, enable or disable global snow. But there still will be index exceeded error. Any suggestions?

    PS: this error also does not show up when I choose different features in the material, but if I try to compile and show the shader, this error shows up.
     
  23. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    There's no way to get an exact sampler count other than to go over it. This is because the sampler count is actually dependent on lighting as well as the shader itself- for instance, if the shader needs to sample a light probe it can require an extra texture for the light probe. The closest approximation would be to look at the shader's texture count (you can see this by selecting the shader) and you'll see how many MicroSplat is actually allocating..
     
  24. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Shader 'MicroSplat/Survisland_Mid': dependency 'AddPassShader' shader 'Hidden/MicroSplat/AddPass' not found
    Shader 'MicroSplat/Survisland_High': dependency 'AddPassShader' shader 'Hidden/MicroSplat/AddPass' not found
    Shader 'MicroSplat/Survisland_High_Ultra': dependency 'AddPassShader' shader 'Hidden/MicroSplat/AddPass' not found
    Shader 'MicroSplat/Survisland_Low': dependency 'AddPassShader' shader 'Hidden/MicroSplat/AddPass' not found
    Shader 'MicroSplat/Survisland_VeryLow': dependency 'AddPassShader' shader 'Hidden/MicroSplat/AddPass' not found
    Shader 'MicroSplat/Terrain 0,0': dependency 'AddPassShader' shader 'Hidden/MicroSplat/AddPass' not found

    These are the errors in the output log in a build game.
     
  25. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, these don't seem to cause any issue- the shader actually gets found at runtime, so I'm not sure why the build log throws these errors..
     
  26. Larzarus

    Larzarus

    Joined:
    Jun 4, 2016
    Posts:
    27
    Bad news..it looks like they introduced the Graphics.CopyTexture bug into 2018.2.19f1 and it's still there in 2018.3.0f1
     
    Crossway likes this.
  27. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Of course they did..
     
    Larzarus likes this.
  28. Larzarus

    Larzarus

    Joined:
    Jun 4, 2016
    Posts:
    27
  29. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    I really hope they fix this - I've seen it mentioned a few places and it would be a real shame to impact amazing assets like MicroSplat, especially with all the hard work you put into developing this.
     
  30. anpd03

    anpd03

    Joined:
    Aug 7, 2013
    Posts:
    65
    Man, been waiting for the fix so we can update our project :/ Worrying that they think it is fixed.
     
  31. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    Thanks for the heads up on this one. That was poor form from Unity. I wonder whether this needs to have a new bug report submitted given that they closed the original one?
     
  32. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    We have a large game world, so we're loading and unloading Unity and mesh LOD terrains in additive scenes. We've decided to put some environmental objects like rocks into the main scene, since they are visible from most areas of the map. (This is a change of plans since I chatted with you on Discord a few days ago.)

    These have the Microsoft blendable object component on them, but that doesn't work when there's no terrain underneath the rocks initially at runtime -- the component shows an error: Can't find terrain underneath. If I toggle that component off and on again, then the rock turns pink, with a second material slot added, but no material assigned to it, and two errors: Terrain shader not setup for blending, and Terrain does not have blending data. We could manually assign a material with the Blend shader, but even when I do that, the blending doesn't work, and the MS Blend component still shows those errors.

    Also, for the rocks that initially have a mesh LOD terrain (with MS mesh shader), they simply lose the second material entirely at runtime, and the MS Blend component shows an error "Terrain not detected."

    So....is there a way to get this to work with additive terrain scenes?

    thanks
    Dave
     
  33. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Well, you're going to need to figure out a way for it to access the data it needs when the terrain isn't there. The object blending uses a custom height/normal map that gets generated so it can figure out the terrain topology in the shader, as well as the bounds of the terrain. At startup, it finds the terrain the object is on and caches that stuff. You could change it to cache this at editor time or manually enter the data- the reason it does this is so you can move objects and terrains around and everything just works as it should.
     
  34. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Okay, thanks for the pointers. We'll look into it.

    Also: After pulling the most recent MS updates, I've started getting some errors when I change settings and regenerate the MicroSplat material. We use Assembly Definitions so I have to manually move all Editor scripts into a main MS/Editor folder, and I suspect I did something wrong there, but I've reviewed and recopied them and can't figure it out, and I keep getting the errors. Sorry for the bother, but can you see what it might be from these errors?

    Shader error in 'Hidden/MicroSplat/AmethystTerrain_x6_y1_Base-1289839447': 'ApplyAntiTilePerTex': no matching 5 parameter function at line 2584 (on d3d11)

    Shader error in 'MicroSplat/AmethystTerrain_x6_y1': 'ApplyAntiTilePerTex': no matching 5 parameter function at line 2584 (on d3d11)

    Shader error in 'MicroSplat/AmethystTerrain_x6_y1_BlendWithTerrain': 'ApplyAntiTilePerTex': no matching 5 parameter function at line 2586 (on d3d11)
     
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    If your pulling from the github it may be a bug I introduced.

    Yup, fixed..
     
  36. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    yes I was, so will pull again, thanks!
     
  37. holdingjason

    holdingjason

    Joined:
    Nov 14, 2012
    Posts:
    135
    Just confirming this is the same 2018.3 bug. Upgraded from 2018.2 to 2018.3 (release) and updated microsplat to latest on the store and it throws this. I am guessing the release version of 2018.3 is still incompatible with Microsplat until that copy texture bug is fixed. Just looking for confirmation that we would not be able to use MS on 2018.3 at this point.

    Thanks

    NullReferenceException: Object reference not set to an instance of an object
    MicroSplatTerrain.RestorePrototypes () (at Assets/MicroSplat/Core/Scripts/MicroSplatTerrain.cs:245)
    MicroSplatTerrain.Sync () (at Assets/MicroSplat/Core/Scripts/MicroSplatTerrain.cs:208)
    MicroSplatTerrain.OnEnable () (at Assets/MicroSplat/Core/Scripts/MicroSplatTerrain.cs:53)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    MicrosplatTerrain.cs

    line with the null ref.
    if (protos.diffuseTexture != cfg.sourceTextures.diffuse)
     
    Last edited: Dec 13, 2018
  38. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I have not had the copy texture issue since upgrading to the released version from the beta, so as far as I know they actually fixed that bug. This looks like you don't have your config assigned correctly in the MicroSplatTerrain component- check the debug section, maybe the upgrade borked the reference or something.
     
    mmaclaurin, PROE_ and mons00n like this.
  39. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Are others running well on 2018.3? Been holding off because of CopyTexture() bug but if that's all clear I'd love to see the perf changes for many terrains on iOS....
     
  40. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Couple questions about Snow:

    1) Having weird streaking once the UV Scale is above 1. See screenshots (UV of 3 and 50). Is something misconfigured?

    2) On objects with MS blending, as I increase the amount on that material, it creeps in VERY slowly along the blended areas, and then suddenly the entire object has snow on it. I thought it would only affect the top surfaces?


    snow 3.jpg snow 50.jpg
     
  41. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Can you attack a screenshot of your material settings (top section) so I can repro?
     
  42. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    sure, here you go
    Screen Shot 2018-12-13 at 6.09.46 PM.png
     
  43. kepesh

    kepesh

    Joined:
    Dec 29, 2017
    Posts:
    92
    I have the same error. How should the debug menu be setup to work?
     
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    There’s a rollout on the MicroSplatTerrain component labeled debug, click to open it.
     
  45. m506

    m506

    Joined:
    Dec 21, 2015
    Posts:
    93
    Hi there,
    I've successfully managed to get Microsplat working with 2018.3 and all the paid modules, which is great.
    Now I was just wondering if there's any plan to get it integrated with the new terrain instancing system? If I try to activate the flag (Draw Instanced) I get the whole terrain disappearing and I get the error below:
    "Shader error in 'Hidden/MicroSplat/_Base-640971990': invalid subscript 'instanceID' 'UnitySetupInstanceID': no matching 1 parameter function at line 2201 (on d3d11)"
    I suppose there would be performance benefits by using this flag, am I right?

    Thank you for your time!
     
  46. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Also, regarding snow on MS Blendable objects: There's no "G" button on that component to sync the snow with Enviro weather....possible to add?
     
  47. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You need to regenerate the shader in 2018.3, otherwise MicroSplat won't write out the requited #pragma's because they don't compile in 2018.2 correctly.
     
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    On which property? Those apply to shader properties, not components. If you make them global it will apply to the terrain blending shader as well.
     
  49. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    I meant on the mesh objects with the Blendable component. I have "G" toggled on and working nicely on the Unity and mesh terrains, but no snow is accumulating on the blendable objects at runtime when Enviro snows....so I was looking for something I might have missed. But maybe it's part of the above issues....
     
  50. kepesh

    kepesh

    Joined:
    Dec 29, 2017
    Posts:
    92
    I know but how should it look to be setup correct? How do I know if my is setup correct?
     
Thread Status:
Not open for further replies.