Errors in Playmode after Updateing to Unity 6

I updated to Unity 6 and Cesium 1.10.0 and now I get a lot of errors in playmode that look like this:

Failed to create Physics Mesh from source mesh. One of the triangles is too large. It’s recommended to tesselate the large triangles. Source mesh name:
UnityEngine.Physics:BakeMesh (int,bool)
Reinterop.ReinteropInitializer:UnityEngine_Physics_CallBakeMesh_dUTFInDZC08B3wpYvm01lw (int,byte) (at ./Library/PackageCache/com.cesium.unity/Runtime/generated/Reinterop/Reinterop.RoslynSourceGenerator/ReinteropInitializer.cs:62604)
Reinterop.ReinteropInitializer/ActionNativeFunction:Invoke () (at ./Library/PackageCache/com.cesium.unity/Runtime/generated/Reinterop/Reinterop.RoslynSourceGenerator/ReinteropInitializer.cs:57403)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()

Hi @krumelmonster, welcome to the community!

Thanks for letting us know about this error. I personally haven’t tested Unity 6 yet, but I looked up this error message and it seems that others are getting it as well, as reported on the Unity forum.

Could you try this workaround that I found on Youtube?

If that workaround doesn’t help, we can try to reproduce this ourselves, and see if there’s a way to circumvent it.

This video shows not really a workaround. And the errors occur in playmode, when the tiles are generated , not when the app is build.
I use “google 3d tiles” if that helps.

Hi @krumelmonster,

Thanks for specifying what dataset you’re using. Does it make a difference if you use Cesium World Terrain instead? (Only asking for debugging purposes, I am not suggesting that you shouldn’t use Photorealistic 3D Tiles.)

We’ll work on reproducing your issue on our own machines, and get back to you with what we find. Thank you!

1 Like

The bug also happens with “Cesium world terrain”.

1 Like

Is there any update on this issue?

It is still happening with the latest version of unity and cesium although its now a warning rather than an error.

