I was thinking about to implement this realistic effect. It surely isn't easy. Maybe it could be done with an additional renderworld: Imagine you'll render the scene when everything is hidden that is below the water level. then distort this, with the mentioned function. everything below the water level is now black/invisible. Then render the whole scene again. Then DrawImage the previously distorted render. The black parts will show the undistorted underwater stuff that was rendered with the second renderworld.
It can definitely be done - it's how I did the water for that water thread yonks ago. It's very easy (not least because you can mask out the textures carried by water volumes with entitycolor).