Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview 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. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244


    Here's a render using LWRP. Microsplat + Crest + Massive Clouds, all supporting LWRP for some amazing volumetric nuance that runs well on iOS (modern devices.) Particularly loving the subtle color variations in the ocean.
     
  2. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Update: Due to 2019.2 and a high amount of bloat with my terrains tools and messy terrain updates I have decided to leave all terrain related stuff behind for now but I'll leave these issues here for you in case any other users reports them.

    Hi!
    1. I have opened up the demo scene and I can't seem to get shadows to turn on, any idea what it could be?
    2. The self shadowing is really strong, the terrain looks quite dark, any way to fix that?
    3. I am trying to use the blending module and I am getting this error attached, I use 2019.2:
    4. There's a strange error but I could be maybe not related to microsplat maybe new terrain.
    5. I have mega splat but I haven't used it in 2 years. Would you say it's gotten better especially in performance and I had issues with object blending at the time with it hence why I went to microsplat, do you think I should stay with microsplat or has mega gotten a lot better?
     

    Attached Files:

    Last edited: Aug 12, 2019
  3. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    1. I will check this out as it may be a 2019.2 thing- that said MicroSplat contains no lighting or shadowing code because it's a surface shader.
    2. Ambient lighting, etc..
    3. I'll see if it repro's for me, as 2019.2 just shipped I haven't tested it yet.
    5. MicroSplat is faster than MegaSplat, and I would recommend it for terrain work. MegaSplat continues to be popular for mesh based on voxel based workflows..
     
  4. ShefShifer

    ShefShifer

    Joined:
    Aug 16, 2017
    Posts:
    16
    I am using last version of MicroSplat (2.65) and Unity 2019.1.10.
    Everything works in editor, but in build crashes.
    I create terrain from script, when I add MicroSplatTerrain script to it and call MicroSplatTerrain.SyncAll() the error occurs in MicroSplatTerrain.Sync() at the line
    if (keywordSO.IsKeywordEnabled("_CUSTOMSPLATTEXTURES"))
    because keywordSO is null.
    The old version of MicroSplat (cannot remember exactly, maybe 2.2) worked fine
     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    If your creating terrain from script you’ll have to assign the keyword object as well. It didn’t exist in 2.2, as I used unity’s shader keyword system instead, but using my own system allows for unlimited keywords.
     
  6. ShefShifer

    ShefShifer

    Joined:
    Aug 16, 2017
    Posts:
    16
    Thank you for reply. Yes, it works.
     
  7. Bero89

    Bero89

    Joined:
    Jan 17, 2017
    Posts:
    5
    Sorry for my Bad English. Work the Tesselation on LWRP with the LWRP Addon from Microsplat ?
    Or work only LWRP Addon with the Core ?
     
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It did, but it looks like the newest LWRP breaks it so I’m working on a fix.
     
    Bero89 likes this.
  9. stefankohl

    stefankohl

    Joined:
    May 30, 2014
    Posts:
    53
    @jbooth

    LWRP was deprecated in Unity 2019.3 in favor of URP which basically uses the same sources moved to a new package. I had to replace all occurrences of "com.unity.render-pipelines.lightweight" with "com.unity.render-pipelines.universal" to make MicroSplat LWRP being compatible with URP.
     
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, but as 2019.3 is in alpha it doesn’t seem like the right time to do that upgrade. Not exactly the “stable” pipeline they promised.
     
    Last edited: Aug 14, 2019
    mmaclaurin likes this.
  11. stefankohl

    stefankohl

    Joined:
    May 30, 2014
    Posts:
    53
    Speaking of alpha... Unity added a terrain holes feature in 2019.3. Are you going to support this in a future update - instead of or in addition to your own solution?
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yes
     
    stefankohl likes this.
  13. Noogy

    Noogy

    Joined:
    May 18, 2014
    Posts:
    132
    Hi Jason, what sort of content are you looking for? I'd love to help bring the mesh workflow module closer to release as I think it'd be perfect for my production.

    Right now I'm trying to juggle a combination of Microsplat for terrain and Megasplat for mesh painting but would prefer to stick with Microsplat for everything (and Polybrush's vertex painter, while nice, offers nowhere the shader/splat/material capabilities of your tools). Thanks!

    Edit: Sorry if it was unclear, this was related to the Microsplat Mesh Workflow module that we briefly discussed some time ago.
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I still have a bug with the painter that causes it not to work on windows, which is annoying. But that said what I’d be after is examples that show non-terrain work..
     
    Noogy likes this.
  15. Noogy

    Noogy

    Joined:
    May 18, 2014
    Posts:
    132
    Thanks Jason. I'd like to offer something up but at the moment all meshes currently in production are just extensions of terrain, however I'll see if I can scrounge up something more substantial/relevant.

    One quick question, can/do Microsplat and Megasplat share the same texture array configs?
     
  16. ShefShifer

    ShefShifer

    Joined:
    Aug 16, 2017
    Posts:
    16
    How can I turn OFF mipmapping for the terrain?
     
  17. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    396
    hi @jbooth

    This is still happening. (Tried at 2019.1 and 2019.2 too)

    How to repro:

    Create new project.
    Import MicroSplat - Terrain Collection
    Create two terrains on New Scene
    Attach Micro Splat Terrain components on both terrains and convert them to Microsplats.
    It will throw 12 warnings and they'll stay everytime you compile anything.
     
  18. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No, though I bet you could share the diffuse/normal arrays in the fastest packing mode because their underlying formats are the same. However the configs themselves contain a lot of additional information unique to each system.
     
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Why? Currently there isn’t a way to do this.
     
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, I’ve been looking into this, but I don’t declare _MainTex in my shaders at all.
     
  21. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    396
    Duplicate basemap name: '_MainTex'. Ignoring.


    @jbooth
    Ok i spent like 2 hours and i guess i found it.

    Last lines of the auto generated terrain shaders! On dependencies, BaseMapGenShader and BaseMapShader dont get correct shaders and path.

    Old
    Code (CSharp):
    1. Dependency "AddPassShader" = "Hidden/MicroSplat/AddPass"
    2. Dependency "BaseMapGenShader" = "Hidden/MicroSplat/Terrain (1)_Base"
    3. Dependency "BaseMapShader" = "Hidden/MicroSplat/Terrain (1)_Base"
    Edited
    Code (CSharp):
    1. Dependency "AddPassShader" = "Hidden/MicroSplat/AddPass"
    2. Dependency "BaseMapGenShader" = "/Terrain (1)_Base"
    3. Dependency "BaseMapShader" = "/Terrain (1)_Base"
    When you edit the correct dependencies, warnings go away.


    Also Terrain.materialType throws some warnings because its obsolete now.
    //terrain.materialType = Terrain.MaterialType.Custom;
    I guess its not necessary anymore?
     
    Last edited: Aug 22, 2019
    jbooth and iddqd like this.
  22. AmAutoma

    AmAutoma

    Joined:
    Aug 20, 2019
    Posts:
    2
    Hi Jason, thank you for MicroSplat before everything else. It's really fast and looks beautiful.

    I only encountered a small problem on a material. On certain light conditions the shadows look pixelated on terrain, please see attached image. Shadows on the directional light are set to none.

    I thought the problem were the textures so I quickly unwrapped a plane and it seems okay, using the very same textures that are assigned on the terrain.

    Any idea? Thanks in advance.
     

    Attached Files:

  23. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Thanks! Strange that it doesn't accept the absolute path anymore- I wonder if this is going to be based on Unity version used?


    Yeah, references to material type are removed in 2019.3 and included in the next release.
     
    Last edited: Aug 22, 2019
  24. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Try setting the compression on the TextureArrayConfig to uncompressed and see if it’s compression artifacts. If so, it might be because the metallic and smoothness get packed in with the normal, which you can change the packing mode and have them as separate arrays.
     
    AmAutoma likes this.
  25. AmAutoma

    AmAutoma

    Joined:
    Aug 20, 2019
    Posts:
    2
    Changed to uncompressed and got rid of the artifacts! I'll change the packing mode to separate arrays, thank you!
     
  26. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    It looks like MicroSpatShaderGUI_Compiler.cs includes this line:

    Code (CSharp):
    1. string baseName = "Hidden/MicroSplat/" + name + "_Base";
    and this one:

    Code (CSharp):
    1. sb.Append("Shader \"Hidden/MicroSplat/");
    @JasonBooth Would simply changing those lines do the trick instead?
     
  27. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    This is patched in the latest release, which just got published by the UAS today..
     
    transat and razzraziel like this.
  28. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    Thank you for all your continued hard work on Microsplat. The amount of updates and compatibility fixes you are able to do astounds me, especially with the fast pace of Unity changes.

    I am wondering, what does the "Render Baking" button do? It sounds like it maybe removes microsplat and bakes the terrain texture? Im afraid to click it in case it does something irreversible.
     
    iddqd likes this.
  29. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It allows you to bake out textures of the resulting data the shader will produce; albedo, normals, etc.
     
    protopop likes this.
  30. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    Cool im going to try it out:) Thank you.
     
  31. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    I upgraded from Unity 5.6 to Unity 2017.4, deleted Microsplat and reinstalled, removed the Microsplkat component from my terrain, added a new one and it packaged the textures. But my terrain is just plain black in the editor (actually at first plain white then when i disabled and enabled the microsplat compoinent it turned black).There were about 200 of the same error message:
    Assertion failed: OPENGL: Graphics.CopyTexture called on textures of different sizes?

    Im using Android. Do you have any idea what the issue might be?
     
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I’m betting the arrays didn’t build for some reason? If you select them do they have textures in them?
     
    protopop likes this.
  33. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    Thank you:) Is this the array? If yes then it looks like it builds

    Screen Shot 2019-09-03 at 1.04.59 PM.png

    When i "convert to microsplat" it makes a material like this

    Screen Shot 2019-09-03 at 1.00.49 PM.png

    And something like this

    Screen Shot 2019-09-03 at 12.59.14 PM.png

    Im pretty sure its a Unity 2017.4 thing since it works in 5.6

    And there those error messages while its converting:

    Assertion failed: OPENGL: Graphics.CopyTexture called on textures of different sizes?
    Screen Shot 2019-09-03 at 12.59.43 PM.png

    MAybe something happened when i upgraded the project to my textures? I pverride the android textures to ETC2 - does that do anything?

    Here's a sample texture itself. Its not read/write - isthis something?

    Screen Shot 2019-09-03 at 1.06.39 PM.png

    Sorry for all the pics. I thought it might make things easier.

    It not working is not a deal breaker since i can release the android version of VAndgels with regular terrain. But Microsplat looks ten time more beautiful:)
     
  34. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Can you package up the data and send it to me? All of that stuff is pretty well tested and hasn’t changed for 2017..
     
    protopop likes this.
  35. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    do you mean like zip and send the MicroSplatConfig 2_diff_tarray.asset and normal asset? Or is there specific files i should send?
     
  36. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    And yeah im sure its something on my end. It's an old project with lots of cruft. Im just wondering if there's anything obvious i'm missing:)
     
  37. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    I noticed in the build settings there is this
    CROSS_PLATFORM_INPUT;__MICROSPLAT__;__MICROSPLAT_DETAILRESAMPLE__;__MICROSPLAT_STREAMS__
    Screen Shot 2019-09-04 at 11.12.16 AM.png

    I think its carried over from the 5.6 project. I dont kow what it is, but maybe its soething o should delete befor i convert terrain to microsplat? Or maybe this is added when i installed microsplat?
     
  38. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    I thought maybe its my project creating teh issue so I created a new project and imported microsplat and anti tile on project creation. I opened the microsplat demo Terrain scene and the terrain is black. There are also a few warnings about missing splat maps. Maybe its an issue with Unity 2017.4p31? Or a problem with MacOS?

    Screen Shot 2019-09-04 at 11.40.14 AM.png
     
  39. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Well I do see that your mac is not using metal for some reason in your error log. I do all my dev on a mac, so I doubt it has anything to do with that, and I have tested under openGL and Metal heavily. When you inspect the Unity Terrain, does it have textures assigned still?
     
    protopop likes this.
  40. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    I have Metal Editor Support (experimental)unchecked in my player settings. I checked it and reloaded to be sure. The warning dissapeared but the black remained, i think youre right thats probably not it.

    Yes when i select the terrain the 4 textures are in the "Painting" slot. And if i disable the Microsplat component the terrain textures show up again (the non microsplat version)

    Maybe i should test it again with another new project, create a terrain from hand, assign the textures and retry this.
     
  41. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    I tried it step by step

    • create an empty project
    • Disabled global illumination and light mapping auto generation
    • Imported updated micro plat main module only
    • Imported 4 terrain textures
    • Added a new terrain
    • Painted some bumps on terrain
    • Added 4 textures to terrain and painted them on
    • Added Microsplat terrain component
    • Clicked convert
    • Terrain goes black and attached image shows up - i note its missing the extra maps?
    Im at a loss - like i said i can release Vandgels with regular terrain so its not urgent, but i do prefer the look of microsplat

    EDit: when i save the scene, the terrain changes from balck to textured, but with the defaut texturing, not the microsplat tiled stuff. It does this even though the Microsplat component is still checked. Unchecking then rechecking teh component makes the terrain black again.

    Screen Shot 2019-09-04 at 12.55.07 PM.png
     
  42. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Ok, I'll attempt to repro this in that version of Unity, likely they broke something..
     
    protopop likes this.
  43. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    If it helps I’m using
    Unity LTS Release 2017.4.31f1
    Released: 15 August 2019
     
  44. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    953
    Modifying the per texture properties doesn't actually seem to work.
     
  45. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Make sure your propData object is assigned correctly.
     
  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    So I just tested this and am getting the same result. Sounds like Unity broke something in the LTE branch, because everything works fine in 2018 and older version of 2017. I went ahead and submitted a bug to Unity, but no idea if that will result in anything..
     
    protopop likes this.
  47. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    Thats cool to know its something quantifiable like that. Maybe a new patch will fix this and its good that i know i can use Microsplat here again at some point. If you share the bug report number i will second it.

    Edit: I forgot to say thank you. I'm grateful that you chose to take your time to make something like this that makes world design better. I want you to know it is truly appreciated, and i think youve made an impressive product.
     
    Last edited: Sep 4, 2019
    mukki014 and iddqd like this.
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Hey, I managed to work around this, as it has to do with the new include paths that were recently fixed. I'm uploading a patch to the store now, but PM me if you need it sooner..
     
    mmaclaurin and protopop like this.
  49. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,562
    Man you are good:)

    Ill PM you because Im about to release the Android Version of VAndgels and am in beta testing. If i can put back the microsplat texture i think it looks so much better:)
     
  50. Sovcenko

    Sovcenko

    Joined:
    Apr 17, 2018
    Posts:
    6
    Dear Jason, first of all, Microsplat is awesome. Thank you.
    That being said, I kinda need to get a toony/cell shading effect on my game. I saw your "low poly" asset, but I need to achieve another kind of rendering (like Borderlands for the obvious example). I have some basic knowledge in shader, but not enough to goes blindly into your code.
    - Is there a way to change the "contrast" of the light/shadows ? To sharpen the shadows ?
    - Is there a way to add some global quantization effect without post-processing, into the terrain directly ?
    - Is there a way to add an outline on the terrain without post-processing ?

    Thank you again.
     
Thread Status:
Not open for further replies.