Tutorials

As the river flows

Lightwave 5.6 tutorial 
by Morten Moen

Part 1: Modelling the river and waterfall

Rivers may contain a number of different features including
  • Waterfalls
  • Stones and other objects rising above the water
  • Stones that are so low that the water flows over them generating a small drop or miniature waterfall on the downstream side
Stones above the water will divide the river current in two.  There will generally be some wave action on the upstream edge on the stone.  These waves tend to contiue some distance down the sides of the stone.  This is the same thing that happens around the bow of a boat.  Downstream from the stone there will be an eddy.  This is an area of calm water travelling upstream towards the stone.

Stones that generate small waterfalls or drops will not have the same wave action in front.  There will however be a very powerfull eddy or stoper wave below.  This wave is generated as the water passing over the stone falls down into the river with some force.  This water will go to the bottom, and then it will be forced up again and backwards forming a rotating cylinder of water where the top rotates upstream.  As the upstream water meets new water going over the edge and down, white chaos forms.

So the river and falls object willl have a number of different textures.

  • The river surface will be blue-ish water texture flowing downstram along the X-axis.
  • The vertical falls will be a white chaotic texture tumbling down along the Y-axis.
  • Stoppers will have much of the same characteristics as the falls as they actually are small waterfalls, but they will travel up-stream, towards the left on the X-axis.
  • Any eddies should be rather calm water going up-stream..
We could ofcourse assign different surfaces to the polygons making up the river surface, the falls and so on, but this would generate sharp transitions between the different textures, and we do not want that.  What we will do is to use the Texture Center and Texture Falloff parameters to define horisontal layers with different values on the Y-axis where each texture exist.  We will set up the textures as follows:
  • Y = 0:  River surface
  • Y = -10 centimeters: Falls
  • Y = +10 centimeters: Stoppers
  • Y = 5 cm: Eddies
We will then make sure that the polygons that will have a specific texture are placed on the appropriate vertical level.  All river polygons will have Y coordinates of 0 meters and all falls polygons will have Y values of -10 centimeters.  Note that we will be cheating a bit on the eddies.  With only the first three textures, there would be ok to do a transition from river to falls and from river to stoppers.  The transition from falls to stoppers would not be needed, so all is fine.  When we introduce the fourth texture that sould also transition into the river texture, we also introduct a problem.  The places above and below the river texture are taken.  There are no where to put a new texture and have it transition into the river texture without going through another texture.  This would mean that there would allways be either falls or stoppers around the eddies.  To solve this problem, we will not set up a separate texture for the eddies, but rather place the eddies polygons between the stoppers and the river.  This will make a texture that is somewhere between the blue river color and the white stopper color and that travels upstream.  If we position the polygons right, we may be able to get rid of enough white and still have a bit of upstream motion on it.

This layered texture setup dicates a flat structure, so we will later shape this into the final form using a morph target.  The fine things about morph targets is that polygons are textured according to the source object before the object is reshaped into the form of the morph target.  That is if  Morph Surfaces under the Deformations tab in the Object panel is not checked.

Enough of the introduction, lets start modelling.

1. We will start by making the main object of the river/falls assembly.  This will be a flat object that we will morph into the right shape later.  Make a box using the following data: 

You now have a rectangle consisting of three polygons.  These will eventually be (from left to right):

  • The main river surface
  • The bend from the river surface to the falls
  • The vertical falls surface
Before doing anything else with this object, flip polygons so that they face upwards. 

2. Make a new surface and call it RiverAndFalls and apply it to the object. 

3. Select the two points on the border between the first and second polygons (still counting from the left) and press CTRL-V to bring up the Set Value dialog.  Set the X value for these points to 0 meters.  Select the points between the second and third polygons and set the X value for these to 20 meters.  This gives us a 20 meter bend into the falls. 

4. This is where we start defining the different sub-textures.  The object we have made currently needs two textures:  the river texture and the falls texture.  As discussed earlier, this will be done by placing the polygons that shall have these textures at different Y coordinates.  The  leftmost polygon shall have the river texture, and the rightmost polygon needs the falls texture.  We initially made the polygons at Y = 0 meters, so all we have to do is to move the falls polygon.  Select the rightmost polygon and give it an Y coordinate of -10 centimeters using the Set Value dialog (CTRL-V).  The mid plygon from the right will now be at Y = 0 meters at one end and Y = -10 centimeters at the other end.  This will generate a transition between the two textures. 

5. This step is not really necessary here, but I thought I should throw it in to show this technique.  Later on we are going to bend the middle polygon into the shape of the edge of the waterfall.  To do that, we need to select only that polygon before bending.  That is easy now, but before we do that, we'll subdivide both the middle and the right polygon quite heavily. Now the task of selecting the polygons to be bent may be more dificult.  Generally in situations like this I like to assign special surface names to selections of polygons that may be difficult to grab later on. 

