Here is how I implemented this effect in a previous non-unity project. The principle can be applied to Unity though.
Drops are rendered using particles into a RenderTexture. The particle texture represents a distortion map, which means the textures’ red channel encodes the horizontal displacement and the green channel the vertical displacement of a pixel. Particles change transparency over time and alpha is used to modulate the distortion intensity. This allows to change the distortion intensity using the particles alpha.
Since you need the displacement to happen in both directions left/right and up/down, the distortion texture is interpreted like this:
black (0) indicates full distortion to the left/up
gray (127) indicates no distortion
white (255) indicates full distortion to the right/down
(due to texture compression, “no distortion” is often not possible but also not really needed)
You need to render particles additively (see shader blend modes) into the RenderTexture. This makes sure when particles overlap, the distortion gets stronger.
Once the scene and distortion RenderTexture has been rendered, you compose the final image using these two textures as input.
Composition works like this. You create a custom image effect shader and pass the current scene/framebuffer and distortion RenderTexture to the image effect. The image effect first reads the distortion RenderTexture. Then it reads the current pixel from the scene/framebuffer, but offsets the texture-cordinates by the value stored in the distortion RenderTexture (you need to transform the distortion value from 0…1 to -1…+1). The final step is simply to output this pixel.
Thanks for great explanation, I have little question though, wouldn’t it get heavy on mobile? I don’t have great knowledge of shaders thing could you refer some shaders for same?