Scirra cog

About Us

We're a London based startup that develops Construct 2, software that lets you make your own computer games!

Archives

Browse all our blog posts

Latest Blog Entries

We love brains!

Join us! Joiiinnn ussss! Mooooree brains!

WebGL arrives on iOS 8 - and more

by Ashley | 4th, June 2014

It's been a great week for HTML5 gaming news. Finally it's confirmed that Safari on iOS 8 will support WebGL! Safari was the last major browser without support, so this pretty much completes the set.

In case you didn't know, Construct 2 supports two renderers: a basic no-frills "canvas2d" renderer, and a low-level OpenGL-based WebGL renderer. The WebGL renderer is chosen first if it's available because WebGL mode is a lot faster and it supports awesome visual effects. This means faster and better looking games from iOS 8. On an iPhone 4S we've seen the Space Blaster performance test get topped up from 40 FPS to 58 FPS, and other demos with heavy use of particles or tiled backgrounds going from under 20 FPS to a solid 60 FPS. This is huge - finally the true performance of the often powerful iOS devices has been unlocked!

When iOS 8 rolls around later this year, the latest versions of all the major desktop and mobile browsers will support WebGL, including Internet Explorer, Windows Phone, iOS, and Chrome for Android. It's been nearly 3 years since we first introduced the WebGL renderer for Construct 2, and at the time it only worked on desktop Chrome and Firefox - and having it on mobile seemed like a distant dream. The progress since then has been pretty stunning.

It gets better: faster web view

Conventional wisdom for a couple of years now has been "don't use PhoneGap - it's far too slow, use specially accelerated non-browser wrappers instead". This will change with iOS 8 as well. The reason PhoneGap used to be slow is because showing a HTML5 game in a native app required using a web view control, and that control did not have the full performance of the browser, lacking GPU acceleration (making rendering incredibly slow) and not allowing JIT-compilation of Javascript (making the game logic slower). iOS 8 fixes this. The web view control in native apps can use GPU-accelerated WebGL and JIT-compile Javascript for maximum performance - making it on equal terms with the Safari browser.

And better: faster Javascript

Recently the Safari engineers announced a very impressive addition to their Javascript engine: the Fourth Tier LLVM (FTL) JIT. The linked blog post is deeply technical and outlines a quite extraordinary engineering achievement if you understand the details. However in short there's a new layer in the Javascript engine which optimises the code with a full-blown native-grade compiler (LLVM). This is more traditionally used with native languages like C and C++, but now helps power their Javascript engine. On top of that it compiles in parallel, so the game isn't held up having to wait for compilation to finish. And all this runs in the web view as well!

Another indirect benefit is other browser makers probably won't like to be out-done - so this could spur on further progress in speeding up other Javascript engines even more.

Android is improving too

At pretty much the same time, Android has been fixing up its web view along similar lines. Android 4.4 (KitKat) introduced a Chrome-powered web view for native apps, and it's always been able to JIT-compile Javascript for best performance, but it still didn't have GPU acceleration for games. Android 4.4.3 adds GPU acceleration for canvas2d and support for GPU-accelerated WebGL is being worked on, and seems likely to make a near future Android release. In short this means the same will be true of native apps on Android: they will have the same performance and features as the Chrome browser, even from PhoneGap or other web view controls.

Android has generally had a rather sedate rate of distributing updates, so it may take longer than iOS for these updates to get a wide foothold in the Android world. However it will happen eventually, and in the mean time there's Crosswalk that essentially can do the same thing already.

The end of wrappers

Non-browser wrappers have generally only been necessary on iOS and Android, and only really iOS since the introduction of Crosswalk for Android. All other platforms already perform well, even from native apps. Wrappers often prove a bit of a headache for compatibility: typically various browser features are missing, like the ability to use form controls, XML parsing, web fonts, Web Audio API features (like advanced audio effects), sensible memory management, or the letterbox scale modes. The improvements in iOS and Android mean we will soon be able to do away with these technologies entirely and rely on real, fully-capable browser engines to power games in native mobile apps. Then the conventional wisdom of "don't rely on PhoneGap or web view controls" can be thrown away, since those technologies can be relied on to provide great results as well.

