Search Unity

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

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Absolutely. Probably should have added a "once that's stable." Regarding maintenance; from what I've read about shader graph (it compiling files to shaders to keep 'shader devs' out of maintenance woes) makes it seem like they don't want to be caring about backwards compatibility (not saying this in a derogatory manner, this is a perfectly understandable strategical decision.) I'm hoping they won't make you jump through too many hoops, though :)
     
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Well, I think Unity made a major mistake with SRP/Shader graph. Essentially, the abstraction layer for a shader only exists in the context of a shader graph- not as a separate system. What this means is that it's possible to have a HD shader work in the LW pipeline, but only if it's created using their shader graph system. My issue with this, beyond not wanting to use a graph, is that a lot of what MicroSplat is able to do is just not possible within the limitations of a graph based interface.

    What should have happened is that the abstraction layer for compiling a shader to different target render loops should have been a separate system, one which the shader graph writes to, but where hand written shaders could also be compiled from. Both the LW and HD pipelines, as well as most of the SRP's that people will potentially write, will use the same core inputs for the lighting structures (albedo, normal, smoothness, etc). They might have some extra data for subsurface, etc, but the core inputs will likely be the same, and shaders would be able to be cross compiled between them and essentially work.

    When I created MicroSplat, I basically decided to stay within the context of a surface shader, which was the abstraction Unity built for a shader graph several years ago (but never finished). Surface shaders have a lot of design by evolution in them, along with a number of bugs which have never been fixed and consume a lot of my time. But what they do well is abstract away lighting and pass semantics from the shader writer. This is extremely valuable, because it allows Unity to change the lighting and rendering pipeline around and everything still works. When I created MegaSplat, I wrote directly to vertex/fragment shaders, handling all the passes and lighting myself- and nearly every version of Unity that gets released, they change some small detail in how things work and I end up spending hours digging through their shader source to see what changed.

    So from my asset store developer point of view, being forced to write everything as custom vertex/fragment shaders, for multiple pipelines which don't even attempt to share common functions and constructs, is a very bad move and make writing shaders for the asset store much more time consuming and complex, and supporting them through multiple versions of Unity much more expensive as well. I think this will drive a lot of developers and assets out of the store, and I am still debating which of my assets are worth supporting in future SRP pipelines (of which there will likely be many, not just 2). The MicroSplat module for LWRP is an experiment to both find out what the demand is, see if that work can be monetized, and also get some idea of what the maintenance cost is once the pipelines become "stable".
     
    TakeRefugeGames, Seneral and one_one like this.
  3. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    Hi,
    Bought Microsplat yesterday and looking good. Could someone please clarify the workflow when using it with TerrainComposer2 and NodePainter? Once I've converted to Microsplat, can I go back and use NodePainter to paint terrain textures, then just "update" changes to Microsplat? Currently, painting in NodePainter seems to have no effect :-(.
    I can paint using the standard Unity terrain tools.

    Thanks!
     
  4. FastKillteam1

    FastKillteam1

    Joined:
    Sep 20, 2017
    Posts:
    50
    hey thanks for the fast and detailed response :) will certainly be looking into vegetation studio also so that makes it all the more tempting haha will write you a good review this is for sure, I am very impressed with some of the results I have produced so far using microsplat with the terrain blend and alpha hole, saves me doing a lot of work modelling and texturing in external programs.. huge thumbs up!
     
    jbooth likes this.
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I would ask @Seneral as I know he has used them together and is the dev for node painter. MicroSplat just reads the standard terrain data, so it shouldn't care what tool is changing the terrain data.
     
  6. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    I completely get your pain and that's what I feared about them focusing support on the shader graph. Losing shader developers from the asset store who actually understand what they're doing on a code and GPU level would suck.
     
    TakeRefugeGames likes this.
  7. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Thanks @jbooth for the heads up.
    Can you test if any changes in TC2 update MS? They probably will, as they do for me (just tested), but just to be sure.
    More likely there is something wrong with your Node Painter setup so it does not influence the terrain at all...
    If you need help figuring it out, just ask:)
    Seneral
     
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I don't actually own TC2 or node painter, as TC2 doesn't work on a mac and that's where I do most of my dev..
     
  9. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Ya responded to Keaneo, but wouldn't have seen his problem without you notiying me :)
     
  10. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    OT, but I use it on Mac -- just gotta enable Metal Editor.
     
    recon0303 likes this.
  11. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    hey jason do you remember the distortion line from the parallax mapping in areas where objects are terrain blended?
    you send me a fix and it did work on the latest version it does not work anymore. working in vr atm but dont think it has something to do with the vr rigg.
     
    Last edited: May 21, 2018
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Are you sure you updated to the latest version and didn't just reinstall the old version?
     
  13. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    the latest from store at least i did start from scratch you did send me the ...body...txt i tried it and recompiled by checking unchecking the features but it is still there
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Can you open up a module and check the version number to make sure it's really the latest? I've had quite a few people lately who thought they were running latest but were really running old versions- so much so that the next version has the version number displayed in the UI.
     
  15. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    line is moving with the camera it is very obvious in movement
     
  16. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    See the message right above this one.. open up one of the module cs files and look at the GetVersion function..
     
  17. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    public override string GetVersion()
    {
    return "1.9";
    }
     
  18. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Ok, send me a repro and I'll take a look- positive that fix made it in, so maybe it's something else.
     
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Set ‘Normal Blend Distance’ to 0 on your objects..
     
  20. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    does not help in my case :/ it did for you in the repro?
     
  21. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah- I had to remove all the VR stuff in the scene and light it so I could see things, but changing that to 0 clears up any streaking between the rocks and the terrain. Can you post a shot of what you are seeing so I know we're talking about the same thing?
     
  22. erenaydin

    erenaydin

    Joined:
    Mar 1, 2011
    Posts:
    384
    Code (CSharp):
    1. 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)
    Tesselation module gave an error.
    Unity version 2018.2.0b4 (BETA)
    I removed the microsplat folder and reimported from Asset store window.
    All the packages is up to date.
    Any ideas?
     
  23. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    This was fixed in 1.8, I'm betting your not actually up to date. Open the tessellation module's .cs file and tell me what the GetVersion() returns, it should be 1.9 if your up to date.

    Also, officially, I don't support betas - too much breakage.
     
  24. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
  25. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
  26. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    let me remind you that we already had the problem and you fixed it ... it was pretty much the same thing
     
  27. erenaydin

    erenaydin

    Joined:
    Mar 1, 2011
    Posts:
    384
    Code (CSharp):
    1.       public override string GetVersion()
    2.       {
    3.          return "1.9";
    4.       }
    It's 1.9, I didn't change it manually :D
    It's probably because of the BETA. I understand.
    I'm just doing beta testing. i just wondered why it is. By the way tessellation and parallax is working. Just cannot build :d
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    So, this bug was introduced when Unity changed some internal compiler directives around. Perhaps they've changed them again? When 2018.2 gets a bit further along, I'll check to see what it is, as it might just flip back in the next release.
     
    erenaydin likes this.
  29. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    I own Megasplat but was thinking of trying out Microsplat. I'd like to use a texturing tool that doesn't do half a dozen other things also.

    But I wanted to check on how texture blending is handled. we need a splatmap weight blending approach vs the Megasplat texture cluster approach. What approach does Microsplat use?
     
  30. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    In short: Kind of both.

    Microsplat is in one sense a normal terrain shader using the splatmap approach, but with a better backend compared to normal shaders. Result is the same though, normally blended based on terrain splatmaps.

    But it also has a texture cluster module which allows you to 'replace' each splats of the splatmap with a texture cluster, so multiple textures combined by noise. This effectively increases the texture count by up to 3 times, while still using splatmaps. Still a normally blended splatmap-shader though.

    The whole texture cluster thing of MegaSplat is, if I'm correct, mostly a conversion thing, after converting your splatmap-terrain using texture clusters to MegaSplats, you have individual control over each splat just as with splatmaps. So don't understand how it would affect you in regards to blending.

    So, you can consider MicroSplat a normal but fast splatmap based terrain shader if you want, but also additionally use the texture cluster approach.
    Hope that helps:)
     
    jbooth likes this.
  31. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    There is actually a pretty big difference in the blending between the two. Both are height map blended, but MegaSplat is a mesh based technique which blends 3 texture choices across a triangle. This makes it blend in a barycentric space, and on Unity Terrains, it constructs a virtual triangle for each pixel to do the blending.

    MicroSplat is based on a texture backed splat map technique, which means when you sample the splatmaps, you get bilinear blends between the four pixels you are sampling from.

    The result of this is that MegaSplat's blends can have a hexagon style artifact to them, so to counter that you tend to blend more textures together and keep things blending between many textures. There is also an ideal ratio of control texture/vertex density : splat texture scale which helps with this.

    MicroSplat's blends can look much softer and don't have the hexagon style artifacts, which is preferable to a lot of people. But the technique does not work with vertex painted meshes as the control data, and you have to sample a control texture instead which is a dependent texture read, which is slower than vertex based techniques. However, MicroSplat makes up for this speed with some other tricks and is generally faster than MegaSplat in most cases.

    Texture Clusters, along with the MegaSplat technique, are my unique inventions; as far as I know I haven't seen either implemented elsewhere. In MegaSplat, they are essentially free because the shader needs to sample one texture for each vertex on the triangle, so sampling 3 different textures doesn't create extra ALU cost (only bandwidth). It also means texture clusters are an edit time thing- the brushes actually apply them as you paint, and they can have any number of textures or rules associated with them.

    In MicroSplat, texture clusters basically sample 2 or 3 textures for each control texture, so this is additional work which needs to be done over the regular shader. But since you are using a noise texture to control which texture gets sampled where, there's not some specific ratio you have to manage between vertex density and cluster size to make them look good, and you can adjust that noise texture without having to repaint..

    I personally prefer MicroSplat for anything on a Unity Terrain, it's generally faster, has more features, and 32 control textures is usually enough.
     
    Seneral likes this.
  32. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Hi I use Blender for my terrains, I'm wondering is there a way to make MicroSplat work with a Mesh?
     
  33. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Thanks much for the detailed info. Now my struggles with MegaSplat for terrain make more sense:)
     
  34. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I have this working, but not as a released module- there are too many potential support issues as it has specific restrictions on the mesh (must be a height map, have a 0-1 UV continuous UV space like a Unity Terrain would, etc).
     
  35. davidjone12

    davidjone12

    Joined:
    Jan 16, 2018
    Posts:
    14
    I am getting an error saying - Assets/MicroSplat/Core/Scripts/MicroSplatPropData.cs(67,54): error CS0117: `UnityEngine.RuntimePlatform' does not contain a definition for `Switch' - please help....I am using unity 5.5.3
     
    Last edited: May 25, 2018
  36. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    there must be a heightmap or it ust be a heightmap?
     
  37. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MicroSplat requires Unity5.6.1 or greater to work. The asset store should have prevented you from downloading it with 5.5

    Neither; it must conform to the specifications of a height map style terrain. MicroSplat makes some assimptions about the geometry it’s working with, for things like flowing water/lava, etc.
     
    Aaron2348 likes this.
  38. FastKillteam1

    FastKillteam1

    Joined:
    Sep 20, 2017
    Posts:
    50
    Testing on Samsung tab A, the terrain turns white(no mats). The device has the required gles. Any suggestions? Driving me bonkers I have put loads of work in, i just want to see the results on device
     
  39. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    A few things:
    - Are there any errors in the logs?
    - Click on the texture arrays and make sure they are an android format (most likely ETC2). I doubt this is it, but worth a check (unity would uncompress them if so)
    - It's quite possible that the particular device doesn't support the full OpenGLES3.0 spec- I've seen this in the past with devices that were made right around the time of the 2.0->3.0 switch, as manufacturers try to save a few dollars by shaving corners.
    - Write some debug code to Debug.Log the state of everything- make sure the material is applied to the terrain, that the shader is set on the material, etc..
     
  40. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I didn't notice this until now:
    • Height Offset and Contrast settings added to per-texture properties, allowing you to adjust the contrast and bias of each textures height map.
    I'd thought of asking for that awhile ago but figured I could edit the heightmaps easily enough....but man oh man, it is SO nice to be able to tweak those in the material. I'll never be able to give up Per-Texture tweaking now.
     
    camta005, Seneral and Vagabond_ like this.
  41. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    After installing additional modules,(AntiTile, GlobalTexture and Triplanar) the global UV settings don't show up anymore, is this normal? I need to change the tiling globally, how can I get them back?

    Regards

    Frank
     
  42. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    They should always be there.. Do you have any compile errors?
     
  43. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    No compile errors!
    Global UV.jpg
     
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Do you have triplanar on? If so, the global scale is in the triplanar section.. That is the only thing which hides those controls, because they don't make sense in a triplanar shader (there's 3 values then, not 2)
     
  45. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    I have triplanar on and found it now, thanks for your help.
    I've used CTS before in my project and moved for performance reasons to microsplat, and I must say it's not only faster, it looks much better then CTS. Ok, it has a steeper learning curce (just bought it yesterday), it is by far worth the effort. Really good asset:)

    Best regards

    Frank
     
    camta005 likes this.
  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I'd be interested in what you consider to be the cause of the learning curve?
     
  47. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    @jbooth I recently purchased MicroSplat and 3 modules...have to say...really well done. I was using CTS but I actually stayed with an old beta version of that because it was fast and simple. I connected up my Genesis Weather to it and for the most part it was awesome....now that I moved on to Unity 2018 I had lots of 3rd party tools issues.

    So I watched all of your videos (most were about MegaSplat) and decided to bite. :D Congrats on the awesome work and not having any install issues. The modules worked really well...the blowing sand and snow from the 'Glitter' module is fantastic. I will have some pics to post here and will give a proper review after more time with this.

    As for a steeper learning curve? Not sure about that. Is quite simple to use and the results are awesome. Still trying to connect up my weather to it and make proper wet surfaces and snow. I really don't want to use WAPI since I can make the connections directly. Just some experimentation...or I may ask for some help with the variables and scaling ranges. Sometimes (like with CTS, RTP, and Ultra) sliders have to be blended to get the right look and feel...usually not just 1.

    In any case...more funds to your vacation account. :cool:

    Cheers
    O
     
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You can expose the variables on the shader as globals and adjust them with Shader.SetGlobal* functions. I also have a timeline playable on my GitHub that allows you to put shader globals on a timeline, so if you want to control them via timeline you can do that as well.

    The key for dynamic snow is adjusting the sliders for the type of snow you want at the given time- for instance, as snow sits around, it gets more crystals and melts around the edges. It also tends to melt off the tops of rocks, but not in the cracks. So you can adjust all of those settings together to create the right effect..
     
  49. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Just wondering, does anyone have Micro Splats in any released game yet, or large Open world game near complete going on Steam? If so would love to see it . Thanks. I don;t have Micro Splats, I have Mega Splats. but would like to see screens of a complete game with screens if anyone has one ? Thanks! Please only release games or near complete ones, if anyone has any:)
     
  50. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello Jason,

    I just updated my Unity version to 2018.1.2f1, which is the latest for xbox one. As soon as I opened my project with this version, my terrain which it was using Microsplat already, was just a white terrain, no texture showing. I updated my Microsplat and all its modules to the latest and still showing a white terrain and a lot of errors in the console, from on of the scripts. Any help would be very much appreciated. Please see the picture for reference on the errors + white terrain, etc.

    Regards,
    Carlos MicrosplatInUnity2018.jpg
     
Thread Status:
Not open for further replies.