-
Notifications
You must be signed in to change notification settings - Fork 702
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
Poor/slow performances #342
Comments
As Pixel C supports Vulkan, your app may run on Vulkan if you don't tweak any setting for Android. Vulkan is still new and not optimized well for the whole system, a WebView view might be interfered with Vulkan. Could you please try to disable Auto Graphics API and enable only OpenGLES2/OpenGLES3 as below: |
Thank you for your answer ! It's not critical for my demo project so for now i just redirect from the webpage to the native app via an URL schema. |
I further investigated and finally found a Unity 2018-specific issue: https://stackoverflow.com/questions/12429792/how-to-dynamically-change-attribute-of-an-xml-node-with-c-sharp . I've fixed the post-process for Unity 2018 in #344 and confirmed a resulting apk contains Thank you very much for your report! Could you please try the latest? |
Awesome !! It took me some time to figure out i had to use gradle builder instead of internal to get postprocessor executing (so it had no chance to work before that anyways... ahem) If i inspect the AndroidManifest.xml inside the generated APK the "hardwareAccelerated" property is set to false on the node which seems weird to me but performances are good anyways. Is it normal ? PS: thank you for your reactivity !! |
Oh ! I forgot to mention, i think you forgot to add the new postProcessor to the UnityPackage and the Zip. I had to get it from there and add it to my project manually : |
…ckage fixed Rakefile and README.md (cf. #342).
Thanks again! I've fixed to include UnityWebViewPostprocessBuild2018_1.cs and updated binaries.
Hmm, it should be set to true, maybe there might be confusion as I missed the new post-process script to be included. The following is a screen shot of |
UnityWebViewPostprocessBuild.cs in the package is built with three source plugins/**/Editor/UnityWebViewPostProcessBuild*.cs. Could you please open it and check whether it contains the content of UnityWebViewPostprocessBuild2018_1.cs? Line 76 in d9ac7d8
About the hardwareAccelerated flag, could you please try to build the sample app (if you currently try to build your app)? |
Ah, also in the past, I've experienced --- UnityWebViewPostprocessBuild.cs.orig 2018-08-23 09:51:39.000000000 +0900
+++ UnityWebViewPostprocessBuild.cs 2018-08-23 19:39:27.000000000 +0900
@@ -1,5 +1,5 @@
-#if UNITY_ANDROID
-#if !UNITY_2018_1_OR_NEWER
+#if true
+#if !true
using System.Collections;
using System.IO;
using System.Xml;
@@ -85,8 +85,8 @@
}
#endif
#endif
-#if UNITY_ANDROID
-#if UNITY_2018_1_OR_NEWER
+#if true
+#if true
// cf. https://forum.unity.com/threads/android-hardwareaccelerated-is-forced-false-in-all-activities.532786/
// cf. https://github.com/Over17/UnityAndroidManifestCallback
using System.IO; |
Okay, now I introduced a new unified UnityWebviewPostprocessBuild.cs that has no dependency for UNITY_ANDROID/UNITY_IOS flags, and updated binaries. This one should not have the issue described above. |
Just tried and it seems all good thank you :D ! Thank you very much for your support 🥇 |
Thank you for the detailed note! |
Hello !
Before anything, thank you for your work and for sharing it !
Now, my problem.
I just tried this plugin on android and i get very very poor performances.
I first tried on my Vurforia project (making sure vuforia is disabled while webview is displayed) and the performances of my page are literally desastrous on a Pixel C (~2-6 fps when scrolling a scrollable div with very few animations and images on it) on OnePlus 6T it's ok but still slower than on the brower.
The page works perfectly fine on chrome on the same devices.
I tried the sample project, same problem.
I just realized that when splitting the screen to display two apps at the same time, the webview being smaller it runs way more smoothly. (probably due to some rasterization stuff?)
Is there anything i'm missing ? Hardware acceleration is properly enabled on the android manifest.
Thank you :)
The text was updated successfully, but these errors were encountered: