Website Updates
I made some updates to a couple of entries I did a while ago. Fixed an error in my syntax where I calculated the reciprocal, but then divided by the reciprocal instead of multiplying.
I also changed the entries to show equivalent functions instead of my bad descriptions of what the parameters do.
iOS OpenGL ES Extension Support
This weekend I was adding improved extension support to the Athena engine for iOS. There is a page on the Apple site that tells what device has what extensions but it hasn't been updated since iOS 4.2.
So I ran through each version of GLES on a 1st Generate iPod Touch (MBX), an iPhone 4 (SGX) and an iPad 2 (A5), printing the returned string from glGetString( GL_EXTENSIONS ) for each device.
There are a some new extensions in iOS5, some of which are iPad2 specific. But you can see from the image, each newer device supports all the previous extensions.
I haven't had chance to run it on an iPad1 yet, so it will be interesting to see if there is any difference. I've only wrote a rough idea of what version of what SDK is required to use them.
Anything with '***' does not need the extension to work and has an implementation for that version of OpenGL ES.
For more information on each extension, most of them can be viewed here. Some of the newer ones in the EXT namespace are viewable on the what's new page of the beta for iOS5, though the page calls them by the APPLE namespace still.
iPad 2
I recently got an iPad 2, and the first thing I did after connecting it to iTunes was to upgrade it to iOS5. After I did, iTunes gave me the error "This device is not registered as part of the iPhone Developer Program".
This is easily fixed, all I needed to do was log into the developer portal and add the device UDID, however the screen telling me this was preventing me from getting the UDID.
Eventually I managed to retrieve it from the Organiser in XCode. Glad I didn't brick it in less than 8 hours, I can now play around with airplay once I've flashed my AppleTV.
iOS Vector and Matrix Math: Part 2
Continuing on from my previous post iOS Vector and Matrix Math. I have managed to use matrix multiplication to transform a vector.
Vector Transform
Transforms a vector by a matrix
float matrix[16] =
{
1.0f, 2.0f, 3.0f, 4.0f,
7.0f, 6.0f, 9.0f, 10.0f,
11.0f, 12.0f, 13.0f, 14.0f,
15.0f, 16.0f, 17.0f, 18.0f
};
float vectorIn[4] = { 1.0f, 1.0f, 0.0f, 1.0f };
float vectorOut[4];
vDSP_mmul( &vectorIn[0], 1, &matrix[0], 1, &vectorOut[0], 1, 1, 4, 4 );iOS Vector and Matrix Math
Continued on post iOS Vector and Matrix Math: Part 2.
For the past week or two I've been trying to reproduce the water effect of PixelJunk Shooter on the iPhone, however I seem to have reached a bottleneck with the collision detection used for repulsion when compressing.
I tried changing from Length to Length Squared, to Manhattan Distance, but it still grinded my framerate to 1FPS.
I decided to see if the Accelerate Framework in the iOS SDK had the vector math added to it yet, and to my surprise it had. It may have been added a while ago and I missed it. So I began to replace my math functions with the vector ones.
The strides are for the single precision functions are the number of floats. So for a stride of 8 bytes, you need to use 2.
float vec[2];
vDSP_vclr( &vec[0], 1, 2 );This function sets the contents of a vector to zero. The equivalent function would be this
void vDSP_vclr( float * inVec, const int inStride, const unsigned int inCount )
{
for( unsigned int idx = 0; idx < inCount; ++idx )
{
*inVec = 0.0f;
inVec += inStride;
}
}I haven't used the double precision version of the vector library yet so I don't know if the stride is the count of doubles, or of floats.
I have managed to go from 17 FPS for 650 particles to 30 FPS (I originally had it at 300 particles at 30FPS but it turned out I was profiling in debug). A definite improvement from using the Accelerate library functions for 2d vector math. One of my main issues for getting 1FPS originally was I was island producer was hit testing each particle with itself so it always had the maximum number of particles on each island.
The next couple of pages on this post cover some of the functions (vector and matrix) and their equivalent C++ function.
Catalyst
Whilst working on animation support for Athena for Courage, I began working on a game for the iPhone called Catalyst last weekend.
I was thinking about a game I had played about a month or two before called Polygonal Fury, and realised it would port nicely onto the iPhone.
So I started a OpenGL ES project (and discovered the new version of the iPhone supports shaders), and started with just making some circles bounce around.
Since the collision of a circle is easy, they seems the easiest to setup for interaction with touching the screen.
Initially I just made them "die" if tapped, but later I added the ability of shapes to spawn reactions.
All sprites within the game are triangle fans, but I will probably change them to quads with a texture due to the break that occasionally appears in the geometry, and alpha glow around the edge.
It is not much, but it is a start, I plan to add some more particle types, and maybe a few different upgrades than the ones giving in the Flash version.
The background needs changing, I was thinking of something going on in the background like in another Flash game I played, Spewer, with maybe cut scenes like the Nintendo DS game Contact had.



