Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. 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,445
    Going lower than -1 would still produce a smoothness of 0 - what your likely running into is the GGX lighting model, which limits the minimum metallic to 0.04 and ads a fresnel to everything, giving you specular like shine on edge angles. This is intrinsic to the lighting model Unity uses, which is why setting smoothness to -1 doesn't change it, and why, as the doc discusses, their are alternative lighting models.
     
  2. Superjayjay

    Superjayjay

    Joined:
    Mar 28, 2013
    Posts:
    65
    Which change are you referring to?
     
  3. Superjayjay

    Superjayjay

    Joined:
    Mar 28, 2013
    Posts:
    65
    Thanks for the pointers! Does changing the lighting model affect the whole game or just the terrain?
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    It forces the terrain to be rendered in forward rendering, since you cannot have different lighting models in deferred. This is all thoroughly covered in the documentation.
     
  5. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Alright then, please tell me if you need more specific information:)
     
  6. Chosko

    Chosko

    Joined:
    Jun 24, 2017
    Posts:
    8
    The one jbooth suggested me: "Looking at the code, it looks like it's packing the specular array as a linear texture, not sRGB, so I should likely switch that to be sRGB.. (if you search TextureArrayConfigEditor.cs for specularArray = new Texture2DArray you can change the last parameter to false)"

    If you are using the specular workflow, this prevents your terrain from being super shiny... As stated by jbooth, though, "This change is included in the patch that went out this morning, btw." so you just need to update the package
     
  7. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Well there's also the "No Sheen" mode, which uses specular workflow internally but still keeps everything metallic from the user point of view..
     
  8. Rio_TFF

    Rio_TFF

    Joined:
    Aug 4, 2019
    Posts:
    21


    Got a few errors while importing the Triplanar module this morning (this is with Microsplat 3.6 installed)

    Going to open a new project to see if I get the same errors...

    **EDIT** Nevermind, just saw JB's comment about 2020.2 package manager not working with his modules and is not 'officially supported'. Strange since all other assets seem to be working fine...

    Unity needs to get it together when it comes to fully documenting their updates...
     
    Last edited: Dec 30, 2020
    vkfauna likes this.
  9. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    3,819
    The Stochastic Texture Clustering mode is one of the best things for terrain. Just made a new gameplay prototype. For performance reasons I had less vegetation and more terrain. Tiling was clearly visible. Set mode to Stochastic and now it's gone. I just love it. And performance is top in HDRP at high speed :D

    t2.jpg
    t3.jpg
     
    Lars-Steenhoff likes this.
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    This is because you have an older version of Core. I've had about a dozen people come into discord today and report their package managers as showing them having 3.6, even when they hadn't updated it yet, and having to clear the cache to get it to download the new version. That's not 2020.2 specific, and it's only SRPs that I don't support in non-LTS versions of Unity.
     
    vkfauna likes this.
  11. rafaelsobral3

    rafaelsobral3

    Joined:
    Jan 1, 2018
    Posts:
    3
    Hi,

    Does Mesh Terrain per-pixel normal option work with URP?

    In an Project set to work with URP the example scene in MicroSplat Mesh Terrain Examples shows no normal effect on terrain after change render loop to Unity URP.

    We just get normal effect after disabling per-pixel normal in MicroSplat Shader.

    I am using:

    Unity 2019.4.17f1
    Universal RP 7.3.1
    MicroSplat 3.6.0

    Images are attached.

    Thanks.

    Aloha,

    Rafael Sobral
     

    Attached Files:

  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    It's supposed to, if it's not, it's a bug. Make sure the map is assigned on the Mesh Terrain component..
     
  13. rafaelsobral3

    rafaelsobral3

    Joined:
    Jan 1, 2018
    Posts:
    3
    Thanjs for the fast reply.
    It is assigned. It works before switch to URP. And it happens the same in the mesh to terrain example provided with the Mesh to terrain package.
    If you want I can send a example or you test it switchibg to URP in the package example.

    Grwat work on this asset.

    Aloha,

    Rafael Sobral
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Likely something got borked in the changes to URP, I'll check it out..
     
  15. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    3,819
    Here's a gameplay video of above screenshots. The stochastic texture clusters really help with removal of tiling on the terrain. Performance is awesome.

     
    Lars-Steenhoff likes this.
  16. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    You have to add the UniversalAdditonalLightData to your light..
     
  17. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Maybe do a test in a new scene with a new terrain using one of the URP templates for the lights? On my machine, once I added the extra data component the self shadowing started working..
     
  18. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Very odd- is Draw Instanced on or off?
     
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    If draw instanced is affecting it, then it may be that something isn't correct with the instancing code in the shadow pass. What do you mean with #3? Realtime shadows seem to work correctly for me - I'll setup a scene with baking and see if I can reproduce these results..
     
  20. dansta2k

    dansta2k

    Joined:
    Apr 24, 2015
    Posts:
    12
    Hello I seem to have a weird issue with texture quality. (I have read the faq's and docs)

    Without microsplat =>

    upload_2021-1-3_21-51-50.png

    With microsplat Gradient Sampler =>
    upload_2021-1-3_21-52-51.png

    With microsplat LOD Sampler it is improved but ....
    upload_2021-1-3_21-55-54.png

    A weird and very distracting noise/pixelation gets added to textures in the distance
    upload_2021-1-3_21-57-46.png

    Is this normal or am I doing something wrong?

    Thanks for your help.
     
  21. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    it's height blending, so if you want softer blurry blends you can either turn it off completely or adjust the interpolation contrast.
     
  22. dansta2k

    dansta2k

    Joined:
    Apr 24, 2015
    Posts:
    12
    Thanks for the help :)
     
  23. Superjayjay

    Superjayjay

    Joined:
    Mar 28, 2013
    Posts:
    65
    Thanks for the pointers folks, I'll update and fingers crossed this issue should be gone once and for all!
     
  24. Sovcenko

    Sovcenko

    Joined:
    Apr 17, 2018
    Posts:
    6
    Hello Jason ! First, thanks for your amazing asset, it's awesome.

    To be able to reach correct FPS on Nintendo Switch, we changed version to 2019.4.17f1 (LTS) and switched our pipeline renderer to URP. The terrain is working correctly on PC build and editor, but it does not work on Nintendo Switch build. The terrain does not display at all and we have multiples errors on compilation who goes like that :

    Shader error in '[OurTerrainMaterialName]': Fragment compilation shader failed
    Shader info log:
    0 (22) : error C7528: OpenGL reserves names containing '__'
    (on switch)
    I found someone on this topic who had the same problem, but I wasn't able to find any followup on a solution. From what I see, the problem is in the variable names, but I don't know where to start to correct it. Our assets are up-to-date.
    Can you direct me towards a fix ? At least temporary. Do not hesitate to ask me more.

    Thanks, have a great day.
     
  25. pauldrummond

    pauldrummond

    Joined:
    Oct 30, 2014
    Posts:
    145
    I got the same error when I tried to add Tessellation/Parallax to my project. I'm using HDRP in Unity 2019.4.17f1 LTS. I had to delete all the MicroSplat assets from the global cache and re-download before it would work.
     
  26. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    I don't have access to switch hardware or documentation, so I can't really say what the problem is. Unity's own shaders use an underscore to name variables, so I highly doubt that is the actual issue. And I don't believe I use a double underscore anywhere in the shader code itself. Also, the error states it's openGL related, which is odd because MicroSplat was originally developed under openGL before mac's moved to metal.
     
  27. Sovcenko

    Sovcenko

    Joined:
    Apr 17, 2018
    Posts:
    6
    Thank you for the quick answer ! We will ask directly to someone at Nintendo so. If you have any lead on why a Microsplat terrain would not display on Switch, that could be helpful. We managed to remove all compilation errors by converting all of our terrains in the game in URP, but the terrains still doesn't display.
    Have a great day.
     
  28. ibernd

    ibernd

    Joined:
    Jun 24, 2019
    Posts:
    16
    Hi there,

    a question about terrain blending

    With "small" objects it is noticeable that the starting point of the blending is around 0.3 above the terrain. (tested in different places with updated terrain descriptor data) It is difficult to get a good result with the parameters here, especially if the "blend distance" should be less than 1

    Is there a way to improve the result e.g. with a y-offset on the blending?

    Default sphere with scale 1:
    Screenshot 2021-01-06 103612.jpg
     
  29. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    I have seen this before, and it seems to vary based on the terrain, position, etc- and I can't seem to figure out why, as I now use the same texture that unity uses to displace the terrain in DrawInstanced mode. I could add an offset, but that seems like a hack, I'd rather figure out why this is happening sometimes..
     
  30. ibernd

    ibernd

    Joined:
    Jun 24, 2019
    Posts:
    16

    Thank you for your prompt reply.
    (if it helps) It obviously depends on how smooth the terrain is under the object. On the left you have a pretty good result. The right side, well ..

    Screenshot 2021-01-06 193813.jpg
     
    Last edited: Jan 6, 2021
  31. Neiist

    Neiist

    Joined:
    Sep 18, 2012
    Posts:
    30
    Hello there,

    Any ETA regarding HDRP 10.x support?

    When I import MicroSplat along with the HDRP Support package I get the error "undeclared identifier 'ComputeScreenPos'" If there is an easy fix to have it working before you release a stable version I'm interested.

    Thank you much, kind regards.
     
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    That particular issue was fixed in the latest HDRP adapter, but I only really support LTS versions of the SRPs, as doing anything else is basically throwing your life away..
     
    fusion242 likes this.
  33. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    3,819
    A quick case study with Trax in HDRP:

     
  34. Artini

    Artini

    Joined:
    Jan 29, 2016
    Posts:
    176
    Hi, has anybody succeded with running MicroSplat in Unity 2020.2.1f1 with HDRP?
    err01a01.jpg
    I have the following modules:
    err01a02.jpg
    Whatever I try, there are always errors, like listed below:
    err01a03.jpg
    Any help on that, please.
    Just noticed, that I have not updated all MicroSplat packages to the latest versions.
    Will try again.
     
    Last edited: Jan 10, 2021
  35. Artini

    Artini

    Joined:
    Jan 29, 2016
    Posts:
    176
    What is the highest version of Unity, that supports MicroSplat with HDRP?
     
  36. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    I only officially support LTS versions for SRPs, so 2019.4. However, the compile error you're having is likely because Unity broke the package manager, and it will say you have the latest version when you actually have an older version and refuses to download the new one. Such joy. So you have to clear the package manager's cache to force it to download the correct versions. And if that doesn't work, clear your library and let unity reimport things from scratch.
     
  37. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    543
    Terrain made with World Creator 2 standalone and Gaea. Textures from GameTextures. Built-in render pipeline.

    Additional assets are Enviro and Invector 3rd person Controller.
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      448.7 KB
      Views:
      328
    • 2.jpg
      2.jpg
      File size:
      373.3 KB
      Views:
      318
    • 3.jpg
      3.jpg
      File size:
      584.1 KB
      Views:
      326
    • 4.jpg
      4.jpg
      File size:
      616 KB
      Views:
      323
    • 6.jpg
      6.jpg
      File size:
      541.7 KB
      Views:
      323
  38. Chosko

    Chosko

    Joined:
    Jun 24, 2017
    Posts:
    8
    Hi,

    I can't use the "Per Texture Properties"... when I change one of the properties the material appears unresponsive to any change... some of them also break the material, like Curve Weights.

    No properties flagged
    Screenshot 2021-01-11 224152.png

    Some properties flagged. Some areas become black and nothing happens when changing the values (i tried with all the textures)
    upload_2021-1-11_22-44-30.png

    I read the docs, maybe I am missing something?
     
  39. Chosko

    Chosko

    Joined:
    Jun 24, 2017
    Posts:
    8
    Also, when changing the Interpolation Contrast, also the Alpha of the Tint changes.

    GIF.gif
     
  40. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Most likely you have renamed or moved something in the MicroSplatData directory, or setup multiple times with the same directory, and the PropData that the material looks up is not the same one as what's assigned to the terrain component.
     
  41. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Yeah, that's because the data is packed in the alpha of the tint- since the tint doesn't use alpha..
     
  42. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    Did you ever manage to get it to work? I'm running into the same issue and I can't even find Constant Buffer "VGlobals" and Constant Buffer "UnityInstancing_Terrain" that you mention to remove the underscores D:
     
  43. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    543
    World Creator 2 standalone + Quadspinner Gaea + Game Textures textures + Enviro + Microsplat obviously :). Built in render.
     

    Attached Files:

    jbooth likes this.
  44. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    175
    I have a terrain built with latest gaia pro. I added microsplat and hit convert and the entire terrain disappeared. The material slot for the terrain says "Can't Use Materials With Shaders Which Need Tangent Geometry on Terrain". Somewhat confused, this is just a quick demo scene I built with Gaia Pro, nothing special, what's causing this error, is microsplat not compatible with gaia pro?
     
  45. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    175
    Going to answer my own question here - turned of instanced checkbox and the terrain appeared. So I guess this is some instancing issue?
     
  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    If you change a shader setting on the material (turn a feature on/off) and turn instancing back on does it work? I expect it some state left on the material causing it to end up in a funky state, and once you regenerate the shader it overwrites that state and fixes it..
     
    Clonkex likes this.
  47. TipTop3D

    TipTop3D

    Joined:
    Dec 10, 2015
    Posts:
    9
    Hello!
    I have same/similar problem.
    Unity 2019.4.18f1. HDRP
    MicroSplat HDRP installed
    1. Make terrain
    2. Convert it to MicroSplat
    3. If "Draw Instanced" is on, terrain will disappear. Off will bring it back.
    4. Changing MicroSplat Shader Generator "PBR Workflow" from Metallic to Specular will bring terrain back and it will stay visible even if i change shader back to Metallic. After that "Draw Instanced" state doesn't matter any more.
    5. Terrain Settings activated. If "Draw Instanced" is on i can't select terrains in viewport, only in Hierarchy
    6. Any Paint mode activated. I can select terrains in viewport only if i first select at least one terrain in Hierarchy
    Tried briefly with standard 3D Unity. Everything is the same except 5 and 6. I can select terrains same with or without MicroSplat
     
    kotlaska and jbooth like this.
  48. SgtLame

    SgtLame

    Joined:
    Nov 26, 2015
    Posts:
    129
    Hi,
    I'm using Unity 2020.1.9f1 and microsplat 3.63. I had bought the microsplat terrain collection package, and today I separately bought the runtime procedural texturing module. Everything works fine with the terrain collection, but when I add the runtime procedural texturing module, I get this compile error:
    Assets\MicroSplat\ProceduralTexture\MicroSplatProceduralTextureConfig.cs(187,39): error CS0122: 'MicroSplatPropData.sMaxTextures' is inaccessible due to its protection level


    And the runtime procedural texturing module does not appear in the module inspector.

    Any ideas?
     
  49. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Yeah, upgrade the terrain collection so it's not an older version than the new module.
     
  50. SgtLame

    SgtLame

    Joined:
    Nov 26, 2015
    Posts:
    129
    Sorry about that, thank you!
     
Thread Status:
Not open for further replies.