Detected one or more triangles where the distance between any 2 vertices is greater than 500 units. The resulting Triangle Mesh can impact simulation and query stability. It is recommended to tessellate meshes that have large triangles. Source mesh name:
0x00007fffdc30612d (Unity) StackWalker::ShowCallstack
0x00007fffdc316089 (Unity) PlatformStacktrace::GetStacktrace
0x00007fffdd575c5e (Unity) Stacktrace::GetStacktrace
0x00007fffddb1d30f (Unity) DebugStringToFile
0x00007fffdc0f8330 (Unity) <lambda_4f956d5c6c9b55fb5841f9cc39e6625d>::operator()
0x00007fffdc0eb6b8 (Unity) <lambda_4f956d5c6c9b55fb5841f9cc39e6625d>::<lambda_invoker_cdecl>
0x00007fffdc60eb53 (Unity) PhysicsCommands::Physx::CookAnyPhysicsMesh
0x00007fffdc604ef2 (Unity) PhysicsCommands::Physx::CookCollisionMesh
0x00007fffdc0fff1b (Unity) Physics::CollisionMeshCooking::CookMeshFromUnityMesh
0x00007fffdc0e808b (Unity) PhysicsModule::CreateNxMeshFromUnityMesh
0x00007fffdc09bcb8 (Unity) CollisionMeshData::BakeSharedPhysicsMesh
0x00007fffdc0d2b99 (Unity) PhysicsManager::BakeMesh
0x00007fffdb5161f6 (Unity) Physics_CUSTOM_BakeMesh
0x00000204b9b7e748 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Physics:BakeMesh (int,bool,UnityEngine.MeshColliderCookingOptions)
0x00000204b9b7e68b (Mono JIT Code) UnityEngine.Physics:BakeMesh (int,bool)
0x00000204b9b7e613 (Mono JIT Code) Reinterop.ReinteropInitializer:UnityEngine_Physics_CallBakeMesh_dUTFInDZC08B3wpYvm01lw (int,byte) (at ./Library/PackageCache/com.cesium.unity/Runtime/generated/Reinterop/Reinterop.RoslynSourceGenerator/ReinteropInitializer.cs:63357)
0x00000205b715702b (Mono JIT Code) (wrapper native-to-managed) Reinterop.ReinteropInitializer:UnityEngine_Physics_CallBakeMesh_dUTFInDZC08B3wpYvm01lw (int,byte)
0x00007fffd4401119 (CesiumForUnityNative-Runtime) DotNet_CesiumForUnity_CesiumPolygonRasterOverlay_CreateImplementation
0x00007fffd43f4f23 (CesiumForUnityNative-Runtime) DotNet_CesiumForUnity_CesiumPolygonRasterOverlay_CreateImplementation
0x00007fffd44a3e16 (CesiumForUnityNative-Runtime) DotNet_CesiumForUnity_CesiumPolygonRasterOverlay_CreateImplementation
0x00000204ac20683a (Mono JIT Code) (wrapper managed-to-native) Reinterop.ReinteropInitializer/ActionNativeFunction:System_Action_InvokeCallback (intptr)
0x00000204ac20660b (Mono JIT Code) Reinterop.ReinteropInitializer/ActionNativeFunction:Invoke () (at ./Library/PackageCache/com.cesium.unity/Runtime/generated/Reinterop/Reinterop.RoslynSourceGenerator/ReinteropInitializer.cs:58148)
0x00000204ac206574 (Mono JIT Code) System.Threading.Tasks.Task:InnerInvoke ()
0x00000204bcf4fb84 (Mono JIT Code) System.Threading.Tasks.Task:Execute ()
0x00000204bcf4fb33 (Mono JIT Code) System.Threading.Tasks.Task:ExecutionContextCallback (object)
0x00000204bcf37336 (Mono JIT Code) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x00000204bcf36f0b (Mono JIT Code) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x00000204bcf4f31b (Mono JIT Code) System.Threading.Tasks.Task:ExecuteWithThreadLocal (System.Threading.Tasks.Task&)
0x00000204bcf4ef9b (Mono JIT Code) System.Threading.Tasks.Task:ExecuteEntry (bool)
0x00000204bcf4ee7b (Mono JIT Code) System.Threading.Tasks.Task:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem ()
0x00000204bcf354da (Mono JIT Code) System.Threading.ThreadPoolWorkQueue:Dispatch ()
0x00000204bcf34d2b (Mono JIT Code) System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()
0x00000204bcf34f95 (Mono JIT Code) (wrapper runtime-invoke) :runtime_invoke_bool (object,intptr,intptr,intptr)
0x00007fffe20b697e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007fffe1ff8444 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)
0x00007fffe2035de5 (mono-2.0-bdwgc) worker_callback (at C:/build/output/Unity-Technologies/mono/mono/metadata/threadpool.c:386)
0x00007fffe2038d83 (mono-2.0-bdwgc) worker_thread (at C:/build/output/Unity-Technologies/mono/mono/metadata/threadpool-worker-default.c:502)
0x00007fffe202806b (mono-2.0-bdwgc) start_wrapper_internal (at C:/build/output/Unity-Technologies/mono/mono/metadata/threads.c:1272)
0x00007fffe202827e (mono-2.0-bdwgc) start_wrapper (at C:/build/output/Unity-Technologies/mono/mono/metadata/threads.c:1348)
0x00007ff865b0257d (KERNEL32) BaseThreadInitThunk
0x00007ff8664caf28 (ntdll) RtlUserThreadStart

1 Like

Hi @RandomName87,

There hasn’t been an update on this issue, but it sounds similar to an issue we discovered in Cesium for Unreal.

Basically, in Unreal, the Chaos Physics system hardcodes certain epsilons that don’t adjust for the scale of the values. Something similar may be happening in Unity. In that case, the solution in the linked PR could also apply.

But we haven’t tried this out yet. If you end up modifying the plugin and address this error, let us know – we’d welcome a community contribution to resolve this! :smile:

The error is gone in the latest Unity version (>= 6000.0.14?)

2 Likes

