Showing posts with label Graphics. Show all posts
Showing posts with label Graphics. Show all posts

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.

Friday, 23 September 2011

Topia: Vortices & the art of screen grabbing

Last night I got stone circles into Topia, these are destinations for herds and a major part of the gameplay. To make them easier to find I threw in a few hundred faint streaking particles that home in on the centre of the circles and move in a cool spiral thanks to simple Newtonian physics, or what I like to think of as simple Newtonian physics. It's just a few adds and multiplies of variables called 'velocity, thrust and momentum' which is about as accurate as I'm prepared, or indeed mathematically able, to get.

Anyway, they are pretty faint and don't really show up well on screen grabs. They look pretty good when moving though which is nice as they aren't just a visual effect. I threw them in as a signpost to the nearest henge-vortex thing. I love it when something serves a gameplay purpose and looks cool at the same time. they can sort of be seen on the following pic.

Josh Tweeted this last night after I sent him a version. I couldn't believe quite how good it looked. I had to check with him that he hadn't done anything sneaky in Photoshop but he swears it's just a grab off his iPad2.


Which is coincidentally very similar to the 'I finally got Retina running at 30 FPS' pic from the blog a few weeks ago.  It's almost the same view though the old version doesn't have the Vortex as the code for those didn't exist back then.



After posting it I got an IM from Josh saying it was "that screenshot you posted looks sort of ugly" which it is.

I have been considering why that might be. The actual differences are:

  • Obviously it's lower resolution,
  • The Retina view doesn't show the atmospheric fogging well.
  • Retina isn't using MSAA as the older devices just don't have the pixel pushing power. 
  • The iPad2 version uses a more complex shader, it does this weird subtle thing with the colour bands on the rocks while the fallback shader just uses a low res 'lightmap' and the texture I'm using as the backdrop of this blog for detail.
  • Josh's grab was taken in the 'early evening' of the day night cycle while mine was taken at 'midday' 
Sadly I think it's mostly the last one and Josh's artistic eye which is slightly irritating as most of the other differences were a lot of coding work. I must stop taking screen grabs with 'force daylight' turned on.

Friday, 19 August 2011

Topia landscape modelling vid


I finally managed to make a video of Topia's landscape modelling. Thanks Jack for helping out.
Hopefully this will illustrate some of the points I've found it slightly hard to make over the last few posts.

Monday, 8 August 2011

Topia: Zoomed out all the way

Distractions, Distractions...
While fixing an irritating bug in the fog calculations I seem to have inadvertently enabled zooming all the way out. That's going to be staying in :)