A trick to get water shaders on non-plane surfaces

I noticed that both Unity Basic and Unity Pro water, as well as some of the asset store waters only work on planes. You can put them on other surfaces but it doesn’t look right. I needed water on a planet sphere. If you have Unity Pro you can use a render texture to make it happen.

This example is using Unity Pro water but works with Unity Basic Water as well:

Set up a water plane and a camera pointing at it somewhere out of view. Set it to render to a render texture and set the background to white. This will let you control the color from the object you render the water to:

http://www.solescape.net/screens/sphere-water1.jpg

Create a material with a shader that uses a Main Color and a texture, set the texture to the render texture. You can then use this material on non flat surfaces and it still looks good. You can also control the color of the water with the MainColor property:

Blue water:
http://www.solescape.net/screens/sphere-water2.jpg

Red water:
http://www.solescape.net/screens/sphere-water3.jpg

Rendertextures don’t work in Unity Basic: Unity - Manual: Render Texture.

By works with Unity Basic I mean it works with the Unity Basic Water Shader - if you have Unity Pro

Wrap those image links with tags so they show up.

Otherwise, I can see how this could be handy.