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

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    I've thought about that, just wasn't sure if you were aware of what may be causing it - as it from what I can tell only happened with Microsplat.

    But will do, thanks mate.
     
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Undo of what? It's standard unity, so like nearly every app in existence, ctrl-z is undo.
     
  3. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,269
    It says you should check the console. I've seen this error quite some time. Ususally the console says you're not logged in. Feel free to post here:

    https://forum.unity.com/threads/the...-replacement-is-one-big-unusable-mess.948691/
     
  4. Abruzzi

    Abruzzi

    Joined:
    Feb 6, 2015
    Posts:
    44
    Hi! I've just bought MicroSplat URP asset for our project. I have imported that and convert my Terrain to Microsplat, tune some settings: set all fast! And In Editor and PC Build it works fine, but on iOS I see only black terrain without any textures(as you can see on screenshot it take shadows, but not show textures). What we did wrong, cos we haven't any ideas for now.

    Yeap we use Unity 2020.1.13f1 + URP 8.2.0 + MicroSplat 3.53 + MicroSplat URP 3.503

    photo_2020-11-13_11-22-44.jpg
     
    Last edited: Nov 13, 2020
  5. Abruzzi

    Abruzzi

    Joined:
    Feb 6, 2015
    Posts:
    44
    ooookay, I don't know how but I've fixed that! :) Thanks!
     
    jbooth likes this.
  6. Abruzzi

    Abruzzi

    Joined:
    Feb 6, 2015
    Posts:
    44
    @jbooth I found what's a problem was! If I Switch Platform should I each time click Update button in MicroSplatConfig.asset to generate new texture array, right?
     
  7. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It should actually do that automatically as part of the platform switch..
     
  8. Abruzzi

    Abruzzi

    Joined:
    Feb 6, 2015
    Posts:
    44
    Unfortunately, this does not happen automatically :( Should the entire MicroSplat folder be in the root of Assets, because I moved it to the subfolder?
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It's created in whatever directory your terrainData is in, but can be anywhere..
     
  10. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    I have just installed microsplat into my project. I am trying to add the microsplat terrain script to my terrain to get the process started. Firstly it wasn't appearing when I click on "Add Component" so when I tried to add the script to my terrain on it's own i get this error saying "Can't add script behaviour Dwyer. The script needs to derive from MonoBehaviour!"
    upload_2020-11-14_11-21-8.png

    Any ideas?
    This could have something to do with the terrain and vegetation studio pro
     
    Last edited: Nov 14, 2020
  11. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Install in a fresh project, it seems like yours has some funky corruption going on..
     
  12. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    I am seeing an error which says
    Assets\MicroSplat\Core\Scripts\Editor\MicroSplatUtilities.cs(43,31): error CS0117: 'GraphicsSettings' does not contain a definition for 'renderPipelineAsset'

    I'm not using HDRP or URP. just the old unity renderer
     
  13. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461

    What version of unity are you using? Is this in a new project?
     
  14. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    I'm using Unity 2018.3.13f1 and it's not a new project.
    Thankfully I was able to comment out some of the code there that was checking for the version of unity and it's working now
     
  15. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Likely you have something in your build settings defines from, possibly, once having a module or SRP version installed.
     
  16. MichaelAbbot49

    MichaelAbbot49

    Joined:
    Nov 19, 2020
    Posts:
    3
    Hello !

    The HDRP version of microsplat seems to to have issues with the draw instanced mode, which is very unfortunate because I'm using other resources that need the terrain to use instancing...
    As you can see in the images, the lighting is very different, sometimes I can even see objects through the terrain... It doesn't seem to happen straight away when I add microsplat, but it always ends up looking like this (I don't do any weird stuff with it, just using a few of the terrain collection modules).








    I hope you can help !

    Thank you,

    Michael
     
  17. Berir

    Berir

    Joined:
    Mar 23, 2013
    Posts:
    55
    Hi, can you Help me please! I am trying to export Microsplat mesh terrains to use it in another project, but Imported tiles look very law resolution and bad ... I have no idea what I am doing wrong...
    upload_2020-11-23_0-47-1.png


    upload_2020-11-23_0-48-16.png

    I checked folders , textures , materials its all there just looks horrible... If it matters I made original file in Unity 2019.4 using latest Terrain tools with Microsplat but exported into unity 2019.2 ... I am aware Terrain has changed after 2019.3 ... but I have converted it into a mesh and exporting mesh version not actual terrain, did not think that would be a problem ... should that be an issue ? or is there some other reason this is not working? thank you
     
  18. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It looks like the per-pixel normal that unity generates isn't being correctly sampled. I'll see if I can repro this.
     
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It looks like the normal map texture array is not assigned to the material.
     
  20. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    Just a note to say Im porting my game to Android and Microsplat is working wonderfully on all the test phones. Thanks again for this great framework:)
     
    camta005, jbooth and Rowlan like this.
  21. Level3Manatee

    Level3Manatee

    Joined:
    May 10, 2018
    Posts:
    10
    Hi, I'm getting a shader error when activating tessellation with stereo rendering (single-pass instanced) in Unity 2020.1.15f / URP 8.3.1:
    Shader error in 'MicroSplat/Terrain': invalid subscript 'stereoTargetEyeIndexAsRTArrayIdx' at line 2521 (on d3d11)
    Shader error in 'MicroSplat/Terrain': invalid subscript 'stereoTargetEyeIndexAsRTArrayIdx' at line 11212 (on d3d11)
    (both references to UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO)
    Additionally, a warning about
    'MSDistanceBasedTess': implicit truncation of vector type at line 2489 (on d3d11)


    I'm assuming this is a bug?
     
  22. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, looks like it- though technically I only support SRP's on LTE versions, most likely it's that the tessellation stages don't have UNITY_VERTEX_OUTPUT_STEREO defined in the tessvert structure, and don't copy the data over in the barycentric blending, since this only happens for you with tessellation enabled..

    You could try adding the UNITY_VERTEX_OUTPUT_STEREO to the tessvertex structure in mcirosplat_func_tess2.txt, then regenerate the shader by changing an option on it. That should make it compile, though I'm not sure if the stereo effect will need more than that? Let me know.
     
  23. fedorval

    fedorval

    Joined:
    Nov 15, 2019
    Posts:
    17
    Hi!

    I've been using microsplat for a couple days now and my team wants a different lighting for the terrain (more cartoony looking)

    Now I already have that lighting on my other shaders and I want to apply it to the Microsplat shader (in Forward)
    Only trouble is, your plugin is pretty complicated and I'm not sure where to start or how to go through doing that. All I've done for my other shaders is start from an unlit output and add my lighting function there.
    However it seems like you use unity's default way of lighting stuff and there's no way to set the terrain in an unlit shading, at least not that I saw.
     
  24. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The cleanest way to do that is to write a RenderLoopAdapter for that and use your own templates (like the URP and HDRP modules do). But if you're running in standard, you may be able to hack it into the current system using the surface shader custom lighting calls, though be warned some features (terrain blending) already use these.
     
  25. fedorval

    fedorval

    Joined:
    Nov 15, 2019
    Posts:
    17
    Alright I'll check the terrain blending code to see how it's done then since I've never used that before. It's too bad that we are indeed in standard right now.
     
  26. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Likely better that your in standard; you can use IRenderLoopAdapter to do it cleanly, or if you don't need terrain blending just change the SurfaceShaderRenderLoopAdapter to output the correct pragma's and implement the functions in the main shader fragment files, as described here:

    https://docs.unity3d.com/Manual/SL-SurfaceShaderLighting.html
     
  27. fedorval

    fedorval

    Joined:
    Nov 15, 2019
    Posts:
    17
    Very well I will check that out!

    Thanks for the lightning fast replies by the way I was expecting to leave this there and wait until tomorrow!
     
  28. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,269
    Interesting how MicroSplat Trax changes a prototype. At first it should have been a Star Wars like Pod Racer. Then I wanted some skidmarks in the sand and added Trax. Then I saw the effect and so I wanted more Trax. Now it's this :D



    Trax is a game changer. Literally :)
     
    Last edited: Nov 30, 2020
    Zimnel, camta005 and StevenPicard like this.
  29. Level3Manatee

    Level3Manatee

    Joined:
    May 10, 2018
    Posts:
    10
    Yes, that did the trick. Compiles fine, stereo working as well. Thanks!
     
  30. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Hi, Jason. Is there a proper way to set up baked terrain light map to MS terrain in HDRP environment? The image attached shows the default bake result, that the terrain color doesn't change with the light. I suppose the terrain does receive light map influence by default? Then I tried to add the baked map to global texture overlay mode, and I got a similar result with the default baked terrain. So I just want to make sure if I have to set it this way, or if I set it right?
     

    Attached Files:

  31. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I mean, it should just work with baked lighting, same as anything else. You shouldn't have to assign anything. If this is on HDRP 7.3, can you PM me a small repro project (complete with project settings, etc)?
     
  32. BriBill

    BriBill

    Joined:
    Oct 8, 2019
    Posts:
    10
    Hi there. I ran into this problem today as well. I was able to resolve it by changing the default Quality in Project Settings to Beautiful or changing the Anisotropic Textures in Qualityto "Forced On". After doing that, I selected the MicroSpatConfig 1_deff_tarray file as jbooth describes and adjusted the Aniso Level all the way up to 16. That resolved it for me. I hope this helps!
     
  33. Jinkel92

    Jinkel92

    Joined:
    Apr 12, 2018
    Posts:
    5
    Why free version doesn't work on LTS 2017.4.40?
     
  34. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Because the asset store now requires 2018.3+ to upload assets..
     
    Jinkel92 likes this.
  35. Jinkel92

    Jinkel92

    Joined:
    Apr 12, 2018
    Posts:
    5
    Sooooooo..., i guess that do work on LTS 2018.4.30?????????
     
  36. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    yup..
     
  37. Jinkel92

    Jinkel92

    Joined:
    Apr 12, 2018
    Posts:
    5
    I tried it on 2018.4.30 and it gives an error "Binary to YAML conversion: type UInt16 is unsupported".
    I also got to test it in the LTS 2019.4.16, with an API updater with the same bug, both in 2019 and 2018, they work with some graphic error. I have to say that despite the new terrain system as of 2018, the texturing works without layared terrain, I guess they still have support for the typical texturizer...
    I don't know why the store says that it supports 2017.1.0, it's not true. So good, the most stable version is 2019 I think.
     
  38. GuitarBro

    GuitarBro

    Joined:
    Oct 9, 2014
    Posts:
    180
    Hey @jbooth I was wondering if there would be a way to evaluate the diffuse color in an external shader if Microsplat is set to use world uvs? Was making a raymarched post processing effect that samples a SDF of the terrain to use in a reflection and would be cool if I could actually get some of the microsplat details in it. If not, I'll probably just do some simple color blending based on the splatmap but figured I'd ask since I didn't see anything in the docs.
     
  39. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The UInt16 error is an internal unity error message, they have a fix scheduled for 2020 or 2021 - it doesn't create any issue though. I dev on 2018.4.

    You'd basically have to run the entire shader to figure out that color. That's basically what terrain blending does- it renders a second material and alpha blends it with the first using a modified terrain shader. In post processing, though, if your deferred, you can just sample it from the gbuffer..
     
  40. GuitarBro

    GuitarBro

    Joined:
    Oct 9, 2014
    Posts:
    180
    Ah ok, that's what I had a feeling the answer was gonna be. Thanks though.
     
  41. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    this is still an issue!? terrain blending with parallax mapping has still those artifacts. if this is not fixable maybe we could just disable it for the blend material?
     
  42. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It's supposed to disable it in the blend material, and I'm pretty sure I already shipped a patch that does that.
     
  43. saber_7

    saber_7

    Joined:
    Nov 17, 2017
    Posts:
    3
    Considering a switch from Megasplat to Microsplat... is there support for custom shader hooks like the Megasplat has via the megasplat_custom.cginc, or something close to that?

    Really like the HDRP support so that is the main reason for the switch.
     
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It's a good choice- better all around, and much faster. Anyway, it doesn't have the same kind of custom.cginc system, what it has instead is the module system, which is much more flexible and powerful- the whole system is effectively build via modules, which pull custom code from the modules into your shader. There's a doc about it in the free version, so you can see how it works there.
     
  45. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    Just a note to other would be time wasters that the Unity package manager in 2020.2 can lie to you. I had to go and delete the package manager cache manually and then download again and then install again (to fix compile errors from microsplat version mismatches). :(
     
  46. Xkalliber

    Xkalliber

    Joined:
    Dec 10, 2020
    Posts:
    5
    cooming in late to this...mesh terrian module available? Overall this thing is nice. Where you have API for it?
     
  47. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Do you think publishers write the asset store code? Because, surprisingly to you, we don't- take your complaint to unity, I have no control over how the store works.
     
    boxhammer likes this.
  48. Nanofus

    Nanofus

    Joined:
    Sep 27, 2012
    Posts:
    12
    Hi! I have the newest MicroSplat version (3.53) imported in my project, and it's been working perfectly until today!
    upload_2020-12-16_0-3-41.png

    But for some reason, after I today bought some addons from the sale and imported them, the material seems to have broken; the terrain has become invisible and I have the following errors in the material (note that the Shader Generator says v 3.4 even though I have 3.53 imported):
    upload_2020-12-16_0-5-14.png

    I'm also using URP and the URP MicroSplat plugin.

    Any idea on what's going on here? Thanks!
     
    Last edited: Dec 15, 2020
  49. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, you don't have 3.5 imported, but rather 3.4. I'm guessing that Unity's broken package manager is giving you an old version and you need to clear the cache on it.
     
  50. Nanofus

    Nanofus

    Joined:
    Sep 27, 2012
    Posts:
    12
    That was it, thank you! :)
     
Thread Status:
Not open for further replies.