You are on page 1of 4

TUTORIALS | Simulating uids with animated textures

ON THE WEB
Bonus scene le for this tutorial www.3dworldmag.com

LIGHTWAVE 3D

A quicker splash
Moving water need not mean a complex particle simulation. In this tutorial, we explore how to create a realistic fountain effect for architectural work, using only endomorphs and animated surface textures BY DAVID TODMAN

FACTFILE
FOR LightWave 3D DIFFICULTY Intermediate TIME TAKEN 30 minutes ON THE CD Full-size screenshots Project les Renders and animations ALSO REQUIRED N/A

rchitectural animations are at their best when they contain interesting movement and camera work. However, adding dynamism isnt always straightforward because buildings dont move!

fountain that will animate, complete with gravitational effects. The major advantages of this technique are that its faster to render and produces a softer, more pleasing result than using HyperVoxels. In essence, the technique uses two elements in combination animated surface textures and endomorphs. In the rst part of the tutorial, well explore these underlying concepts by producing a simple accelerating surface on a subdivided plane. In the latter parts, well implement these elements by building an animating fountain rig, which can be quickly dropped into any LightWave project youre working on. Youll nd all the accompanying materials for this tutorial on the CD. David Todman is a freelance LightWave artist and Creative Director of The Worms of Art: producers of professional surface collections and other productivity tools for LightWave 3D www.the-worms-of-art.com

As a result, we sometimes have to look to other elements for motion in our environment; animated fountains and water being one of the most effective. When asked to produce animated fountains, the rst thing artists tend to do is jump straight into the ParticleFX settings. This is ne if you happen to own a particle plug-in such as RealFlow, but for many types of water, such as spray, its a real struggle to achieve realistic results using LightWaves standard HyperVoxels. Whats worse, all particle effects come at a heavy render cost. In this tutorial were going to explore a technique we developed for our Pshelf Water collection of presets that creates spray water using surface textures. Were going to produce a wide plume

066 | 3D WORLD September 2006

TDW81.t_fountain 066

3/7/06 13:51:26

Simulating uids with animated textures | TUTORIALS

STAGE ONE | Basic concepts

Run Layout and open the scene le Arrows.lws (this may be downloaded from www.3dworldmag.com/ stoppress). This consists of a single plane object: Arrows_Working.lwo (also included on the CD). If you drag the time slider you will see that the surface of this object already animates, with arrows moving downwards.

01

Lets take a look at this surface by opening the Surface Editor and clicking the T next to the Arrows Color texture channel. Theres a single image map layer in the Color channel. If you take a look at the Position tab for this layer youll see that its controlled by an Envelope (E). Bring up the Graph Editor for this envelope by clicking the E next to the Y channel setting.

02

The animating arrows have been achieved by using just two keyframes one at frame 0 and one at frame 25. By using the Pre Behavior and Post Behavior Offset Repeat settings we can quickly create a continuous animation something needed when producing a fountain.

03

Youll notice that the arrows on this surface move at a continuous speed down the Y axis. However, to create the effect of something falling, we need to make the surface speed up as it descends. Were going to do this with an endomorph, so open up Arrows_Working.lwo in Modeler. Youll see that the object consists of a single plane divided into 24 equal segments.

04

Were going to stretch the objects segments as part of an endomorph. So, rst, create a new endomorph called Arrows_Stretch (in the bottom right of the Modeler interface). Make it a Relative map. With this new morph active, select all the points on the plane except those at the top and bottom. When youve done this, select the Stretch tool ([h]).

05

Using the Numeric window, set the Stretch falloff to Linear (the other falloff settings can remain at their defaults). Create a falloff range for the Stretch tool by right-clicking and holding at the top of the object and dragging downwards. Let go at 0 on the Y axis. Finally, Stretch the points by left-clicking and holding at the bottom of the plane, then pushing upwards until its 200%.

06

EXPERT TIP
In summary

We now need to apply this endomorph to the rendered object. So save and switch back across to Layout. Endomorphs are applied by bringing up the Object Properties window > Deform tab > Add Displacement > Morph Mixer. Double-click the Morph Mixer plug-in entry and create a 100% key at frame 0.

07

Press Play in Layout and youll see the arrows stretching and accelerating as they move. By creating continuously expanding segments with an endomorph, our animation will accelerate. This is because the surface needs to cover each segment in the same amount of time, so short segments move more slowly than wide ones. The more segments you add, the smoother the acceleration.

08

Stage one of this tutorial has taught us that surface textures take their dimensions and envelope keyframes from base geometry. We can now stretch and speed up surface textures by rst creating endomorphs before stretching or squeezing geometry. And nally, through creating continuously expanding endomorph geometry from equally segmented base geometry, we have caused animated surfaces to accelerate, and are able to do this in a smooth and natural way by adding more continuous geometry.

September 2006 3D WORLD | 067

TDW81.t_fountain 067

3/7/06 13:51:31

TUTORIALS | Simulating uids with animated textures

