4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
11.17k stars 863 forks source link

Glitches on some MediaTek devices #1067

Closed Ardeye closed 3 years ago

Ardeye commented 5 years ago

Describe the bug

Any game exported to android is broken on some MediaTek devices. When exported to web this also happens with webkit based Via browser but works in Chrome.

To Reproduce

Steps to reproduce the behavior:

  1. Make any game in GDevelop. For example, this preinstalled Space Shooter game.
  2. Export it to Android through the GDevelop build service or Adobe PhoneGap.
  3. Try to open on a MediaTek device.
  4. See glitches

Other details

4ian commented 5 years ago

Can you check the version of Chrome running on these Android 6 devices? Also any other glitches with other games?

This looks like a device with buggy GPU drivers.

Ardeye commented 5 years ago

Thank you for the reply! Chrome 74.0.3729.157 Another device which has the same bug is LeEco Le S3 x626 Relevant for any exported game

bil-ash commented 5 years ago

This issue exists not just on Mediatek devices but also on some Unisoc (erstwhile Spreadtrum) devices (including mine). The only workaround which works for me is changing the renderer to Canvas (instead of WebGL) in the file runtimegame-pixi-renderer.js after local export. Using canvas renderer consumes about 10% more RAM as compared to WebGL but at least the problem is solved. PS: I do not have any production level projects.

4ian commented 5 years ago

Thanks for investigating :) This would go in favor of a bad WebGL implementation on the these devices :/ Unfortunately, this is not good for the future, because as the years pass, it's more and more likely that rendering will go toward full WebGL for performance (in GD or elsewhere). Two possible ways to fix that in the future:

For now, activating canvas can be a good solution - though it's much less performant than WebGL.

bil-ash commented 5 years ago

From v5 onwards, pixi.js ships with only WebGL by default. Canvas renderer has been moved to a separate file. This is even worser. At the moment, time is not ripe to leave away android 5 and 6(out of the buggy devices, 2 run android 6 and 1 runs 5.1)

Ardeye commented 5 years ago

This issue exists not just on Mediatek devices but also on some Unisoc (erstwhile Spreadtrum) devices (including mine). The only workaround which works for me is changing the renderer to Canvas (instead of WebGL) in the file runtimegame-pixi-renderer.js after local export. Using canvas renderer consumes about 10% more RAM as compared to WebGL but at least the problem is solved. PS: I do not have any production level projects.

Thanks! What should I change in this file to enable Canvas rendering?

bil-ash commented 5 years ago

Somewhere towards the beginning of the file you will find PIXI.autoDetectRenderer . Replace that with new PIXI.CanvasRenderer

bil-ash commented 5 years ago

Here is the link to pixi documentation on this- https://pixijs.download/v4.8.8/docs/PIXI.CanvasRenderer.html

Ardeye commented 5 years ago

Somewhere towards the beginning of the file you will find PIXI.autoDetectRenderer . Replace that with new PIXI.CanvasRenderer

Thank you! Everything works now :)