Search Unity

[FREE]MicroSplat, a modular terrain shading system for Unity Terrains

Discussion in 'Assets and Asset Store' started by jbooth, Aug 9, 2017.

  1. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    Look at the top of your editor, if it says "DX9 or "DX11 emulated via DX9" then the editor is running in DX9 which doesn't support texture arrays. If not, check to make sure your not set to graphics emulation mode.
     
  2. TommiH

    TommiH

    Joined:
    Jan 14, 2008
    Posts:
    252
    Thanks!

    It indeed says DX9.. But the DirectX Diagnostics Tool says I have DirectX 12...

    Edit: Well, changing it in Player Settings helped. Thanks for pointing me in the right direction!
     
    Last edited: Oct 20, 2017
  3. TommiH

    TommiH

    Joined:
    Jan 14, 2008
    Posts:
    252
    Sorry for double-posting, but I think you might have missed my other question before, because I edited it in after the fact:

    Multi-editing doesn't seem to work with MicroSplatTerrain. The script MicroSplatTerrainEditor seems to have the CanEditMultipleObjects attribute, but if you select multiple objects and assign the Template Material, it only gets assigned to one of them.

    I believe I had this problem with my own code as well at some point. I forget the details, but I think the OnInspectorGUI was still applied only for the "real" selected object or something. And it was my job then to apply the changes to the rest of the objects manually...
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    Yeah, that's most likely because it uses a custom editor, and once you use a custom editor, you have to driver everything through serialized property or use hacks to apply changes across the selection. It's on my backlog to fix this, but not super high priority yet.
     
  5. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    Hi there, i'm having some issues with Microsplat system.

    1) This issue is with another shader asset called Stylized Water:
    As you can see in this screenshot there is no intersection of the water with the terrain and also some other things are disabled:
    upload_2017-10-21_21-7-50.png

    And this is with the standard shader of terain:
    upload_2017-10-21_21-9-17.png

    2) The other problem is that i'm seeing objects under the terrain as you can see in the next photo:
    upload_2017-10-21_21-10-38.png

    Cheers!
     
  6. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    I’d check with the other asset author and see if he has some special requirements for his effect.
     
    Kirbyrawr likes this.
  7. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    Hi, thanks in advance, how about the transparency issue?
    I think all of this is related to depth buffer.. But i'm not sure.
     
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    MicroSplat doesn't use the depth buffer in any way, however, most water effects will use the depth buffer for things like shoreline, so there's a good chance you are correct. It could also be possible that the water effect is set to draw earlier than it should be, but without seeing the shader or scripts it's hard to say..
     
  9. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    Yeah, the water writes to depth buffer, however i have it enabled on the camera.

    Let me know what do you need and i will try to help you.

    Edit: About the water problem i contacted the author, and i explained the problem to him.

    Edit2: The author took a quick look at the problem, however he will take a deep look when he can.
     
    Last edited: Oct 22, 2017
  10. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    About the transparency issue i found that is related to the shadows, however i'm not sure what's causing this.

    With Shadows:
    upload_2017-10-22_12-26-49.png

    Without Shadows:
    upload_2017-10-22_12-27-0.png
     
  11. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    Send me the scene and I'll take a look- but there's nothing in MS that should make it to not write to the depth buffer..
     
  12. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    Hi there, my project is really big actually : / I will try to make a simple scene.

    If i use your MicroSplat material of the example folder in my terrain there is no transparency issues, maybe it's anything related to the TextureArray.

    Things i already tried:
    -Change textures. (It doesn't work)
    -Remove Textures. (It doesn't work)
    -Recreate the shader and the data (It doesn't work)
    -Changing settings around. (It doesn't work)
    -Reinstall MicroSplat (It doesn't work)
    -Tried with your material and data (It works)


    Also amazingly, with your material works the water too.
    upload_2017-10-22_23-53-9.png

    Edit: I managed to workaround the bug by duplicating your example material, however i believe that is something wrong with my splat count, i will redo the texture paint tomorrow and see if that fix it.
    Probably the grab textures from terrain button got a corrupted texture of my terrain data unfortunately.

    Sorry to bother by the way!

    Thanks!
     
    Last edited: Oct 22, 2017
  13. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Hi,

    I had the same problem as DevKirbyrawr on a newly created terrain (shadows could be seen through the terrain, and also no shadows were projected directly on the terrain) in the latest Unity version 2017.2.0f3. However, after I removed the MicroSplat script from the terrain and deleted the MicroSplatData folder, and then added the script again and re-generated the shader it worked. It could be related to normal maps, because I first didn't include any normal maps, or hadn't marked the texture as normal, or because I experimented some with reverting to the old terrain shader and then back again. It's a very simple terrain with just two textures.

    Just a side note: Have you considered releasing an addon to MicroSplat to allow more than 16 textures? I'm doing low-poly, so don't really need all the features of MegaSplat, but I'd love to have a greater number of texture.

    Thanks!
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    That's odd- I can't imagine what would cause that to happen, but if you manage to get a clear repro of how to make it happen please let me know. MicroSplat is limited to 16 textures because Unity's toolset is limited to 16 textures - To go beyond this, you basically have to replace the entire toolchain and use a different technique, which is basically what MegaSplat is.
     
  15. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    Hi there, for reproduce it i only created a terrain, used microsplat converter and no more, i didn't fill the normals or anything.

    Edit: Also doing the work around works but as soon as you put more textures it will break.

    Except this, your system is really good, i bought triplanar module and it made me happy to see how well it's.
     
    Last edited: Oct 23, 2017
  16. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    So, I don't seem to get the shadow issue at all - but if I add a texture to the TextureArrayConfig, I have to press Sync on the MicroSplatTerrain component to get the terrain painter to update with new textures. I can fix this for the next patch, but for now, pressing sync will update the terrain with the new textures after they are added to the array and you press Update on the array.

    If one of you can send me a scene with the shadow issue that would be really useful.
     
  17. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Ahh, I see. I will likely get MegaSplat in the long run anyway, but thanks a lot for releasing this for free! I'll definitely let you know if I manage to reproduce the error.
     
  18. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    I sent a repro project with steps to reproduce the issue and a screenshot to your gmail, let me know if you need anything.

    Cheers.
     
    AdamParker and jbooth like this.
  19. AdamParker

    AdamParker

    Joined:
    Sep 29, 2017
    Posts:
    11
    I am having the same shadow issue as DevKirbyrawr. Object shows through terrain and shadows aren't projected, as shown below (new project, terrain on left was converted to Microsplat, terrain on right is normal Unity terrain, only objects on scene are terrains, cube and directional light):



    I was going to send a repro project but I see DevKirbyRawr already did. If necessary I can provide further information or examples. It does work normally if, as DevKirbyrawr did, I use the material given in the Microsplat example.
     
    Kirbyrawr likes this.
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    Fixed- if you want to fix this yourself and not wait for the UAS to update the package, open MicroSplatShaderGUI_Compler and change the WriteFooter function to:
    Code (CSharp):
    1.  
    2.       void WriteFooter(string[] features, StringBuilder b, string baseName, bool blendable)
    3.       {
    4.          if (blendable)
    5.          {
    6.             b.AppendLine("   CustomEditor \"MicroSplatBlendableMaterialEditor\"");
    7.          }
    8.          else if (baseName != null)
    9.          {
    10.             b.AppendLine("   Dependency \"AddPassShader\" = \"Hidden/MicroSplat/AddPass\"");
    11.             b.AppendLine("   Dependency \"BaseMapShader\" = \"" + baseName + "\"");
    12.             b.AppendLine("   CustomEditor \"MicroSplatShaderGUI\"");
    13.          }
    14.          b.AppendLine("   Fallback \"Nature/Terrain/Diffuse\"");
    15.          b.Append("}");
    16.       }
     
    Kirbyrawr and AdamParker like this.
  21. AdamParker

    AdamParker

    Joined:
    Sep 29, 2017
    Posts:
    11
    Can confirm fix works. Having no problems now. Thanks for the quick response.

    While I'm here, let me ask a question about one of the MicroSplat modules; is the Alpha Hole purely cosmetic or does it also make a hole in the terrain collision? I checked the documentation but found nothing specific on it.
     
  22. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    I don't have an example currently included, but wrote an example one and just haven't had a moment to see if it works yet:

    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6. public class AlphaHolePhysics : MonoBehaviour {
    7.  
    8.    public class ExampleClass : MonoBehaviour
    9.    {
    10.       public LayerMask disableLayer;
    11.       public Terrain terrain;
    12.       public Collider terrainCollider;
    13.       public string tagName = "Player";
    14.  
    15.       void Start()
    16.       {
    17.          if (terrain != null)
    18.          {
    19.             terrainCollider = terrain.GetComponent<Collider>();
    20.          }
    21.       }
    22.  
    23.       void OnTriggerEnter(Collider other)
    24.       {
    25.          if (other.CompareTag(tagName))
    26.          {
    27.             Physics.IgnoreCollision(other, terrainCollider, true);
    28.          }
    29.       }
    30.  
    31.       void OnTriggerExit(Collider other)
    32.       {
    33.          if (other.CompareTag(tagName))
    34.          {
    35.             Physics.IgnoreCollision(other, terrainCollider, false);
    36.          }
    37.       }
    38.    }
    39. }
    40.  
     
  23. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    That should work :), i have the same system in my game and it works good.
     
  24. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    Thanks for the quick fix, this also fix the water issue i was having!
     
  25. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    86
    Hi, Mr Booth! After I updated MicroSplat recently, the triplannar function seems gone on the blended object.. Do you have any clue about this?
    upload_2017-10-25_19-8-38.png
     
  26. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    246
    I'm not sure if this is the case, but you have be wait with updating the core module until the additional modules are also updated (to the same version as the core)
     
  27. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    I'll check it out- the recent update was a minor one that shouldn't break compatibility between modules.
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    Ok, so I see what happened here. When snow is on, you want to use the terrains normal so that snow appears on the edge of the objects, so what the change did was blend the normal across the blend area. However, this means the triplanar's normal is also blended, causing it to blend between the terrain (top down mostly) and triplanar projections over the area, which in your case is undesirable. So what I've done is to add a second terrain distance to control this blending. With it, you can make the blend area for the normals very small, while the blend area for the texture remains much larger. I'll ship a patch for this tonight when I get home (doesn't break compatibility with core, so doesn't require a big update).
     
  29. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,057
    I just noticed that Interpolation is now an option for per-texture -- that's fantastic, I was gonna ask about that!

    But I'm having a new issue as I set up MicroSplat in a new project -- I get this error whenever I toggle a feature on or off. Main MS features still work despite the error, but the per-texture settings don't work at all. Any idea what's wrong?

    GetPixels32 failed: insufficent pixel buffer size (1), must be at least 4 x 4
    0 libsystem_c.dylib 0x0000000097c5e1fb thread_stack_pcs + 11

    EDIT: On Mac, 2017.1, tried both OpenGL and Metal editor.
     
  30. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    Never seen that before. Does it show any of the MicroSplat files in the rest of the call stack? The smallest texture I generate is 16x16..
     
  31. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,057
    Here's the whole thing:

    GetPixels32 failed: insufficent pixel buffer size (1), must be at least 4 x 4
    0 libsystem_c.dylib 0x0000000097c5e1fb thread_stack_pcs + 11
    1 Unity 0x0000000002428d12 backtrace + 18
    2 Unity 0x00000000012187f8 _Z13GetStacktracei + 104
    3 Unity 0x0000000001588575 _Z17DebugStringToFileRK21DebugStringToFileData + 421
    4 Unity 0x000000000158639d _Z17DebugStringToFilePKciS0_i15LogMessageFlagsiiPFvRK11CppLogEntryE + 93
    5 Unity 0x00000000013f634e _ZNK9Texture2D11GetPixels32EiP11ColorRGBA32i + 1278
    6 Unity 0x0000000001b0c125 _ZN13SplatDatabase18RecalculateBasemapEb + 2581
    7 [Mono JITed code] (wrapper managed-to-native) UnityEngine.TerrainData:set_Internal_baseMapResolution (int) + 0xfa (0x11efa7070 0x11efa7199) [0x13c14d660 - Unity Child Domain]
    8 [Mono JITed code] UnityEngine.TerrainData:set_baseMapResolution (int) + 0x36a (0x11efa6cd0 0x11efa705e) [0x13c14d660 - Unity Child Domain]
    9 [Mono JITed code] MicroSplatTerrain:Cleanup () + 0x2de (0x11efa69b0 0x11efa6cc7) [0x13c14d660 - Unity Child Domain]
    10 [Mono JITed code] MicroSplatTerrain:OnDisable () + 0xc5 (0x11efa6880 0x11efa6969) [0x13c14d660 - Unity Child Domain]
    11 [Mono JITed code] (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) + 0xfa (0x11ee842c0 0x11ee844ed) [0x13c14d660 - Unity Child Domain]
    12 libmono.0.dylib 0x000000003b9542c6 mono_get_runtime_build_info + 3654
    13 libmono.0.dylib 0x000000003ba7fdba mono_runtime_invoke + 117
    14 Unity 0x00000000019d455d _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 125
    15 Unity 0x00000000019d445b _ZN19ScriptingInvocation13InvokeCheckedEP21ScriptingExceptionPtr + 59
    16 Unity 0x000000000169af51 _ZN13MonoBehaviour18CallMethodInactiveE18ScriptingMethodPtr + 353
    17 Unity 0x000000000169b36a _ZN13MonoBehaviour17RemoveFromManagerEv + 682
    18 Unity 0x00000000016abcdb _ZN11MonoManager19BeginReloadAssemblyER19DomainReloadingData + 603
    19 Unity 0x00000000016ab8bd _ZN11MonoManager14ReloadAssemblyEb + 125
    20 Unity 0x0000000000a67244 _Z23ReloadAllUsedAssembliesb + 420
    21 Unity 0x0000000000a55e0a _ZN18EditorSceneManager19RestoreSceneBackupsERSt6vectorINS_11SceneBackupE13stl_allocatorIS1_L18MemLabelIdentifier101ELi16EEENS_14PlayModeChangeEb + 266
    22 Unity 0x000000000036ba85 _ZN11Application13EnterPlayModeEb + 533
    23 Unity 0x000000000036743b _ZN11Application12SetIsPlayingEb + 171
    24 Unity 0x0000000000366c2c _ZN11Application9TickTimerEv + 4268
    25 Foundation 0x0000000083f2ce0f __NSFireTimer + 83
    26 CoreFoundation 0x00000000824a2c54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    27 CoreFoundation 0x00000000824a28df __CFRunLoopDoTimer + 1071
    28 CoreFoundation 0x00000000824a243a __CFRunLoopDoTimers + 298
    29 CoreFoundation 0x0000000082499b81 __CFRunLoopRun + 2065
    30 CoreFoundation 0x0000000082499114 CFRunLoopRunSpecific + 420
    31 HIToolbox 0x00000000819f9ebc RunCurrentEventLoopInMode + 240
    32 HIToolbox 0x00000000819f9cf1 ReceiveNextEventCommon + 432
    33 HIToolbox 0x00000000819f9b26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
    34 AppKit 0x000000007ff92a54 _DPSNextEvent + 1120
    35 AppKit 0x000000008070e7ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
    36 AppKit 0x000000007ff873db -[NSApplication run] + 926
    37 AppKit 0x000000007ff51e0e NSApplicationMain + 1237
    38 Unity 0x000000000220e8a5 _Z10EditorMainiPPKc + 853
    39 Unity 0x000000000220ed19 main + 9
    40 libdyld.dylib 0x0000000097c21235 start + 1
     
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    try changing line 114 in MicroSplatTerrain.cs to:

    Code (CSharp):
    1. terrain.terrainData.baseMapResolution = Mathf.Max(16, oldBaseMapSize);
    I think when Unity goes to generate the basemap which it uses for it's distance rendering (Which microsplat does not use) it's getting set to 0 pixels in size, and Unity is no longer checking that value before it tries to create a 0 pixel image.
     
  33. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,057
    Thanks...but that didn't help. Same errors, though this time they don't mention MicroSplat, so maybe that was a red herring. But these errors do appear whenever I toggle MS features on or off.

    GetPixels32 failed: insufficent pixel buffer size (1), must be at least 4 x 4
    0 libsystem_c.dylib 0x0000000097c5e1fb thread_stack_pcs + 11
    1 Unity 0x0000000002428d12 backtrace + 18
    2 Unity 0x00000000012187f8 _Z13GetStacktracei + 104
    3 Unity 0x0000000001588575 _Z17DebugStringToFileRK21DebugStringToFileData + 421
    4 Unity 0x000000000158639d _Z17DebugStringToFilePKciS0_i15LogMessageFlagsiiPFvRK11CppLogEntryE + 93
    5 Unity 0x00000000013f634e _ZNK9Texture2D11GetPixels32EiP11ColorRGBA32i + 1278
    6 Unity 0x0000000001b0c125 _ZN13SplatDatabase18RecalculateBasemapEb + 2581
    7 Unity 0x0000000001b1ceed _ZN14TerrainManager15CullAllTerrainsEP6CameraRK17CullingParameters + 925
    8 Unity 0x00000000010cac53 _ZN6Camera10CustomCullERK23CameraCullingParametersR11CullResultsb + 659
    9 Unity 0x0000000000afd1cb _ZN6Camera18RenderEditorCameraENS_17EditorDrawingModeEPK18DrawGridParametersP11CullResultsNS_10RenderFlagEi + 1323
    10 [Mono JITed code] (wrapper managed-to-native) UnityEditor.Handles:Internal_DrawCameraWithGrid (UnityEngine.Camera,int,UnityEditor.DrawGridParameters&) + 0xa5 (0x144e2ec10 0x144e2ece4) [0x13d0bb330 - Unity Child Domain]
    11 [Mono JITed code] UnityEditor.Handles:DrawCameraImpl (UnityEngine.Rect,UnityEngine.Camera,UnityEditor.DrawCameraMode,bool,UnityEditor.DrawGridParameters,bool) + 0x8e1 (0x144e20250 0x144e20cd4) [0x13d0bb330 - Unity Child Domain]
    12 [Mono JITed code] UnityEditor.Handles:DrawCameraStep1 (UnityEngine.Rect,UnityEngine.Camera,UnityEditor.DrawCameraMode,UnityEditor.DrawGridParameters) + 0x134 (0x144e200e0 0x144e20238) [0x13d0bb330 - Unity Child Domain]
    13 [Mono JITed code] UnityEditor.SceneView:DoDrawCamera (UnityEngine.Rect,bool&) + 0x183f (0x144e1d820 0x144e1f164) [0x13d0bb330 - Unity Child Domain]
    14 [Mono JITed code] UnityEditor.SceneView:OnGUI () + 0x1111 (0x144c367d0 0x144c38954) [0x13d0bb330 - Unity Child Domain]
    15 [Mono JITed code] (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) + 0xfa (0x124c482c0 0x124c484ed) [0x13d0bb330 - Unity Child Domain]
    16 libmono.0.dylib 0x000000003c8c22c6 mono_get_runtime_build_info + 3654
    17 libmono.0.dylib 0x000000003c9eddba mono_runtime_invoke + 117
    18 libmono.0.dylib 0x000000003c9f3b60 mono_runtime_invoke_array + 946
    19 libmono.0.dylib 0x000000003c9b2527 mono_register_jit_icall + 37337
    20 [Mono JITed code] (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) + 0x103 (0x13f319a30 0x13f319b62) [0x13d0bb330 - Unity Child Domain]
    21 [Mono JITed code] System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) + 0x52c (0x13f319000 0x13f31969f) [0x13d0bb330 - Unity Child Domain]
    22 [Mono JITed code] System.Reflection.MethodBase:Invoke (object,object[]) + 0x66 (0x13f318920 0x13f318995) [0x13d0bb330 - Unity Child Domain]
    23 [Mono JITed code] UnityEditor.HostView:Invoke (string,object) + 0xfc (0x13f318800 0x13f318920) [0x13d0bb330 - Unity Child Domain]
    24 [Mono JITed code] UnityEditor.HostView:Invoke (string) + 0x8a (0x13f318740 0x13f3187ee) [0x13d0bb330 - Unity Child Domain]
    25 [Mono JITed code] UnityEditor.HostView:InvokeOnGUI (UnityEngine.Rect) + 0x536 (0x144a110b0 0x144a11bd4) [0x13d0bb330 - Unity Child Domain]
    26 [Mono JITed code] UnityEditor.DockArea:OldOnGUI () + 0x3085 (0x144a03000 0x144a06234) [0x13d0bb330 - Unity Child Domain]
    27 [Mono JITed code] UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI (UnityEngine.Event) + 0x407 (0x14495f3c0 0x14495fded) [0x13d0bb330 - Unity Child Domain]
    28 [Mono JITed code] UnityEngine.Experimental.UIElements.IMGUIContainer:HandleEvent (UnityEngine.Event,UnityEngine.Experimental.UIElements.VisualElement) + 0x380 (0x14495e980 0x14495ef59) [0x13d0bb330 - Unity Child Domain]
    29 [Mono JITed code] UnityEngine.Experimental.UIElements.IMGUIContainer:DoRepaint (UnityEngine.IStylePainter) + 0x182 (0x14495e560 0x14495e706) [0x13d0bb330 - Unity Child Domain]
    30 [Mono JITed code] UnityEngine.Experimental.UIElements.Panel:paintSubTree (UnityEngine.Event,UnityEngine.Experimental.UIElements.VisualElement,UnityEngine.Matrix4x4,UnityEngine.Rect) + 0x2e90 (0x1417f0640 0x1417f3a28) [0x13d0bb330 - Unity Child Domain]
    31 [Mono JITed code] UnityEngine.Experimental.UIElements.Panel:paintSubTree (UnityEngine.Event,UnityEngine.Experimental.UIElements.VisualElement,UnityEngine.Matrix4x4,UnityEngine.Rect) + 0x31c9 (0x1417f0640 0x1417f3a28) [0x13d0bb330 - Unity Child Domain]
    32 [Mono JITed code] UnityEngine.Experimental.UIElements.Panel:Repaint (UnityEngine.Event) + 0x263 (0x1417e6290 0x1417e6792) [0x13d0bb330 - Unity Child Domain]
    33 [Mono JITed code] UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel) + 0x101 (0x1417e5dc0 0x1417e6142) [0x13d0bb330 - Unity Child Domain]
    34 [Mono JITed code] UnityEngine.Experimental.UIElements.UIElementsUtility:processEvent (int,intptr) + 0x198 (0x1417e5a60 0x1417e5c6c) [0x13d0bb330 - Unity Child Domain]
    35 [Mono JITed code] UnityEngine.GUIUtility:processEvent (int,intptr) + 0xb7 (0x1417e56d0 0x1417e57f8) [0x13d0bb330 - Unity Child Domain]
    36 [Mono JITed code] (wrapper runtime-invoke) <Module>:runtime_invoke_bool_int_intptr (object,intptr,intptr,intptr) + 0x116 (0x1417e5800 0x1417e5a53) [0x13d0bb330 - Unity Child Domain]
    37 libmono.0.dylib 0x000000003c8c22c6 mono_get_runtime_build_info + 3654
    38 libmono.0.dylib 0x000000003c9eddba mono_runtime_invoke + 117
    39 Unity 0x00000000019d455d _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 125
    40 Unity 0x00000000004209a6 _ZN7GUIView19ProcessRetainedModeER10InputEventR8GUIState + 230
    41 Unity 0x00000000022046d3 _ZN7GUIView12OnInputEventER10InputEvent + 755
    42 Unity 0x0000000000420090 _ZN7GUIView17ProcessInputEventER10InputEvent + 32
    43 Unity 0x000000000221c2fa -[GUIRenderView renderRect:] + 266
    44 Unity 0x0000000002219eb6 -[GUIMetalView drawRect:] + 406
    45 Unity 0x0000000002206175 _ZN7GUIView10RepaintAllEb + 949
    46 Unity 0x000000000036b5a9 _ZN11Application11UpdateSceneEb + 1049
    47 Unity 0x00000000003675ec _ZN11Application19UpdateSceneIfNeededEv + 108
    48 Unity 0x0000000000366b09 _ZN11Application9TickTimerEv + 3977
    49 Foundation 0x0000000083f2ce0f __NSFireTimer + 83
    50 CoreFoundation 0x00000000824a2c54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    51 CoreFoundation 0x00000000824a28df __CFRunLoopDoTimer + 1071
    52 CoreFoundation 0x00000000824a243a __CFRunLoopDoTimers + 298
    53 CoreFoundation 0x0000000082499b81 __CFRunLoopRun + 2065
    54 CoreFoundation 0x0000000082499114 CFRunLoopRunSpecific + 420
    55 HIToolbox 0x00000000819f9ebc RunCurrentEventLoopInMode + 240
    56 HIToolbox 0x00000000819f9cf1 ReceiveNextEventCommon + 432
    57 HIToolbox 0x00000000819f9b26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
    58 AppKit 0x000000007ff92a54 _DPSNextEvent + 1120
    59 AppKit 0x000000008070e7ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
    60 AppKit 0x000000007ff873db -[NSApplication run] + 926
    61 AppKit 0x000000007ff51e0e NSApplicationMain + 1237
    62 Unity 0x000000000220e8a5 _Z10EditorMainiPPKc + 853
    63 Unity 0x000000000220ed19 main + 9
    64 libdyld.dylib 0x0000000097c21235 start + 1



    Failed to get pixels of splat texture
    0 libsystem_c.dylib 0x0000000097c5e1fb thread_stack_pcs + 11
    1 Unity 0x0000000002428d12 backtrace + 18
    2 Unity 0x00000000012187f8 _Z13GetStacktracei + 104
    3 Unity 0x0000000001588575 _Z17DebugStringToFileRK21DebugStringToFileData + 421
    4 Unity 0x000000000158639d _Z17DebugStringToFilePKciS0_i15LogMessageFlagsiiPFvRK11CppLogEntryE + 93
    5 Unity 0x0000000001b0c1d9 _ZN13SplatDatabase18RecalculateBasemapEb + 2761
    6 Unity 0x0000000001b1ceed _ZN14TerrainManager15CullAllTerrainsEP6CameraRK17CullingParameters + 925
    7 Unity 0x00000000010cac53 _ZN6Camera10CustomCullERK23CameraCullingParametersR11CullResultsb + 659
    8 Unity 0x0000000000afd1cb _ZN6Camera18RenderEditorCameraENS_17EditorDrawingModeEPK18DrawGridParametersP11CullResultsNS_10RenderFlagEi + 1323
    9 [Mono JITed code] (wrapper managed-to-native) UnityEditor.Handles:Internal_DrawCameraWithGrid (UnityEngine.Camera,int,UnityEditor.DrawGridParameters&) + 0xa5 (0x144e2ec10 0x144e2ece4) [0x13d0bb330 - Unity Child Domain]
    10 [Mono JITed code] UnityEditor.Handles:DrawCameraImpl (UnityEngine.Rect,UnityEngine.Camera,UnityEditor.DrawCameraMode,bool,UnityEditor.DrawGridParameters,bool) + 0x8e1 (0x144e20250 0x144e20cd4) [0x13d0bb330 - Unity Child Domain]
    11 [Mono JITed code] UnityEditor.Handles:DrawCameraStep1 (UnityEngine.Rect,UnityEngine.Camera,UnityEditor.DrawCameraMode,UnityEditor.DrawGridParameters) + 0x134 (0x144e200e0 0x144e20238) [0x13d0bb330 - Unity Child Domain]
    12 [Mono JITed code] UnityEditor.SceneView:DoDrawCamera (UnityEngine.Rect,bool&) + 0x183f (0x144e1d820 0x144e1f164) [0x13d0bb330 - Unity Child Domain]
    13 [Mono JITed code] UnityEditor.SceneView:OnGUI () + 0x1111 (0x144c367d0 0x144c38954) [0x13d0bb330 - Unity Child Domain]
    14 [Mono JITed code] (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) + 0xfa (0x124c482c0 0x124c484ed) [0x13d0bb330 - Unity Child Domain]
    15 libmono.0.dylib 0x000000003c8c22c6 mono_get_runtime_build_info + 3654
    16 libmono.0.dylib 0x000000003c9eddba mono_runtime_invoke + 117
    17 libmono.0.dylib 0x000000003c9f3b60 mono_runtime_invoke_array + 946
    18 libmono.0.dylib 0x000000003c9b2527 mono_register_jit_icall + 37337
    19 [Mono JITed code] (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) + 0x103 (0x13f319a30 0x13f319b62) [0x13d0bb330 - Unity Child Domain]
    20 [Mono JITed code] System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) + 0x52c (0x13f319000 0x13f31969f) [0x13d0bb330 - Unity Child Domain]
    21 [Mono JITed code] System.Reflection.MethodBase:Invoke (object,object[]) + 0x66 (0x13f318920 0x13f318995) [0x13d0bb330 - Unity Child Domain]
    22 [Mono JITed code] UnityEditor.HostView:Invoke (string,object) + 0xfc (0x13f318800 0x13f318920) [0x13d0bb330 - Unity Child Domain]
    23 [Mono JITed code] UnityEditor.HostView:Invoke (string) + 0x8a (0x13f318740 0x13f3187ee) [0x13d0bb330 - Unity Child Domain]
    24 [Mono JITed code] UnityEditor.HostView:InvokeOnGUI (UnityEngine.Rect) + 0x536 (0x144a110b0 0x144a11bd4) [0x13d0bb330 - Unity Child Domain]
    25 [Mono JITed code] UnityEditor.DockArea:OldOnGUI () + 0x3085 (0x144a03000 0x144a06234) [0x13d0bb330 - Unity Child Domain]
    26 [Mono JITed code] UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI (UnityEngine.Event) + 0x407 (0x14495f3c0 0x14495fded) [0x13d0bb330 - Unity Child Domain]
    27 [Mono JITed code] UnityEngine.Experimental.UIElements.IMGUIContainer:HandleEvent (UnityEngine.Event,UnityEngine.Experimental.UIElements.VisualElement) + 0x380 (0x14495e980 0x14495ef59) [0x13d0bb330 - Unity Child Domain]
    28 [Mono JITed code] UnityEngine.Experimental.UIElements.IMGUIContainer:DoRepaint (UnityEngine.IStylePainter) + 0x182 (0x14495e560 0x14495e706) [0x13d0bb330 - Unity Child Domain]
    29 [Mono JITed code] UnityEngine.Experimental.UIElements.Panel:paintSubTree (UnityEngine.Event,UnityEngine.Experimental.UIElements.VisualElement,UnityEngine.Matrix4x4,UnityEngine.Rect) + 0x2e90 (0x1417f0640 0x1417f3a28) [0x13d0bb330 - Unity Child Domain]
    30 [Mono JITed code] UnityEngine.Experimental.UIElements.Panel:paintSubTree (UnityEngine.Event,UnityEngine.Experimental.UIElements.VisualElement,UnityEngine.Matrix4x4,UnityEngine.Rect) + 0x31c9 (0x1417f0640 0x1417f3a28) [0x13d0bb330 - Unity Child Domain]
    31 [Mono JITed code] UnityEngine.Experimental.UIElements.Panel:Repaint (UnityEngine.Event) + 0x263 (0x1417e6290 0x1417e6792) [0x13d0bb330 - Unity Child Domain]
    32 [Mono JITed code] UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel) + 0x101 (0x1417e5dc0 0x1417e6142) [0x13d0bb330 - Unity Child Domain]
    33 [Mono JITed code] UnityEngine.Experimental.UIElements.UIElementsUtility:processEvent (int,intptr) + 0x198 (0x1417e5a60 0x1417e5c6c) [0x13d0bb330 - Unity Child Domain]
    34 [Mono JITed code] UnityEngine.GUIUtility:processEvent (int,intptr) + 0xb7 (0x1417e56d0 0x1417e57f8) [0x13d0bb330 - Unity Child Domain]
    35 [Mono JITed code] (wrapper runtime-invoke) <Module>:runtime_invoke_bool_int_intptr (object,intptr,intptr,intptr) + 0x116 (0x1417e5800 0x1417e5a53) [0x13d0bb330 - Unity Child Domain]
    36 libmono.0.dylib 0x000000003c8c22c6 mono_get_runtime_build_info + 3654
    37 libmono.0.dylib 0x000000003c9eddba mono_runtime_invoke + 117
    38 Unity 0x00000000019d455d _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 125
    39 Unity 0x00000000004209a6 _ZN7GUIView19ProcessRetainedModeER10InputEventR8GUIState + 230
    40 Unity 0x00000000022046d3 _ZN7GUIView12OnInputEventER10InputEvent + 755
    41 Unity 0x0000000000420090 _ZN7GUIView17ProcessInputEventER10InputEvent + 32
    42 Unity 0x000000000221c2fa -[GUIRenderView renderRect:] + 266
    43 Unity 0x0000000002219eb6 -[GUIMetalView drawRect:] + 406
    44 Unity 0x0000000002206175 _ZN7GUIView10RepaintAllEb + 949
    45 Unity 0x000000000036b5a9 _ZN11Application11UpdateSceneEb + 1049
    46 Unity 0x00000000003675ec _ZN11Application19UpdateSceneIfNeededEv + 108
    47 Unity 0x0000000000366b09 _ZN11Application9TickTimerEv + 3977
    48 Foundation 0x0000000083f2ce0f __NSFireTimer + 83
    49 CoreFoundation 0x00000000824a2c54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    50 CoreFoundation 0x00000000824a28df __CFRunLoopDoTimer + 1071
    51 CoreFoundation 0x00000000824a243a __CFRunLoopDoTimers + 298
    52 CoreFoundation 0x0000000082499b81 __CFRunLoopRun + 2065
    53 CoreFoundation 0x0000000082499114 CFRunLoopRunSpecific + 420
    54 HIToolbox 0x00000000819f9ebc RunCurrentEventLoopInMode + 240
    55 HIToolbox 0x00000000819f9cf1 ReceiveNextEventCommon + 432
    56 HIToolbox 0x00000000819f9b26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
    57 AppKit 0x000000007ff92a54 _DPSNextEvent + 1120
    58 AppKit 0x000000008070e7ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
    59 AppKit 0x000000007ff873db -[NSApplication run] + 926
    60 AppKit 0x000000007ff51e0e NSApplicationMain + 1237
    61 Unity 0x000000000220e8a5 _Z10EditorMainiPPKc + 853
    62 Unity 0x000000000220ed19 main + 9
    63 libdyld.dylib 0x0000000097c21235 start + 1
     
  34. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    What size does the terrain say the basemap is set to? Both errors seem to be with basemap generation, which Unity triggers any time a shader on the terrain is changed, which is what happens when you toggle an option and MicroSplat regenerates the shader.
     
  35. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,057
    Base Texture Resolution is 16.
     
  36. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    Are any texture's assigned to the terrain (unity's UI)?
     
  37. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,057
    yes, the terrain has for splats assigned to it, on the terrain textures pane.
     
  38. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    Can you send the scene over? Maybe it'll repro on my mac.
     
  39. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,057
    I'll try to extract something I can post for you.
     
  40. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    86
    I haven't got the snow module, so I'm not sure if I could understand this.. Maybe it's time to give it a try on the next fix:)
     
  41. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    No, it was a fix to the snow module so the snow would object-blend with the terrain too, but this broke triplanar working the way it used to (with or without snow). Anyway, you'll be able to control the distance of the blend (like before) but also the distance of the normal blend, which will allow you to get the old behavior as well.
     
  42. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,057
    I'm trying to set up River Auto Material on my terrain, and having the same problem that DevKirbyrawr reported above -- the river loses transparency when I assign my MicroSplat material to it. So then I tried his solution -- assigning one of the MS demo scene materials/data files, and that worked! But then if I make any changes to that material/shader (change number of textures, or toggle on any of the features), then the river loses transparency again. I've tested that several times (reverting the demo files) and it's totally replicable for me -- as soon as I make any change that triggers the MS shader to regenerate, the river loses transparency. Any suggestions?
     
  43. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    Did you get latest of core?
     
  44. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,057
    I thought I did, but I see there's a new one (you really crank those out!), so I got that, and initially the river had transparency, but loses it as soon as I make any changes to the material settings. (And I'm definitely current with all modules now.)
     
  45. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    Can you look in the output shader files and see if they have Fallback "Nature/Terrain/Diffuse" at the bottom?
     
  46. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,057
    They do not -- I see that fallback line in the un-regenerated shader for the Core demo scene, but it's not in the other shaders that have been regenerated.
     
  47. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    Hmm, I wonder if the UAS didn't prop the latest build? If you go into MicroSplatShaderGUI_Compiler and swap the write footer function to this one:

    Code (CSharp):
    1. void WriteFooter(string[] features, StringBuilder b, string baseName, bool blendable)
    2.       {
    3.          if (blendable)
    4.          {
    5.             b.AppendLine("   CustomEditor \"MicroSplatBlendableMaterialEditor\"");
    6.          }
    7.          else if (baseName != null)
    8.          {
    9.             b.AppendLine("   Dependency \"AddPassShader\" = \"Hidden/MicroSplat/AddPass\"");
    10.             b.AppendLine("   Dependency \"BaseMapShader\" = \"" + baseName + "\"");
    11.             b.AppendLine("   CustomEditor \"MicroSplatShaderGUI\"");
    12.          }
    13.          b.AppendLine("   Fallback \"Nature/Terrain/Diffuse\"");
    14.          b.Append("}");
    15.       }
    then it should write that in there when you recompile the shader (toggle an option). I'm doing another push tonight, so hopefully it'll come through this time.
     
  48. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,057
    My apologies -- we're using MAD Compile Time Optimizer and it moves files around, and usually the Asset Store finds those files when importing updates, but apparently not this time, so I was still using older versions. I fixed that and now all is well. Sorry for the trouble.
     
  49. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    86
    Got your point, Mr Booth. Also, when I use the slope feature on the blended object, there is a distortion effect on the object surface that moves with the camera. Could this be the same problem due to the snow module changes? Can't post you a screenshot because it's not on the same machine, but if you are not sure what I mean, I'll try..
     
  50. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,014
    Don't think so - it should be totally stable.
     
unityunity