STAGE TWO | Creating the fountain shape

In Layout, open the scene Fountain_Start.lws. This scene contains a single box divided into 10 equal segments. Each segment is 1m high. The end caps of the box have been removed and extra geometry sliced at either end to create a hard edge when we convert it to SubPatches. This simple shape will be the basis for our fountain object. Select Fountain_Step1.lwo and open it in Modeler.

09

Create an endomorph called Fountain_Deform. With this morph active, move the points as shown in the example here, squeezing them towards the centre 5m line. The top of the fountain plume is eventually going to be at 5m. By squeezing towards this point, the water will now slow down approaching it and speed up again away from it (as the water falls).

10

The next step is to taper the box outwards to recreate the effect of the water stalling and spreading out as it reaches the top of its plume. Select the Taper Evenly tool to do this, using the settings in the example as a guide.

11

To complete the basic plume shape, pull down the points on the top half of the box until theyre turned inside out and nish just below the origin. Our animated surface will move straight up the base geometry, but because we created this shape with an endomorph, it will appear to fall after reaching the top of the plume. The morph Fountain_Deform is now complete.

12

The nal fountain will consist of a radial array of plumes. Each clone will bend outwards to create a wider spray area. In order to enable this, create another endomorph called Fountain_Bend (make it Relative). Bend the base shape 22 degrees out towards the -X axis. Now to test the morphs.

13

Convert all the polys to Sub-Patches by hitting the [Tab] key. Save and switch to Layout. Apply the two endomorphs by opening up their Object Properties windows, and selecting Deform > Add Displacement > Morph Mixer. Apply a 100% key for Fountain_Deform and 60% for Fountain_Bend. Weve given the bend morph some leeway, in case we need to widen the nal shape.

14

Now our single plume is looking good, switch back to Modeler. Were going to create a radial array of plumes to achieve our nal fountain shape. However, we dont want each plume to catch the same part of our animating surface, as this will look articial. We avoid this by offsetting the base geometry of each clone. First, deselect any morphs and move the base box to -2m on the X axis.

15

Now select the endomorph Fountain_Deform. Because we moved the base geometry, our morph has moved as well. So move the morphed shape back towards the origin. However, make sure you dont return it to X = 0. Leave the centre of the plume base at around X = -40mm. This will help widen the plume base when we have created our array.

16

Finally, create a radial array of 12 clones of this single plume. This will produce all the geometry that we need for a thick, high-quality plume of realistic water emerging and splashing down from our fountain. Save the object and return to Layout.

17

068 | 3D WORLD September 2006

TDW81.t_fountain 068

3/7/06 13:51:35

Simulating uids with animated textures | TUTORIALS

STAGE THREE | Surfacing and nishing

The plumes of the fountain will have spread outwards because of the Fountain_Bend morph. We are now ready to apply an animating surface to this shape. Open the Surface Editor. Load the external le Fountain_Spray.srf on to the fountain surface.

18

The fountain surface uses the Edge Transparency shader and the Transparency channel to create a natural-looking soft spray of water. In the Surface Editor, open the Transparency texture channel for this surface by pressing the T next to the Transparency heading.

19

Surface motion is created using three layers in the Transparency channel, each controlled by an envelope. Select the Position tab for each one and open the Graph Editor (press the E next to the Y Channel). Continuous vertical movement is achieved using the Offset Repeat Post Behavior. The speed of each layers envelope should be slightly different for a more realistic, randomised motion.

20

Well now make the geometry drift a little by adding displacement maps. Use Load Items From Scene to load Water_Displace.lws. Water_Displace has displacement maps already applied. Copy these to your fountain by opening Object Properties > Deform and selecting the T by Displacement Map. Choose Copy > All Layers from the Texture Editor. Select your fountain object and paste the stored layers into its Displacement texture.

21

The plume is now nished. Delete Water_Displace and save the scene as Fountain_LOADER.lws. Open Fountain_RIG.lws, a pre-built fountain base. Use the Load Items From Scene option to add Fountain_ LOADER.lws. The plumes will appear in the centre. Press [F9] to render. Parent your plume to the Fountain_Handle null and save the scene. The fountain rig is now complete.

22

This fountain rig can now be included in any project by importing Fountain_RIG.lws via Load Items From Scene. To see a similar fountain in a completed environment, open Cover_Image.lws. Bear in mind that there are a few things you can do to speed up rendering times here. Firstly, turn off Self Shadows for the plumes: Object Properties > Render tab > Self Shadow. Secondly, reduce the

23

number of radial clones for the plumes (nine works well). And lastly, reduce the Render SubPatch Level: Object Properties > Geometry > Render SubPatch Level. Because these rigs use full geometry, they work from any angle. If you want more control over the shape, you can create extra endomorphs for wind effects and so on. With practice, youll nd this technique a valuable addition to your LightWave toolset.

September 2006 3D WORLD | 069

TDW81.t_fountain 069

3/7/06 13:51:40

You might also like