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)
We have a slightly modified version of the app running on WebGL.
You can try this:
Revert
WebRequestLoader.csto this version: https://github.com/KhronosGroup/UnityGLTF/blob/83d267f2616585fc8aba5391c003c9a5538ada97/UnityGLTF/Assets/UnityGLTF/Scripts/Loader/WebRequestLoader.csAlter this line https://github.com/KhronosGroup/UnityGLTF/blob/bb189f382697317321a583b22f0aab3692414366/UnityGLTF/Assets/UnityGLTF/Scripts/GLTFComponent.cs#L100 to
loader = new WebRequestLoader(directoryPath, asyncCoroutineHelper);And this line https://github.com/KhronosGroup/UnityGLTF/blob/ce8485e3b982d1349f1b4b086cba421faf9b11fb/UnityGLTF/Assets/UnityGLTF/Examples/MultiSceneComponent.cs#L24 to
loader = new WebRequestLoader(directoryPath, _asyncCoroutineHelper);Disable the
Multithreadedproperty from theGLTFComponent.So I have included 2 shaders in the graphics settings
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.
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.