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

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    yes there is
    upload_2019-12-19_21-27-25.png
     
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Is this with the latest from the store? Can you show me a screenshot of the features you have turned on/off?
     
  3. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    yes last update from the store

    upload_2019-12-20_17-6-4.png
     
  4. GCatz

    GCatz

    Joined:
    Jul 31, 2012
    Posts:
    282
    MicroSplatConfig corrupts the diff_tarrary's images with 'force crunch' mode
    had any luck with that ?
     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    what platform?
     
  6. GCatz

    GCatz

    Joined:
    Jul 31, 2012
    Posts:
    282
    WebGL

    and btw the links from inside the microsplat material for the addons are broken
     
    Last edited: Dec 31, 2019
  7. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    First image is a reference from World Creator where it was rendered. Keep in mind that World Creator has higher quality render with Raymarching and Unity stuff won't look 1:1 :). I also failed to reproduce the colors with color grading in Built-in PP stack. Yes i use Built-in since in HDRP a lot of stuff don't work (Enviro etc.).

    Terrain was created with World Creator Standalone (PRO) and Quadspinner GAEA. Textures are from Gametextures.
    In Unity obviously Microsplat as terrain shader and Enviro for light and atmosphere.
     

    Attached Files:

    • 0.jpg
      0.jpg
      File size:
      797 KB
      Views:
      497
    • 1.jpg
      1.jpg
      File size:
      295 KB
      Views:
      502
    • 2.png
      2.png
      File size:
      2.4 MB
      Views:
      497
    • 3.png
      3.png
      File size:
      2.3 MB
      Views:
      501
    • 4.png
      4.png
      File size:
      2.3 MB
      Views:
      480
    midian808, eaque and camta005 like this.
  8. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    great pics!! :)
     
  9. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    I'm getting an occasional tiny crack when using tessellation, 2 or 3 pixels flickering when moving the camera.
    Any tips on how to fix this?
     
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Is this between terrains? If not then its likely something GPU or driver specific, or possibly related to instancing as the old terrain is a continuous mesh.
     
  11. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    It's tiny cracks in the tessellated geometry testing on a single terrain.
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Is terrain instancing on?
     
  13. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    No, the terrain disappears if draw instanced and tessellation are on at the same time because of the Unity bug.
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Right- both at once do work in LWRP though. Well, in that case it's got to be some kind of GPU/Driver bug, because the mesh is continuous and the tessellation code itself cannot introduce cracks that way, only the hardware or driver under it. With instancing, the same geometry is duplicated for each LOD, so there would be the possibility of cracking there if Unity's geometry wasn't done correctly.
     
  15. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    Sorry I should have mentioned that I was using deferred rendering in Unity 2018.4 LTS (I have the luxury of staying well away from the SRP for a while lol).

    It seems odd because I haven't seen a crack in the regular terrain before, and I know tessellation can have issues with cracks caused by precision.

    I can't see it in the tessellation demo at first, but I can replicate it there with a few steps:
    - Set the skybox exposure to bright white and the ambient lighting to gradient instead of skybox.
    - Set the global uv scale in microsplat to 0.1 or change the textures to a dark uniform color.
    - Move in and out with the camera around tessellated areas and look for white pixels.
    - with a white pixel on the screen change the tint of the skybox to another color to verify the crack.

    This was observed at a screen resolution of 1360 x 768 so you might need to lower your screen res to see it.

    Edit: I just updated the driver for the graphics card (nvidia geforce GTX 970) and the issue is still there.
     
    Last edited: Jan 2, 2020
  16. niallmc

    niallmc

    Joined:
    Sep 3, 2015
    Posts:
    44
    Hey Jason

    Is it possible to allow the per texture normals to go beyond the value of 3?
     
  17. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Sure, but at that point why not edit the source texture?
     
  18. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Can this be used with forward rendering? ( I didn't see it say it didn't so I assume yes. but I figured to ask. Thanks.


    FYI: alot of your add ons on the front page of this forum are dead links. not all but a lot of them. Just figured to let you know.
     
    Last edited: Jan 4, 2020
  19. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    First image is a reference from World Creator Standalone PRO :)

    In Unity Micro + Enviro + Aquas + Gametextures. Terrain made purely with World Creator Standalone PRO
     

    Attached Files:

    • 0.jpg
      0.jpg
      File size:
      813 KB
      Views:
      458
    • 1.png
      1.png
      File size:
      2.8 MB
      Views:
      483
    • 2.png
      2.png
      File size:
      2.9 MB
      Views:
      481
    • 3.png
      3.png
      File size:
      2.9 MB
      Views:
      484
    • 4.png
      4.png
      File size:
      2.8 MB
      Views:
      483
    Mauri and camta005 like this.
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, it supports forward, deferred, etc. Yeah, they changed the link format, I just finished doing the in-app ones last night and will update these as well..
     
    recon0303 likes this.
  21. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MicroSplat 2.9 sent to the store this morning..
    • Minimum Unity version is now 2017.1
    • PerTexture Properties maximum increased to 32x4. This requires regenerating your shaders by changing any option on them, otherwise per-texture properties will not look correct.
    • When using an SRP, shaders are now generated for the active SRP when created
    • Per Texture UV Rotation option added
    • LWRP/URP module rewritten to better share between unity versions
    • Texture Format falls back to best option on android
    • Texture array importing now faster when working with multiple assets that use OnPostProcessesAssets
    • Fix to compile error when using world UVs and glitter
    • Size of MicroSplat components reduced when modules are not installed
    • MicroSplatTerrainMesh had some missing overrides that were added
    With it the new mesh module was submitted:









     
    GCatz, sjm-tech and Marco-Sperling like this.
  22. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Can local space textured objects be static batched? Would it require baking down the effect to the albedo? Or are these shaders using instancing?
     
  23. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The shaders support instancing, and the material system is smart enough to only create a new material when it's unique- it basically keeps a hash and registry of all material overrides and will create/recycle them as needed. If the material has no override data, then the base material can be used and I believe the object can be statically batched (I haven't tested this though, so will have to check to make sure). If you bake everything down, then it's just a regular mesh/material again, though obviously at that point you may have resolution issues.
     
    Marco-Sperling likes this.
  24. uwalkin

    uwalkin

    Joined:
    Jan 20, 2019
    Posts:
    2
    Hi!

    In the documentation under "Mesh Workflow" it says to add the "Micro Splat Mesh" component, but there is no such component in the core files. So then i bought the "Mesh Terrain" module, but the component wasn't there either. Could you point me to where to find that component / the mesh capabilities?

    Regards,
    uwalkin
     
  25. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The mesh module isn't out yet. It's been uploaded to the store, but Unity hasn't approved it yet. If you need a refund on the Mesh Terrain module because it's not of use PM me your invoice.
     
  26. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    Try Unity 2019.217 and Unity 2018.4.6, have the same problem. New project, clean installation.
    upload_2020-1-12_20-25-26.png

    and the other one(
    upload_2020-1-12_20-35-21.png
     
    Last edited: Jan 12, 2020
  27. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You sure you have the latest versions? Both of these were fixed ages ago.
     
  28. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    My apologies for the unnecessary concern. You're right. When you logged out it installs the old version from cache, but it's looks like normal installation. Sorry about that.
     
  29. theFireman

    theFireman

    Joined:
    Nov 28, 2015
    Posts:
    4
    Hey,
    I just switched my terrain to microSplash and I really like it!
    I couldn't find an answer to this question, but is there a way to access the "Per Texture Properties" via Code?
    Like if I want to change the Smoothness Strength of my 6th texture via myMaterial.SetFloat, how would the float be called?
    Sorry if this is a stupid question
     
  30. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Per Texture properties are stored in a small 32x32 lookup texture. If you look in the MicroSplatPropData class, you will see a list of how they are organized. Essentially you need to set the pixel for the texture index you want to change and whatever values you want them to be. Note that you cannot turn them on/off by code, because that requires regeneration of the shader code.
     
    theFireman likes this.
  31. theFireman

    theFireman

    Joined:
    Nov 28, 2015
    Posts:
    4
    Thank you! I managed to accomplish, what I wanted.
     
  32. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Hello Mr. Booth;

    I'm dynamically spawning water emitters using Map Magic. Early results are that emitters I place manually (at edit time) work but those I create dynamically do not work.

    Before I dig in too far, would you anticipate this behavior with dynamically created emitters?
     
  33. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I would expect it to work.. if you look at the emitter code it’s pretty simple; basically registers into a list of emitters.
     
    mmaclaurin likes this.
  34. niallmc

    niallmc

    Joined:
    Sep 3, 2015
    Posts:
    44
    Hey @jbooth, I am trying to swap 2 microsplat materials on the terrain at runtime in the build. I have the microsplat and microsplat base shader for each added to the 'Always included shaders' in the project settings. But when I swap the material at runtime in the build, the terrain disappears. I can still see the basemap terrain in the distance, but any part of the terrain near to me is invisible.

    Any ideas on it?
     
  35. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    Microsplat + Enviro + Aquas. Terrain created with World Creator Standalone PRO + GAEA PRO. Textures are from Gametextures.

    Image 0.jpg is a reference taken from World Creator.
     

    Attached Files:

    • 0.jpg
      0.jpg
      File size:
      692.3 KB
      Views:
      468
    • 1.jpg
      1.jpg
      File size:
      486.3 KB
      Views:
      479
    • 2.jpg
      2.jpg
      File size:
      234.4 KB
      Views:
      465
    • 3.jpg
      3.jpg
      File size:
      162.8 KB
      Views:
      466
  36. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    after you swap the materials you need to call Sync on the MST component or the static SyncAll() function. You shouldn’t need to put the shaders in the always include directory if you have a component pointing to the materials; however you should also keep a reference to the propData object’s and any other runtime references of the MST component that it uses, as you’ll need to swap them as well..
     
  37. niallmc

    niallmc

    Joined:
    Sep 3, 2015
    Posts:
    44
    Thanks for that, I am calling Sync() and I've added the propdata component which I found on the MST under Debug.
    I've also included a screenshot of the terrain appearing in the distance but not close up.

    When I switch back to the first terrain it appears again as normal. This only happens in the build. Here's the code:

    Code (CSharp):
    1.  public void SetTerrainQuality(int quality)
    2.     {
    3.         if (quality == 0) {
    4.             microSplatTerrain.templateMaterial = microSplatLowMat;
    5.             microSplatTerrain.propData = microSplatPropDataLow;
    6.         }
    7.         else
    8.         {
    9.             microSplatTerrain.templateMaterial = microSplatHighMat;
    10.             microSplatTerrain.propData = microSplatPropDataHigh;
    11.         }
    12.  
    13.        
    14.         microSplatTerrain.Sync();
    15.     }
    16.  
    Am I missing some part? either way, thanks for your help.
     

    Attached Files:

  38. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It would depend on what features your using as there might be other things you need to copy, but nothing comes to mind. You do know that MicroSplat already reduces shader complexity in the distance; are you sure you even need to do this?
     
  39. niallmc

    niallmc

    Joined:
    Sep 3, 2015
    Posts:
    44
    Yeah it's to give the player an option of a terrain with and without tessellation, it's pretty vital from a performance standpoint for our game. I have searched through the MST class and see: perPixelNormal, Stream Texture, terrain description, vsGrassMap, vsShadowMap, blendMat, I will try adding whichever I can and let you know if It doesn't work. Sorry to be a pain.
     
  40. AtomicIsland

    AtomicIsland

    Joined:
    Sep 20, 2018
    Posts:
    12
    Hi @jbooth, I've been working on setting up MicroSplat for use in my project and I can't seem to get ambient occlusion to work with my imported Substance materials. As far as I can tell I've assigned all my texture maps correctly, and everything looks great, except that the AO map has no effect. Under the Per Texture properties, I've tried checking AO Strength and turning it up to the maximum value, and there is no change to the appearance of the material. Is there another setting that needs to be enabled first, or something else I need to do to get the AO map to appear?
     
  41. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    should just work- maybe try baking out the substance materials so your sure the texture data is there?
     
  42. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    oh I see, yeah lots of people do this. What you might want to do is add some script to debug log everything on the component and material to make sure it has what you think it has. Maybe some texture is getting stripped by the build, or something isn’t getting loaded that you think should be. But the basic process your doing is correct.
     
  43. AtomicIsland

    AtomicIsland

    Joined:
    Sep 20, 2018
    Posts:
    12
    Thank you for the quick reply! I was able to figure out the issue, it ended up being a problem with my lighting setup. Everything is working great now. Thanks again :)
     
  44. niallmc

    niallmc

    Joined:
    Sep 3, 2015
    Posts:
    44
    @jbooth So I debugged a bunch of the info and they appear to be populated the same before and after swapping terrains.


    MS Assets 1: Temp mat:MicroSplat (UnityEngine.Material), propdata: MicroSplat_propdata (MicroSplatPropData), perPixNormal: , matInstance: MicroSplat (UnityEngine.Material), blendMat: , blendMatInstance: , , , MicroSplat_keywords (MicroSplatKeywords), , ,
    MS Assets 1: RGBA(4.000, 4.000, 0.000, 0.000) RGBA(2.000, 2.000, 0.000, 0.000) RGBA(1.000, 1.000, 0.000, 0.000)
    Terrain Instanced: False

    MS Assets 2: Temp mat:MicroSplat (UnityEngine.Material), propdata: MicroSplat_propdata (MicroSplatPropData), perPixNormal: , matInstance: MicroSplat (UnityEngine.Material), blendMat: , blendMatInstance: , , , MicroSplat_keywords (MicroSplatKeywords), , ,
    MS Assets 2: RGBA(4.000, 4.000, 0.000, 0.000) RGBA(2.000, 2.000, 0.000, 0.000) RGBA(1.000, 1.000, 0.000, 0.000)
    Terrain Instanced: False


    Does the fact that is only affects the terrain before the basemap distance tell you anything, I really cant see what else to swap out on the terrain. Or you have any other ideas to debug?
     
  45. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    At basemap distance it switches between the shader and the _base one. Maybe the main one isn’t included in the build somehow? Doubtful. Does it work fine if you use that version in the build without the swap?
     
  46. niallmc

    niallmc

    Joined:
    Sep 3, 2015
    Posts:
    44
    @jbooth thanks for the help. It seems to be resolved. I referenced all the textures in the respective folders of the micro-splat component in the script and now it seems to work. Thanks again for helping!
     
  47. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    @jbooth , is it possible to setup microsplat on mesh terrains without doing the terrain-to-mesh conversion? In other words, I am using meshes sent directly from World Machine. They are not Unity Terrains, and I aim to use microsplat with them. However, in the doc's I can only find instruction for beginning the workflow by converting from Unity terrains, and I don't see any script which I can attach directly to meshes.

    Thanks!
     
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    it would be a bit manual, but if you create a MucroSplatData directory and create a shader and material in it, you can add the component and hook up the data. Once you assign the template material it will generate the propData and keywords files automatically
     
    BIGTIMEMASTER likes this.
  49. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The Mesh Workflow module is finally out on the store. I spent a ton of time on this, and the next update is going to contain even more stuff for it, so I can't wait to see what people do with it:

    Asset Store Link

    Works with most of the MicroSplat features, and lets you paint up to 32 textures onto meshes. It has several different modes, allowing you to paint over your existing shaders, or generate custom ones which can texture objects and even provide crack free tessellation for your models. Like the rest of MicroSplat, it's coded for performance, but you can also bake down the results into standard textures for use with traditional shaders.

    The next version of MicroSplat (3.0), which I will likely ship sometime next week, adds the following features as well:

    - Support for subsurface scattering, per texture or for snow, with thickness maps and transmission color
    - Choice of Metallic or Specular workflows
    - Per Texture Fuzzy Shading
    - Procedural Texture Module can now be used with traditional texturing. One texture is used to paint "procedural" texturing, and all other textures are available for traditional splat map painting. This allows you to paint specific textures down over the procedural texturing, like roads, shorelines, etc..
    - Improved API for accessing per-texture properties via code
    - New Optimization Guide
    - New Documentation on how to write custom modules
    - Lots of additional fixes and improvements
     
    mmaclaurin, Rowlan, gavriloP and 5 others like this.
  50. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Hi, so there's an error with the new Mesh Workflow that prevents it from working without various modules installed. So if you hit this error, just replace these two file's in the MeshWorkflow directory with these versions. A patch has been uploaded but unity will most likely not approve it until monday.

    File 1

    File 2
     
Thread Status:
Not open for further replies.