I am using unity 6000.0.20f1 and still see this warning spam using source from URL https://tile.googleapis.com/v1/3dtiles/root.json

Detected one or more triangles where the distance between any 2 vertices is greater than 500 units. The resulting Triangle Mesh can impact simulation and query stability. It is recommended to tessellate meshes that have large triangles. Source mesh name: 0x00007fff17830d7d (Unity) StackWalker::ShowCallstack 0x00007fff17840d39 (Unity) PlatformStacktrace::GetStacktrace 0x00007fff18aa58ce (Unity) Stacktrace::GetStacktrace 0x00007fff1904c87f (Unity) DebugStringToFile 0x00007fff176206a0 (Unity) <lambda_4f956d5c6c9b55fb5841f9cc39e6625d>::operator() 0x00007fff17613a08 (Unity) <lambda_4f956d5c6c9b55fb5841f9cc39e6625d>::<lambda_invoker_cdecl> 0x00007fff17b3bdb3 (Unity) PhysicsCommands::Physx::CookAnyPhysicsMesh 0x00007fff17b32232 (Unity) PhysicsCommands::Physx::CookCollisionMesh 0x00007fff176282db (Unity) Physics::CollisionMeshCooking::CookMeshFromUnityMesh 0x00007fff1761029b (Unity) PhysicsModule::CreateNxMeshFromUnityMesh 0x00007fff175c1a38 (Unity) CollisionMeshData::BakeSharedPhysicsMesh 0x00007fff175fa039 (Unity) PhysicsManager::BakeMesh

Hi @Thaina_Yu, welcome to the community!

I’m not sure that there’s much we can do about this. At some low levels of detail, we show the entire Earth as one model. If we tessellated all the triangles over Earth’s ~500 million square kilometers to be only 500 meters at most, as the message suggests, the model would have hundreds of millions of triangles and Unity’s rendering would surely grind to a halt (if the system didn’t crash first due to being out of memory).

If the latest versions of Unity 6 are still spamming this message, I suggest reporting it to Unity as a bug.

I think it’s worth checking that the message you’re seeing is coming from a Cesium mesh, though. The OP clearly had Cesium in the call stack, but I don’t see anything Cesium-related in your call stack. Is it possible you have another very large mesh?

This is full callstack

