You can access the world position of the scene in a PP material just by placing the WorldPosition node. Then just take the B channel and subtract your water Z. Then either divide by a scalar or use ceil and clamp.
if you need to bound the effect in a box not just along Z, you could use the function BoxMask.