Project Viz is a bit tricky as not only should everything look the best it can, but it needs to run smoothly and be compatible with mobile and tablet devices. This has not been more difficult than on the water shader.
Typically, a water shader might make use of planar reflections coupled with tesselation to give a nice moving water effect. However for mobile this simply is not an option, working within the limitations of mobile can be difficult at times but nonetheless, perseverance pays off.
The final result is fairly small in size, this is to reduce the total number of instructions for the device to compute. We make use of cheaper alternatives to Fresnel effects and tiling.
It is also important to note that on a mobile device the number of texture samples is much lower than what you might find on a desktop machine, so it was important to make multiple uses of the textures wherever possible. For example, the roughness channel is entirely calculated from the normal texture and fresnel effects, removing the need for a dedicated texture channel.
The bulk of the work takes place above in the colour, roughness and normal calculations, this is what determines the colour of the water as well as the surface reflections and the height of the waves.
The secondary work takes place in the vertex tiling section of the shader, this efficiently tiles the textures using the meshes vertices instead of the pixels, massively improving the shaders performance across all platforms.
Overall we are happy with the final result and we have discovered a large amount of limitations and information on mobile compatibility that we can take forward within the remainder of the project and ofcourse any techniques developed during the course of this project can be used in future releases of Project Viz.