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

xr-environment attribute causes errors the second time a webxr session is started #4755

Open
3 of 13 tasks
LR17 opened this issue Apr 16, 2024 · 6 comments
Open
3 of 13 tasks
Labels
flag: not model-viewer Problems that are related to our project but are ultimately some other project's issue

Comments

@LR17
Copy link

LR17 commented Apr 16, 2024

Description

When using xr-environment attribute, reopening a webxr session (after having closed a previous one)
causes NPE errors in the console

Live Demo

https://modelviewer.dev/examples/augmentedreality/#ar

Version

  • model-viewer: v3.4.0

Browser Affected

  • Chrome, version: 117
  • Edge
  • Firefox
  • IE
  • Safari

OS

  • Android
  • iOS
  • Linux
  • MacOS
  • Windows

AR

  • WebXR
  • SceneViewer
  • QuickLook
@elalish
Copy link
Collaborator

elalish commented Apr 16, 2024

@bialpio @toji Can you repro this on your devices?

@elalish elalish added the flag: not model-viewer Problems that are related to our project but are ultimately some other project's issue label Apr 16, 2024
@toji
Copy link

toji commented Apr 16, 2024

I can't repro on my devices. Also, I'll note that Chrome 117 is fairly old, having been released 7 months ago. The current release is 124. If @LR17 can update to the latest version and try again, I'd appreciate knowing if it still repros for them!

@LR17
Copy link
Author

LR17 commented Apr 17, 2024

Yes, same error, also with chrome 123

Screenshot 2024-04-17 085124

@toji
Copy link

toji commented Apr 17, 2024

Thanks for confirming! I tried it again this morning and I still can't provoke the issue that you're talking about. Could you also provide the device that you're testing with and also the version of ARCore that's installed on your device? (You can find this by going to Settings->Apps->See All->Google Play Services for AR. The version is listed at the bottom.)

Also, when this error appears does it cause a noticeable disruption to the AR content? (Black screen, no model shown, corrupted display, etc?) Or does the model display as expected and the only indication of a problem is the console messages?

@LR17
Copy link
Author

LR17 commented Apr 18, 2024

It's a Samsung tablet SM-X200
ARCore version is 1.41.233110993

When the error appears the model is still shown but I suspect the light estimation feature is not working properly

@toji
Copy link

toji commented Apr 18, 2024

Thank you again! I really appreciate your willingness to follow up on this.

I'm guessing this is the device that you're referring to. If so, then it should be an ARCore supported device, according to the official support list. There's no compatibility notes listed there indicating that lighting estimation may not work or anything like that. The GPU is relatively low-end so it's possible that it's just not able to keep up with lighting estimation and AR tracking at the same time, but I'd sort of expect there to be a note to that effect it that were the case.

As for the ARCore version, I have a slightly newer one on my devices (1.42) so you may want to see if there's any updates available for "Google Play Services for AR" in the Play store, but it's not too old so I'd be somewhat surprised if that was contributing.

@elalish: I'm going to guess that this particular device is getting into a state where it's either not providing valid lighting estimates or providing them at a lower/more erratic rate, and that's throwing off either Chrome's implementation or Three's/model-viewer's expectations. Worth looking at the Three code first to see if there's any bad assumptions being made about consistency of lighting estimation data being provided. (If so it's probably my fault, I think Three is still using some of my code for that.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag: not model-viewer Problems that are related to our project but are ultimately some other project's issue
Projects
None yet
Development

No branches or pull requests

3 participants