Home

Awesome

Unity 2D Water Shader

Add a nice refraction water shader to your game!

Checkout the video:

Youtube Demo Video

Usage

Try it

Just clone or download the repository and open the folder within Unity.

Run the included Demo Scene.

Use it within your Game

Implement Scrolling

When the camera scrolls left or right, the water waves need to change their phase offset. Otherwise they will appear to be a "camera overlay" flying over the scene.

The DisplacementBehaviour has a scroll offset parameter which can be incremented / decremented on scrolling.

Check out the included CamScrollBehaviour as a reference implementation for scrolling.

What's next

Disclaimer

I am pretty new to shader programming, so the source may not be optimal. Contributions are welcome! :) I tested the shader on Windows, Mac OS, iPad Pro 9.7 and iPhone 7.

Implementation

I am currently writing a tutorial about the details. Stay tuned :)

Contact

Feel free to contact me if you have any questions. In case you are going to use this shader within some application, I'd be happy to hear about :)

Follow me on Twitter: twitter.com/mbue_coding