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

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You are using too many samplers- hardware has a limit of 16 texture samplers. On non-OSX platforms, some of these can be shared (and are when possible). Basically, turn off a feature that uses a texture.
     
  2. Adam_Starcaster

    Adam_Starcaster

    Joined:
    Dec 7, 2012
    Posts:
    37
    Is this referring to the entire project? Or just on microsplat though? I am using 2017.3 so just trying to figure out how to hack this issue. :) Thanks again.
     
  3. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It's a limit of any particular shader, not a project wide thing. Basically if you have a shader which samples a diffuse and normal texture, then it (without sharing) uses two samplers (one for each texture). However, Unity's lighting system will cause it to use more- a light probe uses another one, lightmaps another, etc. So there's no exact way to tell how many samplers a shader is using, because it depends on the lighting- but when you get above 16, the shader will throw an error like the one your seeing. So try turning off one feature that uses a texture and you should see the error go away.
     
  4. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    Hi, I am having Android Crash Problems

    Device: Galaxy S4 Mini
    Unity ( 2017.1.3p2, with only OpenGL 3.0 selected in build )

    I applied microsplat to my terrains and have build, android keep crashing after Unity Logo. Then I removed Microsplats from terrain and have build, runs normal again.

    Any idea ?
     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Not without a call stack or editor log showing an error.. Are you sure this device runs openGLES 3.0 or better?

    Seems like some versions of that device do not support OpenGLES 3.0:

    https://stackoverflow.com/questions/27723796/opengl-3-on-galaxy-s4-android-4-4-2
     
  6. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Can I get my hands on this script too? Been searching the forums to no avail.

    A page somewhere with persistent instructions for MapMagic / Microsplat integration would be amazing. I generally get it to work but even with a static terrain I have to hit "Sync" every time I change anything in the terrain graph :/ Not sure if this is the state of things or I've got something misconfigured.
     
    camta005 likes this.
  7. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MicroSplat 1.8 submitted today
    • Added support for up to 32 terrain textures per terrain
    • Error checking added for textures which are required to be linear
    • 2018.1b13 compatibility fix
    • When anti-tile is array, options for disabling anti-tiling features on terrain blended shaders are shown
    One thing cool about the 32 terrain texture update is that it barely effects the speed of the shader due to the way the shader is written. Additional control textures are created by Unity and sampled, but no additional samples of the texture arrays are used, so it has a very limited cost on modern hardware.
     
  8. Phelan-Simpson

    Phelan-Simpson

    Joined:
    Jan 1, 2014
    Posts:
    31
    As a recent purchaser of the suite, very impressed with the speed and quality.

    Quick question, is there a way to use tessellation seamlessly on multiple bordering terrain tiles?

    Thanks,
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Make sure the texture scale has the textures line up on the boundaries. Not sure, but I might have a world space UV option as well? Can’t remember..
     
  10. Wurlox

    Wurlox

    Joined:
    Nov 1, 2015
    Posts:
    50
    This sometimes happens to my terrain as well. Re-Import (right click on shader file and re-import) the shader and you should be fine again. After Re-Import it helps to change a setting so the shader compiles again. This fixed the issue for me every time I get this behaviour.
     
  11. Dunathan

    Dunathan

    Joined:
    Dec 11, 2012
    Posts:
    13
    Hi, just bought the Global Texture Module, but cant find any change anywhere, the Documentation don't specify the steps to make it show up, or there is something wrong here. Any ideas? All I did was import the package with a terrain already settled-up with Microsplat.

    [EDIT]
    I'm Using TerrainComposer2
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    New options should show up on the MicroSplat material as described in the docs..
     
  13. Dunathan

    Dunathan

    Joined:
    Dec 11, 2012
    Posts:
    13
    Thanks a LOT, for the fast reply.
    That's precisely where I was looking at, after removing the Microsplat component from my terrains and reassigning it, the new options appeared.
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Strange- you shouldn't have to do that at all..
     
  15. Dunathan

    Dunathan

    Joined:
    Dec 11, 2012
    Posts:
    13
    No problem.

    Here whats new. There is a seam with my colormaps, any workaround or solution?

    SEAM.png

    [EDIT]
    I´m using Tint Texture Override for every terrain.
     
    Last edited: Apr 18, 2018
  16. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    Hi, It seems my TextureArrayConfig file disappeared, is there a way to regenerate it?
     
  17. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    check your textures and make sure they are set to clamp?
     
  18. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Reconvert the terrain and it'll recreate it.. Or you can create one from the right click menu..
     
  19. Dunathan

    Dunathan

    Joined:
    Dec 11, 2012
    Posts:
    13
    Jason, you are a Genius!
     
  20. Dunathan

    Dunathan

    Joined:
    Dec 11, 2012
    Posts:
    13
    Jason, sorry to bother you one more time, but THIS time, if think I´v found a bug, the values marked as red have no effect on the Normals at all, all the other sliders and also the same parameters for tint are working as expected.

    If you want any demonstration, I may make a gif. values.PNG
     
  21. Adam_Starcaster

    Adam_Starcaster

    Joined:
    Dec 7, 2012
    Posts:
    37
    I have tried that, but also have tried to delete the microsplat terrainblend completely then reimport, but still this array issue.
     
  22. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    Updating to 1.8 caused a cascade of hard stop errors. I also own Megasplat and a few terrain tools, and after a module or two I started getting 4 hard stop errors on the Megasplat terrain painter that would not clear. After finishing the update on all the Microsplat modules, they still would not clear, so I figured I would delete and reinstall Megasplat. Deleting caused a number of other hard stop errors (mostly with MapMagic and Voxeland), and then reinstalling Megasplat cleared them but threw an error in the Microsplat Streams module. I tried reinstalling that, but then I was back to the terrain painter error on Megasplat, which wouldn't clear unless I deleted and reinstalled Megasplat yet again. Removing the Microsplat Streams module finally let me clear all the hard stop errors... but now I don't have that. It seems like any time there's an update to either Microsplat of Megasplat, I go through a similar process of chasing hard stop errors and reinstalling a number of components (though usually at some point everything plays nicely together - last night was the first time I can recall that one of my paid modules just wouldn't work). Is there a way to upgrade that's easier?
     
  23. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    I had some ( same as before ) errors when updated to 1.8 but i fixed them by going on every terrain material and toggled one of the features ! This was the way i got rid of the errors. Re-importing stuff did not help - at least i did not noticed !

    Now tessellation works in 2018.1 b13 !
     
  24. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I wonder if the asset store has some kind of meta file conflict between the two assets. Something along the lines of thinking that TextureArrayConfig.cs from MicroSplat is the one from MegaSplat, and overwriting that one instead of the one it's supposed to?

    I assume these are compile errors when they happen? If you use revision control, can you see if updating one of them is somehow overwriting files in the other?
     
  25. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Seems I broke a few things in 1.8. Per texture property lookups are off, and tessellation on windows platforms in non-2018 versions of Unity is broken. Fixed the first issue already and will try to get a fix for the second tonight and submit a patch.
     
  26. Poopaloop

    Poopaloop

    Joined:
    Aug 1, 2013
    Posts:
    21
    After playing with MegaSplat, I'm now looking at MicroSplat. Does the tessellation addon have physics, like the Megasplat version?

    Thanks
     
  27. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No..
     
  28. kepesh

    kepesh

    Joined:
    Dec 29, 2017
    Posts:
    92
    1.8 connected the textures and their settings all wrong. When I change the tint or tiling on one texture another one changes instead. Also one of the textures is completely black now.

    (I'm using Unity 2017.3)
     
    Last edited: Apr 20, 2018
  29. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I pushed an update to fix this last night- hopefully they'll get it on the store today..
     
  30. Dunathan

    Dunathan

    Joined:
    Dec 11, 2012
    Posts:
    13
    Thanks for that.
     
  31. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    Did anyone notice simialr error ?


    Assets/MicroSplat/Core/Scripts/Editor/MicroSplatTerrainEditor.cs(151,50): error CS0117: `DupeEditor.MicroSplatModule.AdvancedDetail' does not contain a definition for `DrawAdvancedDetailGUI'




    Assets/MicroSplat/Core/Scripts/Editor/MicroSplatTerrainEditor.cs(151,7): error CS0103: The name `DupeEditor' does not exist in the current context



    I imported the AdvancedDetail addon to microsplat and indeed it misses this method in the code :). Did i do something wrong (Unity 2018.1)
     
    Last edited: Apr 20, 2018
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    @wmpunk

    I'm betting it's not compatible with 2018.1 yet (still in beta)
     
  33. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    Ok np, thanks for the reply :)
     
  34. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I don't suppose there's an alternate method to do terrain blending that doesn't require the Terrain Blending Data exr? I've got 64 terrain tiles and want to set up something that would allow blending on potentially any tile, and that adds up...
     
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Not really - somehow you need to be able to draw the terrain on the object to do the blend, and that means knowing where the terrain is (height + normals) which is what's stored in the blending data texture.
     
  36. azdak

    azdak

    Joined:
    Oct 15, 2014
    Posts:
    3
    The script is here, and does what is says on the tin. That said, I'd also really appreciate if anybody who has gotten MapMagic and Microsplat working together could post a description/screenshots of their of their setup, particularly using PBR- I've not had much luck figuring out how to texture by MM height or slope with Microsplat in PBR mode.
     
  37. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Thanks for the script - fantastic for infinite terrain.

    There is another mapmagic / microsplat issue I'm seeing which is different. When I'm tweaking the graph in MM, anytime I make a change in MapMagic the Microsplat shader is replaced by the built-in terrain shader. I then have to go to the Microsplat component and "Sync Now" to make the Microsplat shader reappear. This means I can't watch the terrain change in real time as I tune, which really slows down the creative workflow.

    Why does this happen?

    Also, I think we need a Microsplat custom node for Mapmagic - I would guess it would let us fix this issue, but more importantly it could let us use MapMagic to assign streams and lava textures. This would be the only way that I can use the (gorgeous) streams since all my terrains are procedurally generated.
     
  38. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Not sure what you mean here, MicroSplat always renders PBR- The PBR mode is essentially "I would like to supply all the textures" instead of having MicroSplat generate them. In either case, it should have no baring on what textures map magic assigns anywhere..
     
    azdak likes this.
  39. azdak

    azdak

    Joined:
    Oct 15, 2014
    Posts:
    3
    !!! Thanks! That actually helped a lot- I was trying to use a MM custom node to account for the height/roughness/etc, didn't occur to me to just drop them in later.

    For anybody else who is a braingenius like me and got confused about how to set up the integration, here's what's working for me:
    - Create a MM object like normal
    - Set up diffuse/normal layers in MM:

    - Pin a terrain and add Microsplat to it
    - Go to MicrosplatConfig and Grab from Scene Terrain
    - Add in height/smoothness/ao, press Update
    - Add the Sync script to the MM container object
     
    camta005 likes this.
  40. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Some images for the awesome terrain blending feature. Look at the tents, they have different blending on the top because the terrain texture under them is different. That makes them look unique.

    TerrainBlending1.jpg
    TerrainBlending2.jpg

    Nice update. Can we use the 32 textures also in 5.6.Xfx?
     
    Last edited: Apr 21, 2018
  41. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yes
     
  42. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589

    Assets/MicroSplat/Core/Scripts/Editor/MicroSplatTerrainEditor.cs(151,7): error CS0103: The name `DupeEditor' does not exist in the current context



    Downlaoded only Microsplat Core on 2018.1 :). Just a friendly report
     
  43. wmpunk

    wmpunk

    Joined:
    Sep 5, 2015
    Posts:
    71
    Just repo'd this and am fixing it. So what should be going on is you have the AdvancedDetails package in the project folder and deleted it but the Define is still active so Microsplat is trying to call some GUI functions that are no longer there. To fix this you can either comment out both those lines of code or go to Edit/Project Settings/Player and remove "__MICROSPLAT_ADVANCED_DETAIL__" from the scripting defines setting.

    Edit: Just double checked and yes importing AdvancedDetails also causes it. I already have a update submitted that fixes this and adds new textures/features, hopefully it will be out within a day. For now you can comment those two lines out and it should work just fine.
     
    Last edited: Apr 22, 2018
  44. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    i dont know how to link to a post but its on this page
    https://forum.unity.com/threads/fre...ding-system-for-unity-terrains.487458/page-19
     
  45. Adam_Starcaster

    Adam_Starcaster

    Joined:
    Dec 7, 2012
    Posts:
    37
    Hate to be the annoying guy with more bugs, but curious how to fix this issue? All terrain close to the camera whites out. I am not sure if I messed up a setting somewhere, but this is the first time it has happened.
     

    Attached Files:

  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Do you have any compile errors when you select the MicroSplat.shader file in the MicroSplatData directory?
     
  47. Adam_Starcaster

    Adam_Starcaster

    Joined:
    Dec 7, 2012
    Posts:
    37
    Yes, Unexpected token '('. Expected one of: ',' ';' line 1291
     
  48. Dunathan

    Dunathan

    Joined:
    Dec 11, 2012
    Posts:
    13
    Jason, not sure if it's with you, but if you dont mind, how do I sample the terrain color at a coordinate?. It could be the colour map, or maybe if its not so simple, it could be also the splat map index.
     
  49. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Do you have the 1.81 core update? And if not, can you tell me which features of the shader are enabled (screenshot the top section). Also, what version of Unity and what platform are you on?

    Do you want to know the dominant texture, or the actual color value? Before or after lighting? For the actual albedo value, you would have to:

    - Sample the four splat weights around the location you are interested in
    - Grab the colors of the four most dominant textures
    - Modify the colors based on all modifiers (per-texture tint, etc)
    - Blend the colors together based on the height maps the same way the shader does
    - Apply any special effects (snow, geotextures, streams, lava, etc) by computing them on the CPU

    Basically it would require porting all the bits of the shader you use to the CPU.

    But if you just want to know what terrain texture your on, you can get that from TerrainData on the terrain.
     
  50. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I got the latest update and now I see the three options under Terrain Blending...but they don't reduce the streaking. Here's what it looks like with Blend Distance of 1.2 and Blend Normal Distance of 0.5 (which doesn't seem to affect anything at a smaller or higher value). Disabling Triplanar doesn't affect the streaking either, nor does disabling the Anti-Tile Array features entirely. Anything else I can do? Blending at smaller angles looks great, but I have a lot of rocks that intersect the terrain perpendicularly.

    Screen Shot 2018-04-23 at 11.28.23 AM.png
     
Thread Status:
Not open for further replies.