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

    Adam_Starcaster

    Joined:
    Dec 7, 2012
    Posts:
    37

    Currently using 2017.4.1 I did update a few moments ago, but still same issue. Let me see if I should just reimport all
     
  2. Dunathan

    Dunathan

    Joined:
    Dec 11, 2012
    Posts:
    13
    Couldn't be more clear, thank you!
     
  3. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Note to all users having some issue !

    I had a few issues which i only was able to fix by double click on the material used on the terrain and simply toggle off/on any of the options. I just imported 1.81 and was still having issues with per texture settings and i couldn't get it to work until i went and altered a setting in the material. After this everything is working correctly ( at least in 2018.1 b13 ).

    So if you have any issue you can just give a try toggle on/off any setting in material to refresh it and see if it helps !
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yes, changing an option on the shader generation setting will recompile the shader with the new code. This doesn't happen automatically when you import new versions, since MicroSplat is a shader generator, not a set of shaders like other systems out there that can be statically compiled.

    If you can make a small repro with your exact setting I can look into it and see what's going on.
     
  5. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    I know this issue, I have it for all meshes (rocks, buildings). Because I have a top down game the normal blending is not that important. I set it to a minimum value and just play around with color blending and noise attribute. Sometimes I have the dark flickering issue at the blending area, but that can be because the mesh had been made in a wrong way (or because it has non convex parts). For this issue I move the rock higher or deeper. Also if I lay a transparency clipping based decal on another transparency clipping based decal (in my case road segments), I get dark shadow at the overlapping transp. clipping area (if the shader order is 3000). I solved this by set the shader order to 2000 and then transparency is disabled and the road segments clip each other. For that I had to make a road segment which connects/blends the 2 road parts. There are issues with, but for the blending feature the overhead is worth for me.

    I also made my own shader that can blend a texture with normal map to the top and from the bottom to the top, but this can just use one texture. In my case that would be also enough, but jbooth version gives the buildings/rocks a unique look and I can control it by just changing the ground texture under the static objects. Moving objects then uses my shader.
     
  6. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Nice shot of microsplat looking very painterly, alongside enviro, aquas, and mapmagic. Runs over 100fps on iPhone X until the throttle kicks in.
     

    Attached Files:

    jbooth likes this.
  7. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MicroSplat 1.9 has been submitted. A new module is available that adds support for the new LW render pipeline in 2018.1. I expect it will take a few weeks to get approved.
     
    Vagabond_ likes this.
  8. alexis_morin

    alexis_morin

    Joined:
    Jan 13, 2017
    Posts:
    6
    This is gonna sound pretty ludicrous but... how do I upgrade the core from 1.7 to 1.8? Just bought the tessellation/parallax add-on and it's pestering me that the versions are mismatched. I tried reimporting the core package from the store but the error message is still there in the Material. Any pointers?

    Amazing work, by the way. It's the first thing I've ever bought on the asset store.
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You should just be able to upgrade it from the store. If you just reimport it, it will reimport the version you have on disk, which is older...
     
  10. alexis_morin

    alexis_morin

    Joined:
    Jan 13, 2017
    Posts:
    6
  11. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
  12. alexis_morin

    alexis_morin

    Joined:
    Jan 13, 2017
    Posts:
    6
    Alright, the two packages deleted successfully but I still get the original "you need to update to 1.8 " error; I tried reimporting and creating a new terrain to no avail. I then tried making an entirely new project with nothing but the two plugins and I still get the same error!

    Any ideas? I'm using 2017.3.1f1 if it helps.

    edit: What's terribly weird is that the example scene does work, but if I open the material I still get the error.

    edit 2: well I'm a serious dummy, I guess that in nine years of using unity and not using the asset store I never got to learn that to update a bought asset you had to go to the "my downloads" page and not the asset's page itself... cheers.
     
    Last edited: May 2, 2018
    jbooth likes this.
  13. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Sorry to bug you with another problem, but I have one texture which is not behaving properly:

    1) I have to set the Target Strength at 1 for it to appear on the terrain at all -- it's all or nothing for that setting. Opacity can be less than 100. All other textures do appear as expected at lower Target Strengths.

    2) It has sharp edges on the terrain, rather than fading like other textures -- this is using both the soft brush in the terrain editor, and with TC2 splat painting nodes. Sometimes some edges are soft while others are hard, as you can see in the attachment. Any texture painted on top of this texture has hard edges as well, but soft edges anywhere else.

    I've checked the texture, can't see anything peculiar about it. Edges are soft if I switch to built-in terrain shader. On Mac Unity 2017.3 (hard edges appear with or without Metal Editor).

    Any ideas?

    thanks
    Dave

    hard edges.jpg
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Most likely you have a black height map- if the height map was completely black, then it would only rise above the other height map when the opacity got close to 100%.
     
  15. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    yeah, that was my first thought too, but it has a proper heightmap -- and I even lightened the heightmap to make it float higher, but no difference.

    But....then I assigned a heightmap from another texture to this slot, and it blends nicely! And so now I've made a new heightmap (in Crazy Bump) for this texture, and it works too! Weird, I wonder what was wrong with the original one (also made in Crazy Bump). Oh well, thanks as always for the quick reply.
     
  16. robbob44

    robbob44

    Joined:
    Apr 16, 2018
    Posts:
    22
    Since 2018.1 launched today, and the update resulted in all of our terrains using MicroSplat turning white, I also updated MicroSplat and the three other modules we own (Triplanar UVs , Anti-Tiling Module , and Terrain Blending) but we have the following compiler errors:
    We have not moved to a different rendering pipeline yet, but is there something I am missing? I'm sure that won't change the interface requirements. I have deleted this script for now to resolve the compiler error.

    We also had issues with our MicroSplatData/MicroSplat.shader and MicroSplatData/MicroSplat Base.shader :
    I'm not sure exactly what was wrong in the shader, but I am re-configuring MicroSplat again from scratch (had to completely delete the data folder and then re-convert terrains) and now the shader is properly rendering again.

    However, we also had issues with the Microsplat editor script for vegetation studio when enabling the Vegetation Studio GrassMap option in the shader. I did update VegetationStudio, but the error remained:
    This seems to be because microsplat_properties_vsgrassmap.txt and microsplat_func_vsgrassmap.txt
    do not exist. There are microsplat_properties_vegetationstudio.txt and microsplat_func_vegetationstudio.txt though inside MicroSplat\Core\Scripts\VegetationStudio\Editor.

    Finally, there is something wrong (or I'm doing something wrong) with the Vegetation Studio Shadow Map option in the MicroSplat material. This is what probably turned our terrain white. I couldn't find documentation for the ShadowMap setup though so I just followed similar steps for the ColorMask and instead used the ShadowMaskCreator script from VegetationStudio. After creating a shadow mask, attaching it to the terrain, there are three errors, one from each shader inside MicroSplatData:
    In summary:
    • MicroSplat/Core/Scripts/Editor/UnityLDRenderLoopAdapter.cs doesn't seem to fully implement its interface causing compiler errors
    • We did not have a smooth upgrade to 2018.1.0f2 and upgraded Microsplat from 1.7 to 1.9 and VegetationStudio to 1.3 and tried to re-configure MicroSplatData from scratch.
    • Editor property and function text files for Vegetation Grass Map seem to be incorrectly named ...vsgrassmap.txt instead of ...vegetationstudio.txt
    • Enabling VegetationStudio ShadowMap option in the MicroSplat material results in shader compilation errors on DX11 and gives all terrain a white appearance.
    Sorry for the giant report that may be hard to parse, but we just encountered a lot of problems with the update.
     
  17. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I think you needed to delete the old version before doing the update- it looks like several files which were renamed or deleted were not updated by the asset store. (Unity has no docs on how the asset store updates files- I suspect it does not handle renames and deletions correctly) Note you shouldn't need to re setup your terrains to do this- just delete the folders and reinstall.
     
  18. kepesh

    kepesh

    Joined:
    Dec 29, 2017
    Posts:
    92
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Looks like the shaders need to be customized for it in some way, so you'd need to modify the MicroSplat core package to do whatever changes it needs. It looks like it uses a custom fog function, basically..
     
  20. robbob44

    robbob44

    Joined:
    Apr 16, 2018
    Posts:
    22
    Thanks for the quick response. Deleting the MicroSplat folder and then re-importing did resolve the compiler error with the UnityLDRenderLoopAdapter script. The error regarding "output parameter 'config' " did remain so I did have to delete MicroSplatData as well, but that will be easy enough to reconfigured. During my restoration of previous settings though, setting Triplanar Mode to either Triplanar or HeightBlended results in this error:
    Also enabling VegetationStudioShadowMap still has the same errors in each shader file:
     
  21. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Ok, I'll look into it..
     
  22. ellioman_flashbulb

    ellioman_flashbulb

    Joined:
    Jan 17, 2017
    Posts:
    7
    Hey,
    More fun stuff for you to take a look at :)

    We've just updated to 2018.1.0f2 and MicroSplat/Terrain is giving me this error:
    Code (CSharp):
    1. Shader error in 'MicroSplat/Terrain': 'tex2D': no matching 4 parameter intrinsic function;
    2. 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 965 (on d3d11)
    The call in line 965 is:
    fixed4 w0 = MICROSPLAT_SAMPLE_TEX2D_LOD(_Control0, i.texcoord.xy, 0);
     
  23. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    This is really getting frustrating... once again, a Microsplat update hits the asset store, and once again updating triggers a cascade of hard stop errors in the console (I'm on Unity 2017.2.2p4 on macOS). And in a fit of irony, attempting to remove and reinstall Microsplat and all the modules triggers a cascade of hard stop errors related to the Cascade asset. I need to remember to budget a couple extra hours into my schedule whenever updating Micro or Megasplat to play the whack-a-mole reinstallation game, but man I wish I didn't have to.
     
  24. kepesh

    kepesh

    Joined:
    Dec 29, 2017
    Posts:
    92
    They have these steps to make a shader work with Aura:
    ´

    Would it be super technical to make it work with microsplat?

    I could easily pay extra for Aura support in microsplat.
     
  25. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    After deleting the entire Microsplat and Earthshaping folders from my assets and reinstalling Microsplat one piece at a time, the Streams module consistently spits out these 4 hard stop errors, they just will not clear.

    Screen Shot 2018-05-03 at 9.14.54 AM.png
     
  26. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Did you update microsplat? This was fixed in the 1.8 update, as Unity changed the underlying compiler and so some extra define checks had to be added.

    So is it the case that you have MegaSplat, MicroSplat and Cascade in the same project, or just MicroSplat and Cascade? I don't understand what is happening as no one else seems to have this issue, and it seems to happen to you on every update. Is TerrainPainterWindow in your project? Does it have an OnSceneGUI function? Because it should..

    I also bet if you install each into a new project, then copy the files into your project, it would all work fine. It might even continue to work fine on the next update..
     
    Last edited: May 3, 2018
  27. itsnottme

    itsnottme

    Joined:
    Mar 8, 2017
    Posts:
    129
    Hey, how can I change the texture x and y sizes when painting the textures? When I try doing that, the changes do nothing. I also can't find where to do that in Microplast.
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    There is a global scale on the material, as well as a 'per texture scale'. I suggest reading the docs on per texture scale..
     
    itsnottme likes this.
  29. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    I did update Microsplat first. My project has Microsplat, Megasplat, and Cascade in it (as well as other assets that don't have issues with every update). I was not able to come up with an installation combo that was error free until I removed the TerrainPainterWindow.cs file from Megasplat - and after removing it everything seems okay. I haven't yet been able to put Megasplat to use (it's not yet whitelisted on the Unity-based virtual world I build content for), so it's just in limbo. When I get some time, I may try installing them in a clean project and seeing what happens, thanks for the tip.
     
  30. ellioman_flashbulb

    ellioman_flashbulb

    Joined:
    Jan 17, 2017
    Posts:
    7
    I most certainly did not! Silly me. That fixed my problems. Thanks.
     
  31. itsnottme

    itsnottme

    Joined:
    Mar 8, 2017
    Posts:
    129
    I can't seem to make any texture look right on mountains/bumps in terrains. Is there a specific way of doing this? I can't seem to find any in the documentation.
    The textures look fine on ground, but when they are on bumps they look weird and unrealistic.
     
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Kind of hard to know what your issue is without screenshots or more information..
     
  33. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I submitted fixes for these last night, so hopefully UAS will ship them today..
     
  34. itsnottme

    itsnottme

    Joined:
    Mar 8, 2017
    Posts:
    129
     

    Attached Files:

  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Unity's terrain, by default, uses a top down projection- so if you make a completely steep cliff like the one in your image, the UVs will stretch like that. Triplanar texturing is one technique available (there's a module for it) to help fix this; this basically samples the texture from three different directions and blends then, such that the cliff is projected from the side instead of top down.

    Also, your global UV scales being 250 and 208 is a little odd- you usually want those the same..
     
    itsnottme likes this.
  36. robbob44

    robbob44

    Joined:
    Apr 16, 2018
    Posts:
    22
    Thank you. The issues with undeclared identifier 'gVSSunDirection' and 's' appear to be resolved. However I notice my terrain blending no longer seems to be working correctly either. See attached image. The meshes still have their MicroSplatBlendableObjects set and there are no errors/warnings appearing in inspector or in console. During playmode they warn that submeshes cannot be handled properly so only the first submesh will be blended, but we did have the blending working previously. Note that I did not delete/recreate any MicroSplatData files, I just toggled a few of the material settings to get it to update the shaders - let me know if you think this will be required.

    Reason for edit: I didn't update TerrainBlend module to get the new fixes. Above information has been changed to reflect.
     

    Attached Files:

    Last edited: May 4, 2018
  37. robbob44

    robbob44

    Joined:
    Apr 16, 2018
    Posts:
    22
    Disregard my complaint about blending. In my other scene the blending is working more or less as intended so I'm probably the one doing it wrong.
     
  38. superjayman

    superjayman

    Joined:
    May 31, 2013
    Posts:
    185
    I've just imported my project to 2018.1.f2 getting the following error

    Assets/MicroSplat/Core/Scripts/Editor/UnityLDRenderLoopAdapter.cs(11,17): error CS0535: `JBooth.MicroSplat.UnityLDRenderLoopAdapter' does not implement interface member `JBooth.MicroSplat.IRenderLoopAdapter.WriteTerrainBody(string[], System.Text.StringBuilder, MicroSplatShaderGUI.MicroSplatCompiler, int, bool)'
     
  39. Casanuda

    Casanuda

    Joined:
    Dec 29, 2014
    Posts:
    53
    Hi Jason,

    I swapped from Megasplat to Microsplat for ease of use, but something is causing my unity (2018.1 on Mac) to crash.

    The report says: validateArgumentsForTextureViewOnDevice:1051: failed assertion `(newSliceRange.location + newSliceRange.length)(4) must be <= (1).'

    It happens generally when I add more than one texture then select the microsplat material.

    Any assistance would be great.

    Thanks
    Cas
     
  40. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Delete MicroSplat and reinstall it, or just deleting UnityLDRenderLoopAdapter.cs might be enough..
     
  41. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I have heard from one user that this happens to them when they run in Metal- however, it doesn't seem to happen for me when I run in Metal, so I'm not sure what it is. If you can, submit a bug to Unity with the repro and project.
     
  42. Casanuda

    Casanuda

    Joined:
    Dec 29, 2014
    Posts:
    53
    Hey. Thanks for the reply. Re-installed and still persists. Don't seem to have UnityLDRenderLoopAdapter.cs in project though, so can't see if that helps...
     
  43. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    UnityLDRenderLoopAdapter.cs is what's throwing the error- if you double click on the error, it should take you to the script, which should definitely be in your project if it's throwing an error..
     
  44. Casanuda

    Casanuda

    Joined:
    Dec 29, 2014
    Posts:
    53
    Hi, not error. Complete crash and immediate shutdown of Unity. That's why I'm having a problem tracking it down. A manual search after restarting for UnityLDRenderLoopAdapter.cs found nothing.
     
    Last edited: May 5, 2018
  45. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Did you try turning off metal in the settings?
     
  46. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    @jbooth, so my project is realistically locked to 5.6.4f1 - I'm too deep in development to update in the near future.

    Wondering if there's any way to download the most up to date version of microsplat that's compatible w/ the 5x engine?
     
  47. Casanuda

    Casanuda

    Joined:
    Dec 29, 2014
    Posts:
    53
    That fixes it. Turn off Metal editor support and hey presto. Thanks!
     
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MicroSplat is developed in 5.6.1p2, so you should be all set. Only the new lightweight render pipeline requires a higher version.
     
    frosted likes this.
  49. miklelottesen

    miklelottesen

    Joined:
    Mar 7, 2015
    Posts:
    19
    First of all, thanks for making this amazing asset!!!

    I was having a bit of problems with seams inbetween my terrains (using multiple terrains in extension of one another) when tesselation was enabled. Turning displacement all the way down fixed the problem, but that's obviously not desirable. Then I noticed, after spending time tripple-checking that I've set the terrain neighbors correctly, and merged the seams of the heightmaps and alphamaps respectively (to no avail), that the seams disappear completely when setting the up bias to 1.

    I'm probably not going to be using that setting so I don't mind, but I found it a bit odd and thought I'd share my findings.

    Some pictures of the same seam, with different settings:

    bias0.PNG bias1.PNG
     
  50. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    So, when up bias is set to 0, tessellated vertices are displace along the normal of the polygon. So if you have a V in your terrain, with the seam at the bottom of the V, the vertices would be pushed through each other. With an UpBias of 0, displaced vertices are pushed straight up, which means both vertices along the seem are pushed in the same direction regardless of normal angle.
     
Thread Status:
Not open for further replies.