Select the middle polygon and apply an new surface called Handle.  Do not bother with the settings for this surface because we will loose it before we finish the object. 

6. Select the right and the middle polygons.  The selected polygons are the falls and edge polygons.  Press SHIFT-D, select faceted subdivision and press OK.  Do this a total of five times.  Press SHIFT-T to make triangles of all the selected polygons.  The leftmost large river polygon should still be one large rectangle and it should not be trippled. 

7. The first version of the river will only have the waterfall and nothing of the other features that were mentioned earlier.  We will come back later to but these in.  Until then, save an intermediate version of the object as it stands now and call it Stage7.lwo. 

8. Deselect all polygons.  Copy the object by pressing 'c' and paste it into a new layer using the 'v'-key.  This is it for the first version of the river object.  It still have the Handle surface assigned to the mid section.  make sure everything is deselected and assigne the WaterAndFalls surface to the entire object.  Save it as RiverSource01.  This is the object that we will texture later on and that will be morphed into the proper shape using the morph target that we will create next. 

9. Switch back to the first layer again and make sure everything is de-selected.  To start off on the morph target, we need to select the polygons that will be bent into the edge of the waterfall.  These polygons currently have a surface called Handle.  Make sure that you are in Polygons mode and press 'w'.  Now select the Handle surface from the list and click the 'pluss' above it to select the polygons with this surface.  Note that even though the Handle surface may be the selected surface on the list, it is still necessary to click on the surface name to be able to select the polygons. 

Close this window and selec Bend from uinder Modify tab.  Press 'n' to bring up the numerical requester and set it to the following: 

Click Apply.  That turned the edge of the waterfall into an 90 degrees arc.  That may seem to be too steep, but we will deal with that afterwards.

10. The actual falls polygons are still horisontal.  They should attach smoothly to the newly bent polygons.  To do that, we need to rotate and place the waterfall polygons.  Select the polygons that make up the waterfall.  With the newly bent polygons out of the way, this should be quite easy from the Front view.  Press 'y' to activate the Rotate tool and press 'n' to bring up the requester.  Set the following values and press OK. 

That set the waterfall in a vertical position, but it still a bit too high. as shown below. 

Press 'T' to activate the Move tool and move the polygons a bit down and to the left so that they line up correctly as in the figure below. 

11.  There is one more adjustment that I would like to make.  The water would normally not follow a circular path as it drops into the waterfall.  Due to the acceleration caused by gravity, the path will stretch downward.  Press the 'h' key to activate the Stretch tool and press 'n' o bring up the requester.  Set the following values and press OK. 

The edge should now look something like this: 

We now have the correct profile of the waterfall.  We do not need the Handle surface any more.  Deselect everything and apply the RiverAndFalls surface to the entire object.  Our river now should look something like this: 

12. This waterfall is not very exiting.  The next thing on the list is to deform that edge a bit to make it look like the water is falling over an irregular cliff edge.  We'll be using the Magnet tool to deform the edge and waterfall.  This operation will also introduce a better profile to the waterfall polygons.  The idea is to keep the center of influence of the Magnet tool at the bottom of the fall as we drag to the right with the range set to Fixed.  This will move the lowest polygons more than the upper, and we will get a nice 'falling' profile.  My first Magnet operation was set up like this: 

Perform the following Magnet operations using the numerical requester.
 
 
 
Axis
Preset
Range
Radius X
Radius Y
Radius Z
Center X
Center Y
Center Z
Offset X
Offset Y
Offset Z
#1
None
Dome
Fixed
49 m
326 m
90 m
14 m
-245 m
-87 m
43 m
0 m
0 m
#2
None
Dome
Fixed
49 m
326 m
68 m
12 m
-245 m
98 m
51 m
0 m
0 m
#3
None
Dome
Fixed
49 m
326 m
17 m
13 m
-245 m
8 m
9 m
0 m
0 m
#4
None
Dome
Fixed
49 m
326 m
17 m
38 m
0 m
53 m
-19 m
0 m
0 m
#5
None
Dome
Fixed
49 m
326 m
8 m
42 m
0 m
-36 m
-13 m
0 m
0 m
#6
None
Dome
Fixed
49 m
326 m
12 m
28 m
0 m
-11 m
-10 m
0 m
0 m
#7
None
Dome
Fixed
49 m
326 m
12 m
50 m
-245 m
-56 m
10 m
0 m
0 m
#8
None
Dome
Fixed
49 m
326 m
12 m
41 m
-245 m
-82 m
10 m
0 m
0 m
Note that for the operations with a negative offset as in #4, the center of influence was moved to the top of the object to get the correct falling profile. 

13. That's it for the first version of the morph target.  Save it out as RiverTarget01.  Your river should look something like this: 

 Now it's time to texture our river.  This is covered in part 2.