Hey n/p, that was the reason why I posted the sources. BTW somebody released a distorion source a few days ago that isn't using Copyrect like myine, but a segmented towel in front of the camera. Not sure if it's faster since it requires an addtional renderworld (tho containing nothing but the towel mesh) after copyrect the current render to the pixelperfect texture of the towel. (At least I guess that's how it works, didn't really elaborate)
A word about distortion: For the sake of realism you should no use it the way I use it, for the entire screen when under water. Because in the real world the view under water is completely undistorted, only the things you see from below the watermark that are positioned over the water will be distorted. Sample: when you are under water and you see a helicopter that is a few meters over the water level, it will be distorted. But the shark that you can see right at your left side in not distorted.
It's the same when you watch things that are under water when you are over the water level. The reason why is the various "lense" depth, caused by waves and ripples on the water surface.
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.
A word about distortion: For the sake of realism you should no use it the way I use it, for the entire screen when under water. Because in the real world the view under water is completely undistorted, only the things you see from below the watermark that are positioned over the water will be distorted. Sample: when you are under water and you see a helicopter that is a few meters over the water level, it will be distorted. But the shark that you can see right at your left side in not distorted.
It's the same when you watch things that are under water when you are over the water level. The reason why is the various "lense" depth, caused by waves and ripples on the water surface.
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.