how to add water effect to an image

Posted by brainydexter on Game Development See other posts from Game Development or by brainydexter
Published on 2011-02-17T22:53:43Z Indexed on 2012/04/14 11:46 UTC
Read the original article Hit count: 308

Filed under:
|
|

This is what I am trying to achieve: A given image would occupy say 3/4th height of the screen. The remaining 1/4th area would be a reflection of it with some waves (water effect) on it.

I'm not sure how to do this. But here's my approach:

  • render the given texture to another texture called mirror texture (maybe FBOs can help me?)
  • invert mirror texture (scale it by -1 along Y)
  • render mirror texture at height = 3/4 of the screen
  • add some sense of noise to it OR using pixel shader and time, put pixel.z = sin(time) to make it wavy

(Tech: C++/OpenGL/glsl)

Is my approach correct ? Is there a better way to do this ? Also, can someone please recommend me if using FrameBuffer Objects would be the right thing here ?

Thanks

© Game Development or respective owner

Related posts about opengl

Related posts about rendering