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

WebView performance substantially impacted when ARCore is in the same app #1653

Open
michaeltheory opened this issue May 19, 2024 · 5 comments
Labels

Comments

@michaeltheory
Copy link

SPECIFIC ISSUE ENCOUNTERED

I am working on a prototype of rendering AR content with WebGL in a WebView in order to support features that WebXR does not yet support. It works perfectly on iOS, but on Android as soon as an ARCore session is created, the WebView framerate drops in half.

I have built the app up carefully with a number of steps. First I set up OpenGL in a custom SurfaceView to avoid compositing GLSurfaceView with WebView. Rendering a transparent WebView on top of a very simple OpenGL scene had no performance impact.

As soon as I initialize a Session the browser framerate drops in half.

I tried to initialize the Session in a thread, and re-wrote the app to accommodate that, but the result is the same. This seems like a bug.

Is there something I can do differently to achieve my desired result, or is this a bug?

VERSIONS USED

  • Android Studio: Android Studio Jellyfish | 2023.3.1
  • ARCore SDK for Android: 1.24.0
  • Device manufacturer, model, and O/S: Pixel 7
  • Google Play Services for AR (ARCore): 1.43.240930493
    On Windows, use: adb shell pm dump com.google.ar.core | findstr /i "packages: versionName"
    On macOS, use: adb shell pm dump com.google.ar.core | egrep -i versionName\|packages:
  • Output of adb shell getprop ro.build.fingerprint: google/panther/panther:14/AP1A.240505.005/11677807:user/release-keys

STEPS TO REPRODUCE THE ISSUE

  1. Outlined above

WORKAROUNDS (IF ANY)

None

ADDITIONAL COMMENTS

@15kingben
Copy link

Is the ARCore Session setting Target FPS 30 or 60? Note that 60FPS was previously disabled, but that should be fixed if the device has Android 14. You could also try changing the Config.UpdateMode from BLOCKING to LATEST_CAMERA_IMAGE

@michaeltheory
Copy link
Author

I just set it to 30 and I have always been using LATEST_CAMERA_IMAGE, same result. When I use BLOCKING the browser gets really bad. I can send you this apk if you'd like? It's a pretty isolated example of just what I've described

@kinjalbhavsar
Copy link

For comparison, can you please share the framerate with and without the ARCore session?

@michaeltheory
Copy link
Author

michaeltheory commented May 29, 2024

For comparison, can you please share the framerate with and without the ARCore session?

It runs at 80-85fps without Session and 48-52fps with. This is a Pixel 7

@michaeltheory
Copy link
Author

Sorry, just wanted to bump this and see if there is any guidance available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants