Sunday, 9 October 2011

Why iPhone4 - 4S is a more significant upgrade than iPhone3G -3GS was

Since the 4S announcement a lot of people have been saying 'so what?', it's kind of tempting to jump on this bandwagon, specially as I was really looking forward to a bigger screen.

But what of the graphics performance? I've read and heard (including on a few iOS podcasts) that it is a far less significant upgrade from iPhone4 than 3GS was from 3G. This is unarguably true in one way, 3G-3GS introduced OpenGLES2.0 and let us graphics coders start using shaders rather like they had been for years on computers and consoles. 

But what did the introduction of 3Gs mean to developers?

The OpenGLES1.1 on the original iPhone and iPod touch required us to go back to the fixed function programming that we'd cheerfully waved goodbye to some years earlier. Slightly depressing that, to mix two textures in a single pass I had to get my head round ES1.1's texture combiner stuff which was almost but not quite like I remembered it from old fixed function D3D. Still, I managed to get multitexture on the landscape and water of Ground Effect which looked kind of cool at the time. Looking at other games it seems few even took it this far, they mostly just drew textured triangles.

3G - 3GS

So along comes 3GS with it's exciting new system, maybe i'll just add support for it into my game but, what's this? I need to rewrite everything? ES2.0 has no built in transform stuff, lighting, a few missing renderstates. All stuff that now has to be done in the shader rather than through gl calls. Much much better but quite a bit of work to get an app to support GL1.1 and GL2.0 at the same time so, it seems to me, very few developers jumped straight on ES2.0.

By the time iPhone4 and iPad1 came out I don't think I had any apps that were enhanced when run on ES2.0 capable devices (I could be wrong). I had a handful of apps that required ES2 but no more than a handful.

At this point developers started supporting ES2.0 natively, they had to because Retina and iPad1 had pretty crappy emulation of GL1.1 (incredibly slow fog for example). Sadly, when you start trying to use ES2.0 shaders at Retina and iPad resolution you find that, if you want to keep the frame rate reasonable, you aren't going to be using very exciting shaders, barely more than what could be achieved with the fixed function really, maybe some primitive diffuse bump mapping or something but, a year or so after the release of 3GS people were finally starting to support it.

Add iPad2 to the mix and suddenly things get interesting, it has something like 9x the GPU performance, it's actually quick enough to run the same kind of shaders we're seeing on the consoles and using that extra performance is pretty easy. Sometimes, it's as easy as just loading a different, longer, more complex shader and maybe turning on MSAA or writing a cool post processing shader.

So, from a gamer's perspective, iPhone4S is being released into a very different world to the one the 3GS was released into. I've heard people theorising about how Epic and Chair must have had early access to 4S to create the Infinity Blade2 demo when, in reality, all they had to do was run the phone version with their very impressive iPad2 enhancements.

4 - 4S

I suspect there are hundreds of developers who were already including iPad2 enhancements in upcoming apps, thousands who were thinking about it, the 4S is just another very good reason to bother with those bigger, cooler and more fun to write shaders.

Support for 4S will be even easier for those using engines like Unity and Unreal, even if they aren't writing their own shaders, they will simply be able to select more interesting ones.

I guess I'll find out myself on Friday if I manage to get a 4S, unless I've done something really stupid I will see my iPad2 enhancements running on a phone without changing a single line of code.

No comments:

Post a Comment