So I have already implemented the reflection part:
uniform sampler2D texture;
uniform vec2 resolution;
uniform vec3 overlayColor;
void main()
{
vec2 uv = gl_FragCoord.xy / resolution.xy;
if (uv.y > 0.3)// is air - no reflection or effect
{
gl_FragColor = texture2D(texture, vec2(uv.x, uv.y));
}
else
{
// Compute the mirror effect.
vec4 color = texture2D(texture, vec2(uv.x, 0.6 - uv.y));
//
vec4 finalColor = vec4(mix(color.rgb, overlayColor, 0.25), 1.0);
gl_FragColor = finalColor;
}
}
source
http://fc03.deviantart.net/fs70/f/2013/080/d/9/jungle_tranquility_animated_by_fadwaangela-d5yb54c.gif
Now the question is how are these ripples implemented?