Sign in to follow this  
PixelPicoSean

Why game sometimes blinks while running in cordova webview?

Recommended Posts

Hi I just built a game with Phaser3 (3.10.1) and wrapped with cordova crosswalk (2.4.0), the screen keeps blinking while running on some Android devices. It works pretty well on most devices and even without any issue in the browser instead of cordova from same device.

Anyone has similar experience?

Share this post


Link to post
Share on other sites

I heard setting `preserveDrawingBuffer` to true can help in webgl for older devices. Not sure if that applies to cordova, but worth a try. For phaser you can set it in the game config `{ render: { preserveDrawingBuffer: true } }`.

Share this post


Link to post
Share on other sites

You can look at this topic: http://www.html5gamedevs.com/topic/25507-phaserwebgl-flickering-on-chrome-for-android-v53/

Setting preserveDrawingBuffer worked well, but for some devices, as I was reported by friends, it means big slowdown. Flickering is not caused by browser, but appears on devices with certain GPU. Here is list:

Mali-400,
Mali-450,
Mediatek MT6582

List probably is not complete, so It would be good to add next GPUs if discovered.

You can detect GPU on device like this: https://gist.github.com/cvan/042b2448fcecefafbb6a91469484cdf8 - I did not test it yet, but I am about to, as I have to make changes into one of our games. If you detected "bad" GPU, solution for Phaser 2 was to start game in Canvas rendering. Unfortunately Phaser 3 (3.11.0) is not ready for this yet. There are some fatures currently not supported in Canvas (tint - I added issue on GitHub with solution to support it at least for BitmapText - https://github.com/photonstorm/phaser/issues/3855 or at blog: http://sbcgames.io/category/blog/) and some are not working (RenderTexture - issue from yesterday - again with solution: https://github.com/photonstorm/phaser/issues/3862)

So, you have two options:
 - use preserveDrawingBuffer and some devices may be really slow,
 - switch to canvas for some devices. If you do not need tint or render textures, you are happy and can switch without fixes. Otherwise, you may apply fixes and make your build.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.