My development team behind The Wild West is working on a new game, and we wanted to showcase some cool custom water we worked on utilizing some creativity combined with PBR and Vertex Deformation(Skinned Meshes)
Inspired by how games such as Sea of Thieves do their water, water is all real time and deterministic, but is only updated/rendered within the camera’s viewing frustum and a set distance. Doing this correctly allows us to keep it optimized and scale on lower end devices, while keeping the illusion that the water is endless by fading seamlessly into larger, flat planes(bones near the update borders interpolate smoothly to be flat near the edges) - Flat planes are textured the same as the bone planes
Some cool features/information about the water:
-
Optimized(scales bone update distance to stay under 2ms per frame)
-
Real Time(not baked) - Allows for more randomness and different areas to have different wave parameters
-
Bones displaced on all axes using summed gertsner waves
-
Completely synced to the server other clients using @Quenty 's synced clock method
-
Both server and clients have a fast wave height lookup function at any given Vector2(to do things like objects bobbing in the water, underwater camera effects, etc.) - Uses an octree like system to get the bone polygons nearest to your camera then does some math to determine height based on that
-
Zone system that allows us to paint zones and assign different wave parameters to them(in the video you can see an island zone which is much calmer) - Storms are supported but not in this video
-
Water has a global wind direction which it adheres to
-
By doing water like this, we can have a completely endless ocean without worrying about making massive boxes of smooth terrain water.
Something I wish it’d have that I haven’t found a good way to do(mostly because there’s no way to edit surface appearance in real time) is foam. It’d make it look even better and would be pretty trivial to do , but there’s just sadly no support for it unless I want to try to generate it in real time using more bones on top of the mesh, but that could decimate performance.