my first iphone app has made it’s way to the app store! just search for “plasma effect” to find it in the store (or click here to open in itunes directly) and download it for free! the app is a modern implementation of the old school demoscene plasma effect. while running you can touch the screen to interact with the plasma and shake the iphone to switch color palettes and plasma shapes.
i used x-code to develop it and did the implementation almost entirely in C. i dipped into the objective-C code only to plumb through the touch and accelerometer values. while i’m sure objective-C is quite nice once you get used to it i just really had no desire to teach my brain to parse it’s wacky notation. here’s the simple api between the obj-c code and the plasma effect:
void EffectCreate ();
void EffectDestroy ();
void EffectRender (float time, float accelX, float accelY, float accelZ);
void EffectShake ();
void EffectTouchBegin (float x, float y);
void EffectTouch (float x, float y);
void EffectTouchEnd ();
the effect itself works by adding three layers of waves (recomputed only when you launch or shake) and looking the wrapped result up in a 256 entry color table. the top layer has perturbed radial waves that come out around where you touch with your finger. to smooth out some of the artifacts from the low precision waves i blend a bit with the previous frame. the plasma is all done on the iphone’s cpu then rendered on a single quad to the screen using open gl es.
making it was quite fun and interesting since i haven’t hobby coded for an apple platform in 19 years! and wow have they come a long way since the apple IIgs! if you have an iphone or ipod touch give it a try! i’m hoping to see more fun demoscene content on this cool platform.