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

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Is this using unity's new multi-terrain stuff where you can stitch them or the old one? Is Draw Instancing on?
     
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
  3. niallmc

    niallmc

    Joined:
    Sep 3, 2015
    Posts:
    44

    This is in unity 2019.1, the terrains have auto-connect turned on. Draw instancing is turned off.
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You might want to try with Draw Instanced on. I'm imagining that they might have not handled the connected features for the old CLOD system, and only for the new system. I don't think there's anything in MS that would do this except if the data for the per pixel normal system was wrong or you applied a global normal not set to clamp.
     
  5. niallmc

    niallmc

    Joined:
    Sep 3, 2015
    Posts:
    44

    I have just tried with Draw Instanced turned on, this does indeed fix it!

    However I cannot use tessellation with Draw instanced, which is really key to our higher end graphics settings. Can't see any global normals not set to clamp.
     
  6. Korathas

    Korathas

    Joined:
    Dec 4, 2015
    Posts:
    4
    Hey @jbooth

    [Edited] Does this asset expose an API for runtime terrain manipulation, or should I be looking into the standard Unity terrain documentation for that? I am looking into creating a map editor for my users.
     
  7. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, most likely unity didn't implement terrain stitching for non-Draw Instanced terrain, just like they didn't make surface shaders handle the instance ID for tessellation in Surface Shaders. I'd file bugs with Unity, though I've given up on them fixing anything with surface shaders.
     
  8. chriscode

    chriscode

    Joined:
    Mar 2, 2015
    Posts:
    48
    Great work this. Very impressed.
    Probably idiot's questions but
    1) is there a way to retain shiniess?
    2) Assuming the shiniess slider on the Unity's terrain layers editor isn't supposed to do anything?

    Unity 2019.3.8f1
    Cheers

    upload_2020-4-7_22-17-8.png
    upload_2020-4-7_22-17-28.png
     
  9. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    I tried Trax in a different environment:

     
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It's controlled by the textures you put in- if you don't provide any, then it generates a smoothness map from the ones you do provide. I believe there are per-texture properties to adjust these up or down as well.
     
  11. PrecisionCats

    PrecisionCats

    Joined:
    Nov 19, 2017
    Posts:
    40
    Do you know why the alphamaps are being offsetted slightly along the z axis compared to the default shader?
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I think Unity may have changed the sampling at some point to center pixels. I'll have to look at the latest shaders and see if this is the case- if it is, I'll add an option for it.
     
  13. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Does turning on/off Draw Instanced make a difference for you? I can't find any offset in their new shaders, which version of Unity are you doing your comparison in, and which render pipeline?
     
  14. PrecisionCats

    PrecisionCats

    Joined:
    Nov 19, 2017
    Posts:
    40
    I noticed your sampling was the one that was offset, because to get very precise sampling of the alphamap in cpu for PSE I made some indicator guides and testing gizmos to make sure I was doing the correct sampling. Default on the left, microsplat is on the right:

    Instanced or not doesn't seem to affect it
    (If it's relevant, for this testing scene I duplicated the microsplat terrain and swapped the material and removed the script. The terrain data remains synched)

    If you want you can try find the problem using: https://github.com/Steffenvy/Precision-Surface-Effects
    (Although I did copy the Microsplat example assets into it, so the guids might conflict.)
    Unity version 2020.1.0b1.3256
    Default RP
     
    Last edited: Apr 10, 2020
  15. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461

    Yeah, looks like this is a fairly new thing. Makes sense to center the samples, though. I'll add this.


    float2 splatUV = (IN.tc.xy * (_Control_TexelSize.zw - 1.0f) + 0.5f) * _Control_TexelSize.xy;
     
  16. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    I wanted to try the Digger integration. First test:



    I didn't expect digging holes to be such fun :D
     
    camta005 likes this.
  17. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    It looks Iike a video of my last colonoscopy o_O

    Just kidding, thx for sharing @Rowlan , always useful to see this great asset in action.
     
    Rowlan and camta005 like this.
  18. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    Here's Trax with a car :D

     
    OdderOtter, osss, camta005 and 3 others like this.
  19. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Cool! when this will be available? Is it compatible with mobile devices?
     
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Sorry, missed this the first time. You just use the standard Unity terrain API.
     
  21. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It's submitted, so whenever Unity approves it. It would technically work on mobile, but it's likely a heavy effect for low end mobile devices, so depends what you're aiming for. For low end mobile, some kind of trail rendering/decal might be a better fit, though obviously it won't get the same kind of effects. If you were doing a mud runner or something, then you could likely account for the effects cost and budget accordingly.
     
    Certa11n likes this.
  22. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    I'm doing an offroad game with some mud sections, so no 100% mud environment.
     
  23. Berir

    Berir

    Joined:
    Mar 23, 2013
    Posts:
    55
    Hi
    I am new to MicroSplat as well as to Terrain in General I have not done anything with Terrain till few weeks ago!
    I came across MicroSplat on you tube and after watching several videos I was really impressed that I purchased almost all modules, even though not sure I will have use for all!

    I am a total noob when it comes to Terrain and have some questions I hope someone can answer and forgive if they are too basic!

    First I am using Unity 2019.3.6 the latest instalment, is Microsplat working ok with this version?
    Because I had some issues and can't tell is it an error or am I doing something wrong...

    I am working on a map that needs to be tile- able kind of like x com or board games tile- able maps!
    problem with terrain in unity is it cant be rotated to be used in the Tilemap generator!

    So I was hoping if I turn Terrain Tile into a mesh terrain via MicroSplat this could do the trick!

    My first few attempt went bad I tried converting using Quality and Balanced settings both gave me messed up results
    I did go into configuration to add missing height and AO map as well as clicked on Update but my terrain tile was still
    messed up and textures were blown out of proportion and Tessellation on produced some weird arrow looking engravings!

    upload_2020-4-12_13-23-34.png


    Can someone tell me why is this happening and what in my unity settings could cause this?

    Next I tried converting Unity Terrain tile into MicroSplat using Performance settings.
    AND WOW
    with one click of a button it all came looking correct all I had to do is select material and set interpolation contrast to 1
    to get same texture blending as in Unity …
    upload_2020-4-12_13-32-51.png
    I have to say it looked great if not even better particularly considering MicroSplat setting was lower resolution only 1024 whilst my original Unity setting was 2048...

    from here converting this into mesh was also easy … but when rotated my tiles seems are too obvious... this has nothing to do with MicroSplat nor unity … because terrain was never meant to be rotated, but I do need a way
    to fix this issue!

    My first noob idiotic question is About maps in Configuration settings , Is smoothness same as roughness map?
    If I have a roughness map from some other source do I need to invert it to be smoothness? or is it same thing?

    My 2nd question is about exporting maps, I use 5 textures each have Albedo, Height, AO and Normal map

    Can I export for example all 5 normal maps from my all textures Into one single blended Normal map ?
    if so how would I go about it?

    Because I need these tiles to have seamless tiling when they are rotated, and easiest way I can think of is using offset filter in photoshop and then repainting seems with clone stamp… but first I need a way to export maps!
    is there a way to do this in Unity?

    I though of offsetting UV global in Microspalt in x and Y painting then offsetting back … but I am not sure it can be done this way ! I did not see any difference...

    or should this be done in substance ? I noticed substance is not supported in latest unity version!
    I also tried exporting SplatMap to Maya but it did not recognise Microsplat material and maps

    I did try baking Everything and even single maps as well as exporting but I could not see anything happening nor any new files created! Unity kind of froze couple of seconds and that was it …. I would appreciate any help … thanks in advance
     

    Attached Files:

  24. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    1. Smoothness is 1 - Roughtness, Unity just bucked the industry standard for some reason. There's an invert setting on the texture array config you can use if you have roughness maps that will do this for you.
    2. Do you mean put them on an atlas? Or do you mean bake out the result of the splat mapping into a single diffuse/normal texture set? The later is available using the RenderBaking area on the terrain component.
    3. I'm unclear if these are meshes in your final workflow or terrains, and if your plan is to use the MicroSplat shader in runtime or bake out the result of your painting. The UVs of a terrain go from 0-1 over the terrain, if you turn that into a mesh using my MeshTerrain workflow, you can rotate the terrain and it will rotate with it, unless you are using worldspace UVs or triplanar texturing. On the later there is an option to do triplanar in local space instead of world space though.
    4. Substance is supported via the new substance plugin, as unity removed direct support.
     
  25. Berir

    Berir

    Joined:
    Mar 23, 2013
    Posts:
    55
    hey thank you for a quick reply those are meshes , but I do keep MiscroSplat version as well!



    Yes I would like to bake it out so I can take it into photoshop ! I plan to bake out result of my painting
    and then after editing it in photoshop reimport back to Unity!

    upload_2020-4-12_15-48-7.png

    Yes that what I am looking for, to bake out all maps and end up with just a single Diffuse, Normal, Height and AO map, rather then having 1 for each of my 4 textures ...

    But after selecting Normal type map and hitting export selected button, I can't see where is the baked map placed?

    I assumed that export button under import splatMap is where I picked folder but it does not seems to work... what I am doing wrong? I select my Terrain and in Inspector under micro Splat Terrain I select type of map and then hit export, should I be doing something else? Thanks
     

    Attached Files:

  26. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It's written into the MicroSplatData directory that the material is in.
     
  27. Certa11n

    Certa11n

    Joined:
    Feb 5, 2020
    Posts:
    6
    Hello, I bought Microsplat quite a while ago and just now enabled it on my terrain, however there’s one issue I’m quite concerned about
    Before Microsplat I could blend the terrain textures without any issues, while now (yes, I have tried all blending modes, disabled height stuff etc) it creates some sharp edges with only some specific textures. Is there any way to fix this as currently the only way I have found is to spend a lot more time into blending textures until the borders somewhat go away?
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    what do you have your blend quality set to? It almost always wants to be on best, unless the terrain is only going to be in the distance.
     
  29. Certa11n

    Certa11n

    Joined:
    Feb 5, 2020
    Posts:
    6
    It’s on the highest setting possible, I can send a picture of the borders later. Basically when you try to paint over some textures it’ll try to overlap it completely and therefore creating low-opacity borders which are extremely noticeable, especially on cliff sides
     
  30. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Send a screenshot of your shader settings (top section of the material)
     
  31. Berir

    Berir

    Joined:
    Mar 23, 2013
    Posts:
    55

    Please Help I am loosing my mind, I just don't understand what I am doing wrong nor why is it not working!
    thank you so much

    upload_2020-4-13_11-43-3.png
     

    Attached Files:

  32. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
  33. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    Random fun experiences with Microsplat Digger integration, the ideas just keep on coming while you dig :D

    eggs 2.jpg
    eggs 4.jpg
    eggs 1.jpg

    Edit: couldn't stop, so I went to SketchFab and downloaded a Xenomorph, credits to Henrique Naspolini for the Alien :)

    eggs 7 - xeno raven by Henrique Naspolini.jpg

    and different lighting:

    eggs 8.jpg
     
    Last edited: Apr 13, 2020
    JBR-games and camta005 like this.
  34. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, it should just stick them in that data folder named <terrain>_normal.tga.
     
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
  36. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    Apologies for the image spam, but this is too much fun :D

    worm - 01.jpg
    worm - 02.jpg
     
    ftejada and camta005 like this.
  37. Korathas

    Korathas

    Joined:
    Dec 4, 2015
    Posts:
    4
    Thanks!
     
  38. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    Combining MicroSplat Trax with Digger and the MicroSplat Digger module just begged for this :D

     
    camta005, JBR-games, jbooth and 2 others like this.
  39. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    https://snipboard.io/pw1ZAy.jpg
    And how would I go by disabling Curve Weights?
     
  40. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You're in a version before it was added, so likely not that. I'd update to latest, change an option on the shader, and see if you're still having the issue. If you are, try disabling and re-enabling things to see if you can figure out which feature it might be coming from.
     
  41. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    Unity has the Tanks Tutorial. I wonder how it would play if you do it with this concept I just created :D

     
  42. andenybe

    andenybe

    Joined:
    Sep 16, 2017
    Posts:
    5
    Fantastic! Any plans to include digger module and the upcoming trax module in the terrain collection asset?
     
  43. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    Removed the terrain (only a test), changed the mode to "Quality" and then it got rid of the borders. Tried by changing the settings on the old one but nothing worked
     
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Nope
     
  45. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Did you try upgrading to the latest? I can't do support for old versions, I'd just be refixing bugs which are already fixed.
     
  46. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    HI @jbooth !!
    I am thinking of migrating to HDRP and for that I would need to abandon Megasplat and buy Microsplat with the HDRP module. But I have a couple of doubts

    In the limitations of the HDRP module for Microsplat comes "Render Baking", does this mean that you cannot bake the lighting of the scene if my terrain uses HDRP microsplat?

    Buying the HDRP module makes the other modules that I bought for Microsplat work, with the exception of Mesh module ?? for example the "TextureCluster or Triplanar?

    Cheers
     
    Last edited: Apr 15, 2020
  47. TurboHermit

    TurboHermit

    Joined:
    Dec 20, 2011
    Posts:
    40
    Hey there!

    Does MicroSplat compile a shader/variant per terrain it's applied to? I've been hitting really long build times which mostly consist of MicroSplat shader compilation times per scene. Since we have a ton of scenes (~600), each with a unique terrain, build time spike to more than 45 minutes.

    If this is not the case, would anyone know what could cause this behaviour? Note that the build times only take around 5 minutes when not using MicroSplat shaders and components.
     
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No, render baking is baking out textures from microsplat of the final result, like albedo or normal maps. The mesh module will work with HDRP, just not the vertex workflow. I've been working on a compatibility chart to make things more clear:

    https://docs.google.com/document/d/1xWsJF2qL0KRarzQLknnJsDF-kevs7KnhaletBfWhsE0/edit
     
    JBR-games likes this.
  49. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    That depends on how you set it up. You can have one shader shared among many terrains, or a unique one per terrain. MicroSplat doesn't use shader variants, other than the ones Unity uses in the surface shader system internally, so compile times should be really fast- in fact, you see one every time you change an option in MicroSplat and it regenerates the shader. Are you sure it's the MicroSplat shader taking the time, and not perhaps the one that gets compiled before or after it?
     
  50. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Thanks for your quick response @jbooth .
    So I understand by your answer that with HDRP the Triplanar and TextureClusters modules would also work? since they are the ones that interest me the most
     
Thread Status:
Not open for further replies.