Over a million developers have joined DZone.

WebGL on Mobile: Scirra's Experiment

DZone 's Guide to

WebGL on Mobile: Scirra's Experiment

· Web Dev Zone ·
Free Resource

Mobile productivity apps are huge; but mobile non-productivity apps are huger, if it means anything that three different Angry Birds games enjoyed spots in the top 10 most downloaded mobile apps of 2011, including spot #1. (Facebook, Twitter, and two other games were in that top 10 too.)

So the web developer who wants to write once, run anywhere, and receive many millions of downloads  -- and especially the web developer who has already invested in emerging web technologies -- mobile HTML5 games are red-hot right now.

The mobile web developer interested in WebGL, however, has been out of luck. Is this because device and OS manufacturers just haven't found the time to support WebGL? or does mobile hardware simply lack the power to take advantage of WebGL's processor-skirting reach?

I would have guessed the latter. But HTML5 game development firm Scirra, the makers of the HTML5 game creation tool Construct 2, wants to see if mobile hardware really isn't up to low-level JavaScript just yet.

So Scirra wrote a plugin for PhoneGap to test a small subset of WebGL on various mobile devices.

Their own test results are, for the moment, disappointing, although they do have a reasonable, time-specific, hypothesis:

It's been written for and tested on Android 2.3.4 on a HTC Sensation. However, I was unable to measure any performance benefit using WebGLGap over the Canvas 2D (which I understand is software-rendered). I can't say for sure but I think the Android browser's javascript engine is so slow it negates any performance benefit from using hardware-accelerated rendering, and this is worsened by the fact PhoneGap fundamentally works by stringifying everything between the WebView and the plugin (even all your buffer data).

But the Scirra people are chiefly HTML5 developers, not Android experts, so they're hoping that some more mobile-savvy developers will try their plugin and see whether they can't get WebGL to improve graphics performance on a mobile device.

And even if mobile hardware isn't up to WebGL at the moment, that kind of power probably isn't far off. So check out the plugin and see if you can beat Scirra to productive WebGL mobile development.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}