Creating a water effect

Posts: 40
Joined: 2009.05
Post: #1
Hi All,

I'm sure this must have been covered somewhere already. I've implemented a water ripple effect based on the code here (there are similar samples over the web):

The basic algorithm computes a set of ripple heights. These are then used to create a image where the pixels are taken from a source image with an offset applied based on the ripple height.

I've got this running reasonably fast just creating a bitmap in memory and turning that in a CGImage for display using core graphics.

Does anyone have any suggestions on how to go about doing this in OpenGL? Should I keep my current code for generated the distorted image and upload that as a texture for each frame?

I did think that I could draw the image with a bunch of triangles and modifiy the texture coordinates to point to the right bits of the source image - but that sounds like it would be a lot of triangles.

Or is there something cleverer I can do?

Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Wave tips 2d water chrisevans1001 1 4,230 Dec 9, 2011 04:12 PM
Last Post: OneSadCookie
  Water effect markhula 9 12,475 May 10, 2011 12:03 AM
Last Post: markhula
  Odd effect on loading a .png with alpha channel. Madrayken 4 4,844 Jul 14, 2009 03:45 PM
Last Post: Madrayken
  How do the hell do the water effect in koi pond? Najdorf 14 12,346 Mar 23, 2009 04:21 PM
Last Post: aBabyRabbit
  Texture2d rainbow effect on flip THRESHE 15 11,135 Mar 19, 2009 08:33 AM
Last Post: AnotherJake