Search Unity

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

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

  1. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    579
    Hello @jbooth,
    I imported the Tessellation add-on and I get this error on Unity 2018.2.10f1, Mac, Metal drivers:

    Shader error in 'MicroSplat/Example_Tessellation': 'tex2D': no matching 4 parameter intrinsic function; Possible intrinsic functions are: tex2D(sampler2D, float2|half2|min10float2|min16float2) tex2D(sampler2D, float2|half2|min10float2|min16float2, float2|half2|min10float2|min16float2, float2|half2|min10float2|min16float2) at line 504 (on d3d11)

    Any idea how to address it?
    Thanks
     
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    Seems like you have an older version of MicroSplat, this was fixed maybe 2 months ago?
     
  3. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    579
    That's strange as I was setting up a new machine and I downloaded today from the assetstore the plugins. I'll try to clear the cache and download it again.
    I'll update you asap.
    Thanks
     
    jbooth likes this.
  4. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    579
    So I checked and the version I have in the project is 2.1, both of MicroSplat and Tessellation.
    But in the header of the shader I have:
    //////////////////////////////////////////////////////
    // MicroSplat
    // Copyright (c) Jason Booth
    //
    // Auto-generated shader code, don't hand edit!
    // Compiled with MicroSplat 1.7
    // Unity : 5.6.1p2
    // Platform : OSXEditor
    //////////////////////////////////////////////////////

    I also tried to enable and disable the Tessellation to force the recompilation of the shader but nothing changed.
     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    Where did you check the version number? Look in the GetVersion function and see what it returns. It looks like you have 1.7, because the GetVersion function is what gets written into that code.
     
  6. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    579
    The GetVersion implementations of the various add-ons are all 2.1, as the MicroSplatShaderGUI.MicroSplatVersion constant.
     
  7. OutCyder

    OutCyder

    Joined:
    Mar 19, 2009
    Posts:
    2,154
    Hi, I just bought 3 modules for Microsplat today, but maybe I did a mistake.
    I have read the "brief differences comparison" but still not sure I did the right thing.
    Here is why.

    First of all, I wonder what's the difference in performance is between the two. I need performance more than texture variety and procedural textures, so Microsplat seems the right choice. Also, Microsplat now supports 32 textures if I'm not mistaken (the page is still set on 16) so I really don't need more than that.

    I don't need procedural texturing, and I prefer to avoid terrains "conversions" etc. because I am working with Landscape Builder. Landscape Builder supports directly Megasplat, but again, I don't know the performance results, nor if it converts the terrains into meshes or other stuff like that. Stuff that I don't need.

    So Microsplat looks the right choice, and that's why I proceeded to buy the modules... but I still miss the textures and the expense is getting near to Megasplat: if I buy another module or two, which will probably happen, I'll have spent more on Microsplat than on Megasplat.

    So the final real question: is Megasplat performing similarly to Microsplat?
    Because if so, and if the "conversion" is not mandatory, I'll give back the modules and buy Megasplat instead.
     
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    There's no easy answer, because it depends on the settings and such, but generally speaking for Unity Terrain work MicroSplat is usually faster than MegaSplat, and has more features than MegaSplat with the module system. MegaSplat uses a completely different splat mapping system than Unity's built in one, which also makes it look pretty different than MicroSplat and the other options out there. Some people like this difference, some don't.
     
    OutCyder likes this.
  9. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    579
    Also another thing that is so weird...
    I created a new empty project and imported MicroSplat base.
    I got this:
    Screenshot 2018-09-28 at 18.55.11.png

    Screenshot 2018-09-28 at 18.55.32.png
     
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    That is actually a bug- those pragma's are the new instancing options for 2018.3, but they seemed to have no effect on older versions so I left them in - but they seem to be causing these warnings..
     
  11. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    579
    The issue is that they are on the same line of the main #pragma. Once fixed it's not a problem to have them in 2018.2.
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    Yes, but they throw other warnings in 5.6, so I'm just going to only emit them in 2018.3+
     
  13. OutCyder

    OutCyder

    Joined:
    Mar 19, 2009
    Posts:
    2,154
    OK, thank you, I'll hold on to Microsplat then.
    Is there a way I can get the textures? Could you put them in a separate package maybe?
     
    Willbkool_FPCS likes this.
  14. VictorKs

    VictorKs

    Joined:
    Jun 2, 2013
    Posts:
    146
    Hi I just purchased the anti-tiling module everything works great but distance resampling doesn't work well. More spesifically I use 4 textures distance resampling works only for grass but not the other 3 textures. Also the resampled UV scale doesn't work as I zoom out textures are always scaled down by the same factor no matter the scale I set. Other than that it works great and with excelent performance! But I really need to fix that issue.
     
  15. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    Can you post a shot of your material settings (the top section)? I just tested scale in all 3 modes and it seems to be working..

    [Edit] Ah, found it. It's when using the Gradient/LOD samplers instead of default. I'll submit a patch for this soon.
     
    Last edited: Sep 28, 2018
    VictorKs likes this.
  16. VictorKs

    VictorKs

    Joined:
    Jun 2, 2013
    Posts:
    146
    Good to hear, thanks for the quick reply and great asset!
     
  17. kilian277

    kilian277

    Joined:
    Jul 13, 2012
    Posts:
    54
    Well i can now add the texture to the array with no problems , nothing turns dark , for some reason lol , but the texture doesn't appear in the texture list on the terrain to paint it
     
  18. VictorKs

    VictorKs

    Joined:
    Jun 2, 2013
    Posts:
    146
    Can I assign different microsplat materials in my terrains in runtime? I have 4 settings grass/dry/snow/sand and I want when my level loads to randomly pick a setting. Do I use sync or anything else?
     
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    Set the template material field on the MicroSplatTerrain component and call MicroSplatTerrain.SyncAll().
     
    VictorKs likes this.
  20. VictorKs

    VictorKs

    Joined:
    Jun 2, 2013
    Posts:
    146
    I mean how do I set it? Is there any scripting documentation I could read? I could look at the component code find it and assign it directly but I fear of breaking something.

    Edit: so I guess this works terrain.GetComponent<MicroSplatTerrain>().Sync(dryMaterial);
    I only use 1 level per scene


    Edit2: Ok I got it MicroSplatTerrain.templateMaterial=dryMaterial; and then SyncAll();

    I just realized Sync has no params
     
    Last edited: Oct 1, 2018
  21. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    hey, i have a problem with ground textures.If i move the smoothness slider to the right, the textures look good but have reflections.If i move the opposite side, no reflections but they don´t look well,as there is a dust layer over them.In the middle i got a lot of reflections.Any idea how to solve this? thanks

    Snap 2018-10-07 at 12.28.57.jpg

    Smoothness = 1

    Snap 2018-10-07 at 12.29.12.jpg

    Smoothness = -1
     
  22. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    Are you talking about the smoothness strength per texture property? If so, what this does is add the value to the current smoothness coming from the texture (that's why it goes negative, for instance). It's preferable to adjust you textures, as they have per-pixel information for smoothness..
     
  23. Sarudan

    Sarudan

    Joined:
    May 21, 2011
    Posts:
    48
    Hi Jason,

    I bought Microsplat two days ago, and since then I've purchased all of the additional modules. Very nice work!

    Everything is really good, except when I enable the Advanced Details module, I'm seeing a shader compilation error:

    Shader error in 'Hidden/MicroSplat/Terrain_Base-1742838048': invalid subscript 'xy' at line 825 (on d3d11)

    Do you have any idea what might be causing that?

    I tried removing Advanced Details and adding it again in case it overwrote a newer file, and I also tried reimporting the core package, but no luck unfortunately.

    It only appears to happen when the Gradient sampler is enabled. The LOD sampler appears to be ok.
     
    Last edited: Oct 8, 2018
  24. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    Advanced details is not actually my module; @wmpunk wrote it and has to update it if there's an issue (I cannot actually push it to the store). I will give it a test and see if I can repro it though.
     
    dooly123 likes this.
  25. RyanDunne

    RyanDunne

    Joined:
    Mar 30, 2017
    Posts:
    13
    Microsplat constantly packing textures and with our large project it's getting too much. How can we get it to only pack when we tell it to? We make a change to something that has nothing to do with microsplat and it packs, we pull from collab and it packs .. it's ruining our work progress.
     
  26. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    It should only pack when the platform changes or your texture settings change. You can find the code which computes the hash in TextureArrayPreProcessor.cs and figure out why one of these values is being changed.
     
  27. RyanDunne

    RyanDunne

    Joined:
    Mar 30, 2017
    Posts:
    13
    Thanks for the response, passed that over to someone who knows what they're doing :) Could I ask if there is a way to stop everything re-generating every commit, all microsplat assets have to get pushed (get a blue icon showing changes), even when no work been done. It's over 500mb every time someone commits. Might be the same problem, hopefully we solve this :)

    Should be a manual override so we can click a button to do all this, rather than having to push/revert 500mb every commit.

    Thanks again jbooth!
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    If you could override it, you'd end up with your textures being compressed into the wrong format when you change platforms; everything would still work, but Unity would uncompress them at load and they'd take up 6-12 times as much memory as they are supposed to without so much as a warning. So I don't particularly like that idea. So better to figure out why your project keeps compressing the textures, because for most people it doesn't do this. Also make sure your on the latest, as that hash code was simplified a few months ago to only include a minimal set of data.
     
  29. wmpunk

    wmpunk

    Joined:
    Sep 5, 2015
    Posts:
    71
    Hello Sarudan, Thank you for purchasing AdvanceDetails. Currently I'm having a issue sending updates to the AssetStore, I am working on resolving this. I have already sent you a message with a patch to fix your problem. Any other issues you can reach me through private message or post to the AdvancedDetails thread.
     
  30. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,042
    Jason, I know you usually don't make updates for new Unity versions until they're out of beta....but do you plan to update MicroSplat for 2018.3 before then...and if so, how much before? :)
     
  31. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    I did an initial update on beta 3, and will likely test again when it’s a bit further along.
     
  32. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,042
    Oh, great! (I didn't see it on github, but I do see it on the Asset Store, so will download it from there.) Much appreciated! (EDIT: And now I do see it on github...weird...)
     
  33. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    204
    Was interesting to read about perf improvements coming to terrain via GPU instancing. Any perspective on whether microsplat users will automatically pick up these perf boosts?
     
  34. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    204
    I somehow killed my framerate from 60->10. Suspect some setting got changed after I imported the recent microsplat, or I just did something dumb. Anyone know common gotchas when upgrading? Next step is to delete the microsplat directory and reimport. I seem to keep doing this but not writing down how I fixed it.... :/
     
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    I added support in the last version, but Unity broke something with Graphics.CopyTexture in beta 5, so if you want to test use Beta 3.
     
    mmaclaurin likes this.
  36. skaughtx0r

    skaughtx0r

    Joined:
    Mar 9, 2014
    Posts:
    39
    @jbooth I just updated MicroSplat and MicroSplat Tessellation from 1.9 to 2.17 and the Tessellation seems to no longer be using my height maps. It just raises/lowers the entire area painted with that texture.

    Edit: Nevermind, I just fixed it by going into the MicroSplatConfig.asset and hitting the Update button at the bottom.
     
    jbooth likes this.
  37. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    204
    SOLVED: it was my Unity version. :/ Still on 2018.2, but didn't have latest patches.

    Back to 60fps.

    Microsplat integration with next gen Enviro is looking awesome. Weather driving puddles, raindrops.

    Also BTW, thanks for the specular cutoff at sea level. Got a nice limited glistening shoreline above the waves:

    upload_2018-10-13_1-31-14.png
     
    Dwight_Everhart likes this.
  38. FastKillteam1

    FastKillteam1

    Joined:
    Sep 20, 2017
    Posts:
    31
    I havent used microsplat in a while, decided to use it with a new project and getting this error in unity 2018.2.12. Shader error in 'MicroSplat/Example_AlphaHole': 'Setup': output parameter 'config' not completely initialized at line 277 (on d3d11)

    could you point me the right way to fix it
     
  39. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    Update to the latest version.
     
  40. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    110
    Has anyone tried the terrain in 2018.3? Is it true we unity terrain users will finally get some relief from the crazy draw call numbers? Sounds like it could be amazing if they're moving a lot of the rendering work to the gpu.

    Also, any idea how far off the mesh terrain module is for microsplat, Jason?
     
  41. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    It's done, and it's more of a mesh module, I just haven't gotten around to cleaning up the last few things and releasing it.
     
    sjm-tech likes this.
  42. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    110
    yeah, really excited about using it on arbitrary meshes (not just for pseudo-terrains) if that's possible (I think I remember seeing that that's what you had done on your youtube channel). Really exciting times :)
     
    sjm-tech likes this.
  43. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    242
    Hi

    I am experimenting a bit with streams and i have some questions.

    I am making a landscape with mostly ditches and small rivers. Occasional small lake perhaps.
    I didn't think i could make this look good with MS-streams, but with the right care it can look really nice.
    And off course it's very 'cheap'..
    To be useful however, i have some issues with reflections.
    I understand MS uses whatever i use in my scene.. so i used reflection probes.
    What i can't figure out however, is how to use multiple reflection probes on a static terrain. Do i need to write a script to activate probes according to the camera position?
    I must be doing something wrong.

    For more accurate reflections i understand that using planar reflections is very expensive.
    But wouldn't it be possible to mix both?
    I have for instance waterbirds like swans in my scene. And a small boat.
    It would be cool if i could only render these objects and mix this rendertexture with the probes.
    I have a script for making the (reflected) rendertexture.
    Perhaps this is a better suggestion for Cascades, but could work for MicroSplat as well no?
     
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    Well, a planar reflection system won't 'just work' with other shaders- it usually uses a second camera to render the scene from the reflected angle, then the resulting image is used in a shader. However, you might be able to get close enough with a screen space reflection system. This uses the pixels already on the screen to fake a reflection. As for the probes, only one probe is active on any given draw call in Unity's system.
     
  45. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    242
    No i guess it won't just work :)
    But if you would add a slot where i can put a rendertexture in and add some code to the stream shader code, we could make it work right?
    Anyway, it was just an idea. Would solve some things for me. I understand if this is a bit outside the scope.
    Can't use deferred unfortunately.. mobile..
    I'll have another look at Cascade... and my reflection probe troubles.
    Thanks Jason.
     
  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    You can write your own module for MicroSplat- it's pretty straight forward, so that's my "Hey, I want to add a feature" system.
     
  47. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    579
    @jbooth I'm testing the tessellation with Vulkan. As soon as I enabled it, the part of the terrain that should be tessellated disappears. Can you confirm that it works on your side? Maybe is an issue with my drivers. I'm on 2018.2.12f1
    Thanks.
     
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,777
    Pretty sure I tested vulcan a while back and things seem fine- there's no API specific code in MicroSplat, and Unity doesn't even expose anything vulcan specific.
     
  49. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    579
    Thanks for the confirmation. I made a repro with a simple shader that makes use of tessellation and filled a bug report. I'll update here in case someone else may have the same problem.
     
  50. Harjawalda

    Harjawalda

    Joined:
    Sep 1, 2018
    Posts:
    10
    Hi Jason, a quick question regarding microsplat, I'm using splatmaps from Worldmachine for my basic texturering, can I use microsplat to improve that, because when I run it, it seems to ignore my splatmap and just uses the general distribution of the applied textures on the terrain?