Jump to content
  • Advertisement
Sign in to follow this  
ocelot663

Underwater Effect

This topic is 3771 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, does anyone have any thoughts or ideas on how to implement a distortion effect that mimicks being underwater (all wiggly). I'm thinking something to do with bump mapping but i have no idea where to go from there. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
You can easily implement it with a post process shader. The shader needs 3 textures: diffuse, distortion map 0 and distortion map 1. Diffuse texture contains the scene that you want to distort. distortion maps 0 and 1 are two different displacement maps that contain x and y UV shift values. I believe you can just use regular normal maps for that, as long as they have that wavy look you need.

In the shader you sample and lerp two distortion maps using screen UVs, obtaining the distortion vector. After that, you fudge the screen UVs using the distortion vector and sample the diffuse texture using fudged UVs.

To animate this whole process, just keep on changing the lerp factor from 0 to 1 and backwards.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!