Some people asked me how I’m doing the water reflections in Last Voyage Of The Orlova, so here’s a quick look at the shader. Download at the bottom of the post.
The solution consists of two components: a shader for the groundwork, and a script to render it on a quad.
The shader has a texture slot and a color picker. The texture is optional, you can just change the water color using the color picker.
The script has settings for the reflection resolution, offset, and which layers should be reflected. I keep the resolution intentionally low (256) because otherwise the reflection is too perfect and it doesn’t look like water anymore. And I like the way it shimmers when you walk.
I’ve packaged the files up so you can try this in your own project right now:
Click here to download.
To get started, add these files to your project’s Assets folder, and drag the reflection prefab into your scene. You can adjust the size and position of the prefab to your needs.
Let me know here or on twitter if you use it, I’d love to see it in action in other places.
If you’re looking to add waves (with physics!) to the water surface, the Zippy Water 2D asset is pretty good. I applied this shader to their water prefab and it works.