Stylized Water 2
By default, the water effects will flow in the direction configured under the “General” tab. Some effects like normals and foam have a secondary layer that flows in the opposite direction.
For rivers/creeks, the water should always flow in a single direction. This is where the “River mode” option comes in.
When enabled, all the animations flow in the vertical direction of the mesh’s UV. Because of this, the “UV Source” parameter is disabled, as it’s forced to use the mesh’s UV. Surface Foam is also always drawn on slopes, and gradually becomes less visible as the water flattens out.
Included river demo scene
This is a fairly broad subject, this asset doesn’t contain any functionality to do this, since it’s not a modeling tool.
For example, River Auto Material or EasyRoads3D could be utilized to create spline meshes, though the shader will not support RAM’s flowmap painting functionality. But basically any spline tool that can tile a plane mesh will do.
- UV shells are laid out straight, without any overlapping shells (necessary for seamless texture tiling)
- Has precomputed vertex normals (otherwise no way to tell what makes up a steep surface)
- When using normal maps, tangents need to be calculated (eg. Mesh.RecalculateTangents)
- Ideally, no or black vertex colors.
The Bezier Path Creator asset is an example that doesn’t meet these requirements (specifically point 2 and 3).
Should the water flow in the opposite direction, you can use a negative Y direction on the material to mitigate this. Though this indicates you should actually flip your UV map vertically.
Blending rivers with lakes
This is fairly straightforward to achieve, essentially you want the opacity of the river to fade out as it starts to touch the water body.
First, ensure the river material always draws over the other water material, by modifying the render queue on the river material to 3001 (transparent queue + 1). The ZWrite option must also be enabled on the (receiving) water material.
Secondly, enable the use of vertex colors for opacity on the river material
The Green vertex color channel can now be used to make parts of the mesh completely transparent. See the Vertex Colors section for more details. You’d want to paint the end of the river mesh, that touches the lake, so it appears to blend in with it. Some spline tools may offer control over vertex colors per node, which works just as well.