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

    I was referring to the height maps in your textures. That, and the interpolation contrast, primarily control how things are blended.
     
    protopop likes this.
  2. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    Thank you - you led me in the right path:)

    I turned on anti tile array in the config file, and I put the same normal map in all of the noise normal slots for each terrain texture. Now I get solid coverage.

    Screen Shot 2020-09-27 at 10.53.56 PM.png

    EiqxtgDWoAApPQi.jpeg
     
  3. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    upload_2020-9-28_15-34-30.png HI,

    Can you tell me if this is related to microsplat? or else?....Maybe the reason is obvious for some of you...
    i have some black pixel on my terrain. Never oticed that before...
    upload_2020-9-28_15-34-30.png
     

    Attached Files:

    Last edited: Sep 28, 2020
  4. ibernd

    ibernd

    Joined:
    Jun 24, 2019
    Posts:
    16
    Hi!

    I'm trying to create a terrain with ski slopes including (real-time) tracks and so far I haven't found a good solution.

    An open-world game for mobile "Grand Mountain Adventure" has a solution that seems good to me.
    According to the blog entry, the tracks are generated with a large bump map that is updated during runtime.

    Is it possible to do something like this with the micorsplat terrain collection? I was thinking of the global texturing module (with normal map), but I'm not sure if its possible to change it dynamically.

    Or is it possible with the Trax Module? (because of mobile, it has to work without displacement/tesselation)


    Screenshot from Grand Mountain Adventure:
    Blog entry: https://80.lv/articles/developing-a-ski-open-world-game-for-mobile
     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Trax generates a normal map as well as allows changing the texture itself, so tessellation is not required. You could do it by generating a global normal map, but most likely you would need a very high resolution texture, where as Trax can have it's texture stretched over an area around and moving with the player.
     
  6. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    protopop likes this.
  7. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Does anyone know how I can integrate a toon outline effect with microsplat? I understand this is a post effect, but I'm just not sure how I can apply it to the terrain specifically. Normally I would just add another material to the renderer component, but Terrain doesn't have one...
     
  8. jimmygladfelter

    jimmygladfelter

    Joined:
    May 3, 2020
    Posts:
    83
    Hello!

    Im having a bit of trouble making a standalone, Im using Microsplat Version: 3.5101 with MapMagic2 and when I make a standalone build, everything renders except the terrain textures:


    This is my material settings:
    upload_2020-10-5_22-10-37.png

    Any ideas on what might cause this?
    Im not seeing any log output even in dev. mode build....

    I made a build with one of your examples and it was fine. Im thinking it maybe has something to do with the custom splat maps but Im not sure. Im still fairly new to all of this.

    It seems that if I have a terrain already rendered in the scene, it works; however, if I make a build where mapmagic just generates it (no terrains visible on start), I get the above screenshot. Im wondering if a certain shader or shaders dont get added because its dynamically generated and doesnt see it when I make the build of the current scene? Im not sure how it knows what shaders to use when making a build....just a guess..
     
    Last edited: Oct 6, 2020
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    That would be my guess as well; when Unity builds, it does everything via references- if MM doesn't keep some reference to something it needs, I could see this happening. You could work around it by explicitly referencing the shaders/data in the MicroSplatData directory, or by adding them to the list of shaders which are always included in a build in the build settings.
     
    eaque and jimmygladfelter like this.
  10. Gushgarak

    Gushgarak

    Joined:
    Mar 21, 2018
    Posts:
    12
    Hello everyone !

    I like you am a huge fan of Microsplat so far (but I am still a very green user). I've just started playing with the Triplanar module and its great. However one thing bother me. I can't find the "Disable Triplanar" on the Per Texture window (see print screen below). If this help I am using also the URP plugin.

    Anyone can help me to figure out where my mistake is ?

    Many thanks for your kind help.

    upload_2020-10-7_23-55-40.png
     
  11. jimmygladfelter

    jimmygladfelter

    Joined:
    May 3, 2020
    Posts:
    83
    So I tried to manually set the 'always include' terrain, but I still do not see any terrain textures when using microsplat terrain:

    upload_2020-10-7_20-7-59.png

    Im using standard pipeline with deferred rendering.

    Any other ideas?
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It's called "Triplanar Projection". There's also rollover help on every property in case you wonder what one of them does..
     
  13. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Write a component to print out the properties of the terrain and MST component, see what it logs- something is not getting loaded, so figure out what is null that has a reference set in the editor and you'll likely find your issue.
     
    jimmygladfelter likes this.
  14. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    do microsplat decals support
    Tessellation with displacement mapping and/or Parallax Offset Mapping
     
  15. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Tessellation, yes, POM, no..
     
  16. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    I'm not using Terrains anymore for my ground but using MS Meshes. I have 2 sets of meshes, one set for more grass/organic grounds and another set for asphalt/tarmac/roads.

    I have 2 MS sets of 16 textures each. My question, is Microsplat will be more efficient if I keep them separate or is it better to merge them in one big 32 textures set ?

    My scenes are streamed so those meshes all loaded/unloaded as I move.

    thx
    Chris
     
  17. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    If you have a 32 texture setup, it's going to allocate splat maps for 32 channels of data (8 textures), so having them split (4 textures) is better.
     
    f1chris likes this.
  18. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    Try switching between forward and deferred rendering.

    Try turning Terrain Instancing on and off on your terrain

    Try enabling and disabling Anisotropic filtering in your project.

    See if any combination if these works.
     
    jbooth and jimmygladfelter like this.
  19. Dobalina

    Dobalina

    Joined:
    Sep 6, 2013
    Posts:
    105
    Sorry if this has already been addressed, I couldn't find any resolutions on this forum. I'm encountering the Microsplat Anti-Tiling not working due to a version conflict. I'm on 3.5 and all my microplat addons are also up to date, though Anti-Tiling claims to be on 3.4. I tried removing Anti-Tiling from my build and re-importing but still claims to be out of date. Any thoughts? I'm on Unity 2018.3.8 / standard render pipeline. I didn't have this issue prior to updating to 3.5.
    upload_2020-10-9_15-1-9.png
     
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    you need to update it to 3.5 from the asset store..
     
  21. Dobalina

    Dobalina

    Joined:
    Sep 6, 2013
    Posts:
    105
    That's what I mean. Deleting my local Anti-Tile files and then grabbing the latest Anti-Tile from the asset store results in it claiming to be v3.4. All the other addons updated to 3.5 with no issue. If my packages were out of date, I imagine the circled buttons in this image would say "update" and not "import".
    upload_2020-10-10_8-47-41.png
    To make sure I was grabbing the latest I did the following:
    -Deleted my Anti-Tile Local files
    -Deleted the Anti-Tile package under the AppData folder
    -Restarted Unity
    -The button on Anti-Tile package on the asset store says "Download" instead of "Import" or "Update".
    -Downloaded it. Everything in the list is claimed "new" prior to clicking import. Though after it imports, it still claims to be 3.4.
     
    Last edited: Oct 11, 2020
  22. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Not sure, somehow you're not getting the latest version from the asset store. Maybe try in a new project? I just downloaded to make sure it's 3.5 on the store and got the correct 3.5 version when downloading.
     
  23. p2sapps

    p2sapps

    Joined:
    Nov 18, 2017
    Posts:
    2
    I just purchased and imported MegaSplat and went to begin walking through examples to get a handle of it.

    When I loaded the Mesh example, the scene loaded, and the terrain splat meshes were all the pink missing texture material. It is a completely fresh URP project on 2019.4.11f1. This was the same for any of the other examples as well.

    Am I missing a configuration step for the examples, or does anyone have some quick advice on how to remedy this?

    Thanks, looking forward to this (hopefully

    -------

    Ok, I just tried creating a new 3D project with built-in renderer, and it seems to be working.

    I might have missed this in the docs or description, but is MegaSplat not compatible with URP or HDRP, or are there config steps to take to make it work in those pipelines? Please forgive my ignorance :)

    ) Screenshot 2020-10-12 192549.png Screenshot 2020-10-12 192243.png
     
    Last edited: Oct 13, 2020
  24. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MegaSplat doesn't support URP, and this is the MicroSplat thread.
     
  25. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Hi, Jason. Does MS Mesh Workflow overlay mode support HDRP shaders? I just tried today and can not find a way to expose the custom shader.. Filling the 0 index did not work out, and it just filled the 0 index texture in the array. I am using Unity 2019.4.9f1, by the way.
     
  26. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Hmm, yeah, I'll have to test this- the overlay mode requires special blending, and I could see an SRP template not supporting that correctly. Combined and splat should work fine though..
     
  27. StrategyTron

    StrategyTron

    Joined:
    Feb 20, 2019
    Posts:
    26
    Hi Jason, I got a question regarding one of your assets that I purchased a while back, the "Stochastic Height Sampling Node for Amplify Shader Editor". Very nifty asset by the way!

    Anyways, so my question is if there is a way to make the Texture input for the node be able to receive RGB or HSV?
    There are some things I'd like to do to modify some textures, and then I'd like the final output to go to the Stochastic Sample 2D node, but it only takes a Texture for input.
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No, stochastic has to sample a texture- it basically samples a texture 3 times from different offsets and blends them, that's not something you can do from a color value.
     
  29. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    276
    Unity support tracked it down to the UNITY_VERTEX_OUTPUT_STEREO semantic in the vertex shader input. Here's what they said:

    "The appdata struct provided to the vertex shader contains the semantic UNITY_VERTEX_OUTPUT_STEREO - this is a pixel shader semantic. In a non-VR build or a PC VR build the semantic should just get stripped, but with PSVR it's causing compile errors which then produces the run time behaviour. Therefore, to fix this, in Microsplat.shader and Microsplat_Base.shader, remove UNITY_VERTEX_OUTPUT_STEREO from the struct appdata { } section, and put it in the struct Input { } section (at the end is fine). Note that because these shaders are generated, this should also be changed in microsplat_shared.txt for a persistent fix."

    This does fix the issue but the project I sent them was stripped down and the two shaders were easy to find. In the real project, there are numerous instances of them all over the project. Is there a way to make the change in the microsplat_shared.txt they indicated and have all the existing shaders regenerated?

    Thanks,
    Reggie
     
  30. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You'll have to find them all manually - no way to do it automatically currently.
     
  31. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Yes,combine and splat mode seems fine in the example project, and I will expect your next update. And I have another problem for your help, Jason:D
    You should be able to repro it in this way:
    First, enable "Light Layers" in the HDRenderPipelineAsset properties.
    Second, select the terrain and check "Draw Instanced".
    Then the MS terrain start flickering...
    I have made sure that these two steps are necessary in our HDRP project. So could you tell me why this is happening, and how this flicking could be prevented?
    I'm still using the same version of Unity by the way.
     

    Attached Files:

  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Light Layers and shaders in HDRP are undocumented by Unity, so I have no idea what the shader needs to prevent this. The template I use to generate the shader code is from the shader graph, and when you add instancing support to it, this is what happens- but without any documentation or feedback from unity (there's already forum posts about this from multiple people) it's not probable to figure out why. Likely this is one of those things like Terrain Instancing and Tessellation in Standard pipeline, where it's some combination they just don't handle. If you want stability, use a stable pipeline- SRP's are dark and full of terrors.
     
  33. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    276
    Can you make that change in the base code so that I don't have to go and change it back every time I update Microsplat?
     
  34. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
    We're seeing that the terrain textures are loaded twice in the memory profiler, once normally because of the Terrain, but Microsplat itself uses an Texture2DArray. These are both loaded at the same time.

    Is there any way to avoid this, and only have the Texture2DArray loaded?
     
  35. p2sapps

    p2sapps

    Joined:
    Nov 18, 2017
    Posts:
    2
    The support link on the Megasplat asset in the asset store linked to this thread. Might want to get that fixed if it is going to bother you to have Megasplat questions being raised on this thread.
     
  36. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah..

    Yeah, there's an option on the Texture Array Config called 'Shrink Source Textures'. It's not done by default because someone might be using those textures on non-terrain objects. This will reduce them in size, but not remove them, because if you remove them the Unity Terrain system will remove your splat maps..
     
    TJHeuvel-net likes this.
  37. StrategyTron

    StrategyTron

    Joined:
    Feb 20, 2019
    Posts:
    26
    Jason,

    Well, that's unfortunate to hear, but I do appreciate the quick reply. Thank you.
     
  38. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Thanks for your reply, Jason~ So hopefully we will post Unity for some solution about this one and let you be informed:D
     
  39. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
    Thanks for the quick response, i dont see it however? upload_2020-10-15_9-23-47.png
    Or am i supposed to set the source texture size to k32? What does K32 mean?
     
  40. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    32x32 pixels in size.
     
  41. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    I'm using MapMagic2 which outputs to MicroSplat, but when I enable terrain-blending the terrain becomes invisible.

    With it disabled, it renders fine:

    Any ideas?
     
  42. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Well, map magic doesn't have a way to generate the terrain descriptor, which is needed for blending. But I'd expect that would just make the objects not blend right, not cause the terrain to disappear. It does look like you have a number of errors in your console though, so perhaps something in there.
     
  43. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Those are errors in other plugin shaders that have some incorrect hard-coded paths, I don't think it's related but I'll try and fix them all and see if it helps.

    Does this mean that MM2 + MicroSplat is not going to work for Terrain Blending? What about other features like Splats, Trax etc? I also notice that tri-planar breaks completely when I enable it, but not sure which plugin maker to log the bug with...

    We bought every module + URP support so it would be a shame if we can't use them with MM2 which we're rolling with for proc-world gen. Is this largely on the MM2 devs to implement, or is it just not really possible?

    [Edit] if it helps, I see this error in the Terrain settings when TerrainBlending is enabled:
     
    Last edited: Oct 16, 2020
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MM2 would need to output the terrain descriptor data- which isn't hard, it already has the information it needs to generate it (it's just an RGBA half texture with height/normal in it), but currently it doesn't support that. Not sure what you mean by "splats", but features which don't need the terrain descriptor should all work fine with MM2 (ie: Streams/terrain blending use the terrain descriptor texture). That warning can be ignored.
     
  45. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Sorry I meant decals, and ya was just looking for clarification on which features would be impacted by this, I really have no idea what Terrain Detail Data is, let alone what modules depend on it. So just to confirm, everything except Streams/Blending are expected to work?

    Thanks for the info, I shall take this over to Denis :)

    Regarding Tri-Planar, is this also some issue with MM2's output? I lose all texture details when switching:
    http://screens.gskinner.com/shawn/2020-10-15_23-34-04.mp4

    [Edit] I've fixed all the errors, there were Shadergraph caching issues, just had to re-open a bunch of SG files and save them for some reason. No effect on MicroSplat, same dissapearing terrain issue and tri-planar oddities
     
    Last edited: Oct 16, 2020
  46. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Hi, Jason. About the Mesh Terrain Module parameters, I see that "Sub Divisions" has a up limitation of 170. Does this mean that when I try to convert a terrain equal with or larger than 256 meters with 1 meter per grid, I'll have to split the terrain mesh into more than one chunk if I want to keep the same resolution? If so, is there a reason for that limitation?
     
  47. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Dynamic Stream, yes- regular painted streams work fine, but if your generating on the fly you don't really have a way to paint them.

    You need to adjust your UV scale. UV Scale in UV mode is based on the terrain UVs, which are 0-1 across a terrain, so 1 is like 512 meters or something. UV scale in triplanar is based on world space, which is 1 meter in size.
     
  48. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    That was it, thx! Triplanar UV Scale was defaulting to .01, setting to 1 fixes it:


    Tri-Planar on Left, texture is still WIP
     
    camta005 and Rowlan like this.
  49. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    I just have to say: what an awesome style. Please do show more :)
     
    camta005 likes this.
  50. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
Thread Status:
Not open for further replies.