UnityGLTF: WebGL run fails with failed thread creation

I’ve built from UnityGLTF from master, added the GLTFComponentto a scene to load a remote GLTF and disabled multithreading. When I built to WebGL I get the following error. I’ve found that the 1.0.0 release builds and runs in webgl.

Related: #138

SystemException: Thread creation failed.
UnityLoader.js:1043   at System.Threading.Thread.StartInternal (System.Security.Principal.IPrincipal principal, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0 
UnityLoader.js:1043 Rethrow as TypeInitializationException: The type initializer for 'System.Threading.Timer.Scheduler' threw an exception.
UnityLoader.js:1043 
UnityLoader.js:1043 Rethrow as TypeInitializationException: The type initializer for 'System.Threading.Timer' threw an exception.
UnityLoader.js:1043   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0 
UnityLoader.js:1043 --- End of stack trace from previous location where exception was thrown ---
UnityLoader.js:1043   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0 
UnityLoader.js:1043 --- End of stack trace from previous location where exception was thrown ---
UnityLoader.js:1043   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0 
UnityLoader.js:1043 --- End of stack trace from previous location where exception was thrown ---
UnityLoader.js:1043   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0 
UnityLoader.js:1043 --- End of stack trace from previous location where exception was thrown ---
UnityLoader.js:1043   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0 

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 22 (2 by maintainers)

Most upvoted comments

We have a slightly modified version of the app running on WebGL.

You can try this:

So I have included 2 shaders in the graphics settings

  1. PbrMetallicRoughness
  2. PbrSpecularGlossiness Then I was waiting for like 3 hours for building, then I realize that it repeats “compiling shader variants” infinitely:

We have not tested with WebGL. If the Task libraries are not allowed, we will have to rework this. WebGL support is likely going to be on our roadmap very soon.

@edumlauer how as the performance been for you? I don’t have any benchmarks to report, but generally I’ve found its very slow to load even small models.

We use glbs with mesh data only, we dont’ have textures on them.

Loading models from disk:

  • 857 KB - 355 ms
  • 15 MB - 2000 ms
  • 82 MB - 6500 ms

I don’t have anything to compare with to say wether its fast or not, but it has been good enough for us.

I realize now that this tests were made in the editor, so I’m not sure how they compare to a webgl build. But as I said earlier results in general have been great, the thing that contributes to slower load times are download speeds that vary for each user.