1
\$\begingroup\$

I've developed a couple of WebGL games, and am trying them out on Android. I found that they run very slowly on my tablet, however. For example, a game with 10 sprites or so runs as 5fps. I tried Chrome and CocoonJS, but they are comparably slow. I also tried other games, and even games with only 5 or so moving sprites are this slow. This seems inconsistent with reports from others, such as this benchmark. Typically, when people talk about HTML5 game performance, they mention well-known and higher-end phones and tables. While my 7" tablet is cheap (I believe it's a relabeled Allwinner tablet, apparently with the Mali 400 GPU), I found it generally has a good gaming performance. All the games I tried run smoothly. I also developed an OpenGL ES 2 demo (in Java) with 200 shaded 3D objects, and it ran at 60fps.

My suspicion is that the WebGL engines have unacceptably limited support for many low-end and white-label devices (for example, relying on software fallback for no apparent reason), which means there may be a large section of gamers you will not reach when you choose this as your platform. I've heard rumors about inconsistent performance of HTML5 and WebGL on different devices, but no clear picture emerges.

I would like to hear if any of you have had similar experiences with HTML5 or WebGL, or whether I can find information about the percentage of devices I can expect to have decent performance.

EDIT: As a "thorough" way to prove my point, I've started on a WebGL implementation of my own, to see if I can do any better than CocoonJS. Results are promising so far. On said tablet I can draw like 10,000 sprites at 60fps, all updated and drawn in JS through a WebGL compatible API. Check out the APK here. So, I guess that proves that the existing WebGL implementations are really doing something wrong. I'm now in the process of making my games playable in my framework.

\$\endgroup\$
3
  • \$\begingroup\$ OpenGL is designed for hardware-accelerated GPUs which mobile devices usually do not contain. They need to emulate it on the CPU which is likely less fast than code directly written for this purpose. \$\endgroup\$
    – Philipp
    Jun 8, 2014 at 13:42
  • 1
    \$\begingroup\$ Not true in my experience. Even the cheapest tablets have decent GPUs. \$\endgroup\$ Jun 8, 2014 at 15:27
  • 2
    \$\begingroup\$ @Philipp: that is quite inaccurate. Pretty much every single smart phone since the first iPhone has had a hardware GPU. WebGL is based on GLES 2.0 and Android phones as far back as the first Nexus supported that (and Android support mandates hardware GLES 2 since 2011). \$\endgroup\$ Jun 30, 2014 at 2:40

1 Answer 1

1
\$\begingroup\$

CocoonJS implements a direct conversion of WebGL calls to openGL. This allows us to run ludei webgl logo on a Nexus One running android 2.3.4 at 15 fps.

The problem is that mobile GPUs have certain limitation, such as the bandwith limit of GPUs, between others.

This stuff has been discussed here regarding mobile GPU limitations. On the other hand, cocoonJS has special (non-standard) javascript functions to deal with this stuff, such as image.dispose().

I know you're referring to 3D and webGL. WebGl engines has not been created thinking in mobile GPUs, so this theme is recurrent for people running 3rd party engines. The problem isn't webGL, but the way webGl engines are developed.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Thanks for the info. I'll read that thread. Given the evidence though, my suspicion is that it's not the GPU's fault, but the implementation of WebGL in the existing engines. These may have arbitrary limitations, such as limited support for certain chipsets. My suspicion is that if I convert my WebGL code 1-to-1 to OpenGL ES 2, it will be 10-100 times faster (on my tablet, that is). When I have time, I will try this to see if it's true. \$\endgroup\$ Jun 9, 2014 at 10:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .