O'Reilly logo

Unity 5.x Shaders and Effects Cookbook by Kenneth Lammers, Alan Zucconi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing a Water Shader for 2D games

The Glass Shader introduced in the previous recipe is static; its distortion never changes. It takes just a few changes to convert it to an animated material, making it perfect for 2D games, which feature water. This recipe uses a similar technique to the one shown in Chapter 5, Animating Vertices in a Surface Shader:

Implementing a Water Shader for 2D games

Getting ready

This recipe is based on the Vertex and Fragment Shaders described in the Using grab pass recipe as it will rely heavily on grab pass.

  1. Create a new grab pass shader; you can write your own or start with the one presented in the Using grab pass recipe.
  2. Create a new material for your ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required