I’m working on an iPhone game that takes place on the ocean surface. Can someone recommend some sample code or tutorials for implementing waves or ripples in OpenGL?
As I write this, iPhone only supports OpenGL ES 1.1, so there is no support for shaders or other fancy effects.
I don’t need anything too fancy. I don’t need reflections, for example. I don’t want to overtax the device. I just need something that sorta looks like an ocean. (But it would be nice if it looked as nice as Koi Pond.)
iPhone is pretty much like a GPU from 1999 in capabilities (e.g. NVIDIA Riva TNT 2). So your most realistic options are just blending several scrolling textures.
E.g. have one texture with some ‘wave pattern’. Set it up into two texture stages, and scroll both in different directions/speeds (via a texture matrix). The setup texture combiners to add the textures together for the final result (or do some other operation; tons of possibilities here).