The web is the platform

When we first got going with Construct 2, it was before any browser has GPU acceleration, and IE8 was still the latest and greatest from Microsoft without any HTML5 support at all. Our focus was to build a tool that could produce HTML5 games that surpassed the old clunky Flash games that were previously popular. We think we've achieved that, but at the same time it's become less relevant. We have been amazed at the progress over the past couple of years as powerful, capable and surprisingly cheap mobile devices have become prevalent, new stores with HTML5 support have appeared (including some very significant additions like the Windows Store) and even consoles have started to support HTML5 as a way of producing beautiful and immersive high-resolution games, and there are even now entire HTML5-only devices like the Chromebook and Firefox OS. We've never been more confident in the ability of HTML5 to provide highly compatible multiplatform native-grade gaming experiences, and we are looking forwards to the further developments still to come in the future.

Now follow us and share this

Tags:

Comments

9
TGeorgeMihai 7,121 rep

Great news !!!

Wednesday, June 04, 2014 at 10:03:47 PM
5
iGamersBox 4,573 rep

Great! saw the video from wwdc! didn't get most of thing. But I understood that they are now concentrating on converting there device into complete hardcore gaming gadget! In the software and hardware perceptive.

@ashley thanks for the post.

Wednesday, June 04, 2014 at 10:05:40 PM
6
CandyFace 3,258 rep

This sounds really good! I really like that they've put focus on the javascript engine. Can't wait to see the changes.

Wednesday, June 04, 2014 at 10:06:06 PM
6
Beaverlicious 9,933 rep

YEAHHHH!!
Finally these narrow minded sect goes into the right direction! That´s beaverlicious!

Wednesday, June 04, 2014 at 10:11:16 PM
3
klkitchens 2,150 rep

Does this mean compiling to CocoonJS and a native app is no longer going to be supported?

Wednesday, June 04, 2014 at 10:21:18 PM
8
Ashley 188.2k rep

@klkitchens - we're not going to drop support, so people who already rely on them can keep using the same technologies. However in future there won't be much point in using them, it will simply be easier and better to rely on something like PhoneGap.

Wednesday, June 04, 2014 at 10:28:30 PM
4
teahousemoon 5,573 rep

Awesome post Ashley; thanks for condensing all this information! I'm sure you're as excited about this as anyone :D.

Wednesday, June 04, 2014 at 11:03:41 PM
3
andorade 1,788 rep

Finally! It was absolutely necessary!

Wednesday, June 04, 2014 at 11:51:17 PM
3
Amon 2,653 rep

Good news! I can, as webgl evolves, worry les and less about super optimizations. So yeah, good news.

Thursday, June 05, 2014 at 1:12:41 AM
3
dthomasdigital 2,838 rep

This is good news indeed, I think I picked the right technology to learn.

Thursday, June 05, 2014 at 2:44:58 AM
3
Paradox 38.8k rep

Wow, great news. Raising the bottom bar works as well as "raising the bar" no one likes being last.

Thursday, June 05, 2014 at 3:48:34 AM
2
level1sb 3,066 rep

Awesome news!! Thanks for breaking it down and making it easy to understand :)

Thursday, June 05, 2014 at 4:10:36 AM
3
klkitchens 2,150 rep

@Ashley I guess I'm confused. Will PhoneGap allow us to make apps that appear "native" and not just web pages?

Thursday, June 05, 2014 at 5:02:45 AM
4
Daggio 5,306 rep

wow awesome news! purchasing C2 license really is a great decision!

now I just need to make money from my games....

Thursday, June 05, 2014 at 5:18:25 AM
4
REDVWIN 1,779 rep

No love for iPhone 4... Well... 4s and iPod Touch 5 will be the target devices for future developments... Hope to see projects that really push the envelope in top of the line iOs devices.

Thursday, June 05, 2014 at 5:41:38 AM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.