River Modeler Documentation

River Modeler

River Modeler
Version: 1.0.1
Review

3.1.River Modeler #

This component is a front-end for generating a river from a spline. It holds all the various settings that control the mesh generation output. Which it outputs to the assigned Mesh Filter component.

All the parameters have tooltips to explain their function (if not obvious). Mouse over one to view it!

Mesh Generation

Triangulation

This controls the distance between each edge loop as the mesh gets generated along the spline.

Low values->High vertex density
Higher values->Lower vertex density

Note that the more vertices there are created, and the longer the length of the splines, the longer it takes to regenerate the mesh.

Shape

Sets the base width of the river.

The “Offset” parameter is particularly useful if the Spline is also used for other purposes, such as terrain carving or object spawning. You may, for instance, want the mesh to generated a little above the actual spline curve (Offset Y+).

The width of the river can scaled up/down using nodes on the spline. See the Spline Tools section.

Displacement

The surface of a flowing body of water is never completely flat in nature, it is typically wavy looking due to subsurface obstructions suck as rocks, pushing the water up slightly.

This type of displacement is emulated by applying Perlin Noise to each vertex. Multiple layers of it if desired.

You may also restrict a noise layer to a slope angle range, using the “Min Max Slope Angle” field. For instance between 0-15º, so that it only applies on relatively flat areas. The same may be done for a range of 35-90, to apply noise to slope/cascades.

Displacement strength can scaled down using nodes on the spline. See the Spline Tools section.

UV

In order for texture maps to be used in any shader applied to the river mesh, UV coordinates must be created. The algorithm ensures that the coordinates stay consistent, no matter the river’s width and length.

In case the water shader animates on the wrong axis (X) or you’ve accidentally reversed the spline, you can opt to reverse/rotate the UV coordinates to counter this.

Foam

On areas of a fast flowing water surface, bubbles of air get mixed and start creating the appearance of foam. The River Modeler does not attempt to approximate this, instead a “foam strength” value is calculated per-vertex through Perlin Noise and store in its color attribute. This vertex color attribute can be read in the water shader, and drive its surface foam effect. This creates an excellent union between tool and shader.

The vertex color channel (RGBA) used by the water shader for foam really depends on which the author choose. Or if it supports this at all.

For Stylized Water 2, and the demo shader, the alpha channel is used, which is the default setting already.

Foam strength can also be added/subtracted using nodes on the spline. See the Spline Tools section.

Transparency

This section merely defines the vertex color channel used to store the transparency weights. See the Spline Tools section.

Events

It’s possible to call functions from other scripts, either before the river is being rebuild and/or after.

For example, you may want to update other aspects of your workflow once a river is finished rebuilding.

Yes No Suggest edit
Last updated on February 28, 2024
0 of 0 users found this section helpful
Suggest Edit