Detected one or more triangles where the distance between any 2 vertices is greater than 500 units. The resulting Triangle Mesh can impact simulation and query stability. It is recommended to tessellate meshes that have large triangles. Source mesh name: 
0x00007fff19050d7d (Unity) StackWalker::ShowCallstack
0x00007fff19060d39 (Unity) PlatformStacktrace::GetStacktrace
0x00007fff1a2c58ce (Unity) Stacktrace::GetStacktrace
0x00007fff1a86c87f (Unity) DebugStringToFile
0x00007fff18e406a0 (Unity) <lambda_4f956d5c6c9b55fb5841f9cc39e6625d>::operator()
0x00007fff18e33a08 (Unity) <lambda_4f956d5c6c9b55fb5841f9cc39e6625d>::<lambda_invoker_cdecl>
0x00007fff1935bdb3 (Unity) PhysicsCommands::Physx::CookAnyPhysicsMesh
0x00007fff19352232 (Unity) PhysicsCommands::Physx::CookCollisionMesh
0x00007fff18e482db (Unity) Physics::CollisionMeshCooking::CookMeshFromUnityMesh
0x00007fff18e3029b (Unity) PhysicsModule::CreateNxMeshFromUnityMesh
0x00007fff18de1a38 (Unity) CollisionMeshData::BakeSharedPhysicsMesh
0x00007fff18e1a039 (Unity) PhysicsManager::BakeMesh
0x00007fff18258dc6 (Unity) Physics_CUSTOM_BakeMesh
0x000001f902aff786 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Physics:BakeMesh (int,bool,UnityEngine.MeshColliderCookingOptions)
0x000001f902afee63 (Mono JIT Code) UnityEngine.Physics:BakeMesh (int,bool)
0x000001f902afed4b (Mono JIT Code) Reinterop.ReinteropInitializer:UnityEngine_Physics_CallBakeMesh_dUTFInDZC08B3wpYvm01lw (int,byte) (at ./Library/PackageCache/com.cesium.unity/Runtime/generated/Reinterop.RoslynSourceGenerator/ReinteropInitializer.cs:63440)
0x000001f83f64fa63 (Mono JIT Code) (wrapper native-to-managed) Reinterop.ReinteropInitializer:UnityEngine_Physics_CallBakeMesh_dUTFInDZC08B3wpYvm01lw (int,byte)
0x00007ffef3f316f9 (CesiumForUnityNative-Runtime) DotNet_CesiumForUnity_CesiumPolygonRasterOverlay_CreateImplementation
0x00007ffef3f251e3 (CesiumForUnityNative-Runtime) DotNet_CesiumForUnity_CesiumPolygonRasterOverlay_CreateImplementation
0x00007ffef3fd8176 (CesiumForUnityNative-Runtime) DotNet_CesiumForUnity_CesiumPolygonRasterOverlay_CreateImplementation
0x000001f902ab8f69 (Mono JIT Code) (wrapper managed-to-native) Reinterop.ReinteropInitializer/ActionNativeFunction:System_Action_InvokeCallback (intptr)
0x000001f902ab8e13 (Mono JIT Code) Reinterop.ReinteropInitializer/ActionNativeFunction:Invoke () (at ./Library/PackageCache/com.cesium.unity/Runtime/generated/Reinterop.RoslynSourceGenerator/ReinteropInitializer.cs:58231)
0x000001f902ab8bc1 (Mono JIT Code) System.Threading.Tasks.Task:InnerInvoke ()
0x000001f900bd7625 (Mono JIT Code) System.Threading.Tasks.Task:Execute ()
0x000001f900bd754b (Mono JIT Code) System.Threading.Tasks.Task:ExecutionContextCallback (object)
0x000001f900b9d46e (Mono JIT Code) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x000001f900b9c79b (Mono JIT Code) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x000001f900bd7043 (Mono JIT Code) System.Threading.Tasks.Task:ExecuteWithThreadLocal (System.Threading.Tasks.Task&)
0x000001f900bd66cb (Mono JIT Code) System.Threading.Tasks.Task:ExecuteEntry (bool)
0x000001f900bd63e3 (Mono JIT Code) System.Threading.Tasks.Task:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem ()
0x000001f900b99129 (Mono JIT Code) System.Threading.ThreadPoolWorkQueue:Dispatch ()
0x000001f900b97ee3 (Mono JIT Code) System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()
0x000001f900b98455 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_bool (object,intptr,intptr,intptr)
0x00007fff0521697e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007fff05158444 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)
0x00007fff05195de5 (mono-2.0-bdwgc) worker_callback (at C:/build/output/Unity-Technologies/mono/mono/metadata/threadpool.c:386)
0x00007fff05198d83 (mono-2.0-bdwgc) worker_thread (at C:/build/output/Unity-Technologies/mono/mono/metadata/threadpool-worker-default.c:502)
0x00007fff0518806b (mono-2.0-bdwgc) start_wrapper_internal (at C:/build/output/Unity-Technologies/mono/mono/metadata/threads.c:1272)
0x00007fff0518827e (mono-2.0-bdwgc) start_wrapper (at C:/build/output/Unity-Technologies/mono/mono/metadata/threads.c:1348)
0x00007fffa8837374 (KERNEL32) BaseThreadInitThunk
0x00007fffa8a1cc91 (ntdll) RtlUserThreadStart

I am facing the same issue. It started with an error that crashes the editor in Unity 6000.0.0f1 and after updating to 6000.0.21f1 it is now a warning. I can see that it is not doing much but it’s causing Unity to be slower and therefore the app is slower in play mode.

When we get a chance, we’ll take a deeper look and see if we can find a workaround, even though I’m not extremely optimistic. In the meantime, I suggest reporting this to Unity. I would hope they could at least change Unity so that it reports this just once, rather than slowing down the app by spamming it.