Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why performance WebGL of PhoneGap is different from firefox or chrome?

I am developing a game with WebGL. When I compile the app with PhoneGap (Apache cordova), the game runs at 10 FPS.

Instead in mobile browsers like firefox or google chrome, I have 60 fps.

Why??

Is there a way to deploy an app made ​​with WebGL that is as fast as a normal desktop?

like image 410
user3350372 Avatar asked Dec 08 '22 09:12

user3350372


2 Answers

WebGL is not enabled in the current WebView. If you are using ThreeJS then you are likely falling back to a software renderer which in most cases will be performing slower.

like image 58
Kinlan Avatar answered Dec 10 '22 23:12

Kinlan


It depends on the engine behind the WebView, and it's usually the same as the built-in browser which almost never updated, and could be months behind the latest build. It means it's not optimized for much recent developments, like WebGL for instance.

Mobile browsers, on the other hand, such as Firefox or Chrome are regularly updated (6-week release cycle) and optimized so they do get an edge in dealing with recent tech.

WebView for Android 4.4 onwards are Chrome-based, so they should perform faster.

like image 37
Joseph Avatar answered Dec 10 '22 23:12

Joseph