The Glass Shader introduced in the previous recipe is static; its distortion never changes. It takes just a few changes to convert it to an animated material, making it perfect for 2D games, which feature water. This recipe uses a similar technique to the one shown in Chapter 5, Animating Vertices in a Surface Shader:
This recipe is based on the Vertex and Fragment Shaders described in the Using grab pass recipe as it will rely heavily on grab pass.
Create a new grab pass shader; you can write your own or start with the one presented in the Using grab pass recipe.
Create a new material for your shader.
Assign the material to a flat geometry that will represent your 2D water. In order for this effect to work, you should have something rendered behind it so that you can see the water-like displacement.
This recipe requires a noise texture, which is used to get pseudo-random values. It is important that you choose a seamless noise texture, such...