- This is a intermediate-level tutorial on how to create rivers
In this tutorial, we will
- Use tools in the Terrain panel to carve a simple river bed
- Shape a ribbon node inside the riverbed to form the river
- Modify some of the river's properties, such as to:
- Give it a cubemap texture for the surface of the water
- Change the frequency of the ripples
- Change which direction that the river appears to flow
Important: Rivers can be tricky, so it may be necessary to tweak things a bit during the tutorial, or backup and start over. If things get too tangled, simply UNDO with CTRL-Z, or start over at the beginning of the tutorial and try again.
Create a riverbed
- Create a new heightmap
- In the Terrain panel, click on
- Select the heightmap.
- Adjust your view (S-key and R-key) so that you can see the entire heightmap at once.
- On the Terrain panel, choose a Circular Terrain Brush, with a Solid brush shape, and a Soft Falloff.
- Select the Edit Height tool.
- Using the mousewheel, make a brush diameter of about 20% of the heightmap
- In one quadrant of the heightmap, lower one spot to indicate the depth of the river (if unsure, choose something about 3-4x the height of your character).
- Select the Level Tool.
- Start in the middle of the depression that you just made, and drag a riverbed with one or two gentle curves all the way to the other side of the heightmap.
Create a Ribbon Water node
- In the Create menu, choose "water" to make a Water node.
- Ensure that the water is selected.
- Using the Select & Translate Tool, move the water into the first part of the river depression that you made, slightly below the top of the depression (at water level).
- In the Properties panel, set the water's Shape property to RIBBON.
Shape the water node
- There are two tools that should be used when manipulating ribbon water:
- Note that the handles to modify the water node, will change depending on which tool is currently selected.
- Choose the Select & Translate Tool from the Transform Toolbar.
- Look closely at the mirror node. With the Select & Translate Tool active, there are two ways to modify it:
- Click and drag on a blue circle (control point) to change the shape of the node
- Click and drag on an orange circle, to add a new control point.
- Hover the mouse over one of the blue circles that is near the edge of the heightmap, and, using only the red/blue axes of movement (flat) drag the blue circle out past the edge of the heightmap. Note that the yellow lines along the edge of the water node disappear when they go "underground". The ultimate goal here (at the end of this section) will be to have water completely filling the river depression, with no yellow lines visible.
- Again, using the red/blue axes only, drag the blue circle at the other end of the node, in the general direction of the riverbed. End with the blue circle along the centerline of the riverbed, equidistant from the riverbanks.
- To contine the river, click and drag the next orange circle further along the track, releasing the mouse with the circle on the centerline of the riverbed.
- Continue the above steps all the way off the other side of the heightmap
- To move the river entirely (for practice), hover the mouse over a blue circle, and hold down the SHIFT key, to move the entire river back and forth.
- To delete a control point (if necessary), hover the mouse over it and press the DELETE key. Note that this only works with the Select & Translate tool active. If some other tool is active, pressing DELETE may delete the entire river!
- Next, choose the Width/Depth/Height Tool. With this tool, you can:
- Modify the width of one section of the river
- Modify the width of the entire river at once
- Change the depth of the river
- Change the height of the river.
- Click on one of the blue arrows (it will turn yellow) and drag it back and forth to note how it modifies the width of one part of the river.
- SHIFT-drag any blue arrow, to widen the entire river at once. Try to widen it to the point where all the yellow lines along the edge of the river, intersect with the terrain.
- Be sure to move your viewpoint around and look at the river from multiple angles. to ensure that you're not missing any yellow lines. A yellow line means that the water is not completely intersecting the terrain. This might cause a character to "fall" between the terrain and the water when walking.
- Next, we will give the river some depth. Right now the river is probably a gray color, indicating that its lower bound is not intersecting with the terrain at the bottom of the riverbed (sort of like if there is an air bubble underneath it).
- Click the lower of the two green arrows, and drag downward, until the river turns completely dark blue (no air bubbles).
- Move your viewpoint to one of the riverbanks, then go into character mode and walk up to the edge of the river, to get a sense of the river in perspective.
Modify the node's properties
There are many properties that can be modified to adjust the way that the water looks, but we'll just play with a few of them.
- Position your viewpoint to where you can see the surface of the water.
- Set the river's WaterType property to RIVER (don't worry if this causes it to disappear).
- Set the CubeMap property to \Engine\CleanGame\CubeMaps\hero_cubemap.dds
- Note: The Hero CubeMap is a simple colored cube which is provided with Clean Engine for demonstration purposes, so your water will not look like this water. For actual production, your artists will provide different CubeMaps.
- Click on the "..." button next to the DiffuseColor property to open a color wheel where you can change the tint of the water.
- Modifying the Alpha value of the color (between 0 and 1) will change the Reflectivity of the water.
- Close the color wheel, and modify the Opacity property to change the Transparency of the water (try a value of 0.5).
- Set WaveZoomWidth to 5
- Set WaveZoomDepth to 20
- Set WaveSpeed to 5
- Next, set WaveSpeed to -5 (negative 5), and note how this makes the water look like it's "flowing" in the opposite direction.
- Set WaveZoomDepth to 20
- Set WaveSpeed to 1 (or -1)
- De-select the river (select some other node, or press Escape).
- Go into character mode
- Walk your character into the water.
- If the water is deep enough, your character should automatically begin "swimming" in the water
- Note: Swimming will only work if the mirror/water is not the currently selected object.
- Try carving a riverbed in more complex hilly terrain.
- Create a river that flows downhill, by making some of the control points higher than the others.
- Try the Terrain tutorial.