Question: WebGL works on some mobile platforms, but not others


WebGL works on some mobile platforms, but not others

Answers 1
Added at 2016-12-30 05:12

I'm developing a mobile game which needs WebGL to perform well, however WebGL only works on certain devices.

I have a Nexus 10 tablet updated to the most recent Android Lollipop. My game uses WebGL when I run it from Chrome, however when I package the game using cordova the game doesn't use WebGL and is very slow. I've tested the behavior on several other devices as well:

  • WebGL Works:
    • Samsung Galaxy S5 (4.4.4)
    • Blackberry Priv (6.0.1)
  • WebGL Doesn't work
    • Nexus 10 (5.1.1)
    • Samsung Galaxy S3 (4.3)
    • iPad mini 1 (9.3.5)
    • Samsung Galaxy Tab 3 (4.4.2)

I've also tried using CrossTalk but the app it created never starts. After the splash screen it has black background and nothing happens.

How can I fix or debug the issue that WebGL doesn't work on certain devices?

Answers to

WebGL works on some mobile platforms, but not others

nr: #1 dodano: 2017-01-02 07:01

I managed to make it work, The main reason for not using WebGL is some devices that doesn't have a certain feature in the GPU is by default disable WebGL. The only way to force using WebGL, you will need to use CrossWalk and at same time ignore gpu blacklist.

First I added CrossWalk plugin using the following command:

cordova plugin add cordova-plugin-crosswalk-webview

Then I modified the config.xml to contain this part

<preference name="xwalkCommandLine" value="--ignore-gpu-blacklist" />

Also I signed the APK for release and that made the App work.

Adding this preference forced my Nexus 10 to use WebGL and its super fast. Also CrossWalk is very fast and made the app work better on my new BlackBerry Priv.

Source Show
◀ Wstecz