Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when trying to load 2 GLB in WebGL at the same time #131

Closed
De-Panther opened this issue Feb 7, 2021 · 2 comments
Closed

Bug when trying to load 2 GLB in WebGL at the same time #131

De-Panther opened this issue Feb 7, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@De-Panther
Copy link

I try to start loading to GLB files at the same time on WebGL:
https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets/dist/profiles/oculus-touch/right.glb
https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets/dist/profiles/oculus-touch/left.glb

The first one(right.glb) loads, the second one(left.glb) fails but without returning success=false.
It just stops loading at gltfRoot = await Task.Run( () => ParseJson(json) );

gltfRoot = await Task.Run( () => ParseJson(json) );

Waiting for one model to load and then loading the other, does work.

I did notice that while the second model stuck, the first model is in the process of await Prepare()

success = success && await Prepare();

Unity 2019.4.7f1

Also, the package works much faster now and with less stuttering while loading. Thanks :)

@De-Panther
Copy link
Author

It seems that Task.Yield() works well on WebGL, but Task.Run() has issues.

I created an IDeferAgent that returns false for ShouldDefer(float duration) and call Task.Yield in BreakPoint() and BreakPoint(float duration),
and now I do manage to load two models at the same time.

@atteneder
Copy link
Owner

Thanks for the report, and detecting the issue...you pinned it down already! :)

Looks like Task.Run does not work in WebGL yet (more on threading in WebGL).

I'll fix it today.

@atteneder atteneder self-assigned this Feb 7, 2021
@atteneder atteneder added the bug Something isn't working label Feb 7, 2021
atteneder added a commit that referenced this issue May 27, 2024
* feat: Support for exporting glTF shader based materials.
* feat(test): AssertLogger that does not have expected log items/codes.
* feat(test): Tests for GltfMaterialExporter.
* refactor: Moved `UvTransform` into main assembly, due to it's generic usefulness.
* feat: Material exporter is chosen based on used shader by default.
* refactor: Removed redundant shader property identifiers.
* refactor: Dedicated test files per render pipeline, since there are subtle differences.
* doc: Added docs for glTF material export.
fix: Replaced HTML tag superscript with Unicode chars.
fix: Markdown removed table trailing pipes.
* fix: StandardShaderMode is available, regardless of scripting defines/render pipeline usage. It's in its dedicated file now as well.
* chore: Tracking *.jpg files with GIT LFS and converted existing textures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants