Creating Gushing Water
 
 
 

This lesson uses particles to simulate gushing water. The techniques are similar to those in the cigarette smoke lesson , but include some new methods. For example, in the cigarette smoke tutorial, the Super Spray particle system emitted particles from a single point in space. In this tutorial, a slightly different particle system, PArray, emits particles from an object surface.

Animation techniques used in this lesson:

Set up the scene:

Creating a Stream of Water

To simulate water, the particles should be emitted from the fire hydrant geometry. The PArray particle system can do this.

Make a particle system that will be emitted from the fire hydrant:

  1. On the Create panel, make sure Geometry is active. Choose Particle Systems from the drop-down list.
  2. Turn on PArray, then drag in the Right viewport to create a PArray particle system.

PArray in Right viewport

PArray in Camera01 viewport

The placement of the PArray system doesn't matter, except for your convenience in selecting it. If you drag the time slider or play the animation, you’ll notice that no particles are emitted. PArray requires you to specify an object from which the particles are emitted.

Choose the fire hydrant nozzle as the particle emitter:

  1. With the PArray icon selected, go to the Modify panel.
  2. Click the Pick Object button at the top of the Basic Parameters rollout.
  3. Press H, and then choose Firehydrant-nozzle01 in the Select Objects dialog. Click Pick.

    Now if you drag the time slider, you’ll notice that particles shoot out in all directions. By default, PArray emits particles from the entire surface of the selected object, in the direction of the polygons’ normals. (If the normals were flipped, the particles would emit inward, toward the center of the hydrant.)

    For this scene, the particles should emit only from the cap face at the end of the nozzle. To do this, create a sub-object selection.

Create a sub-object selection to restrict particle emission:

  1. Select Firehydrant-nozzle01, and then go to the Modify panel.
  2. Choose Modifiers > Selection Modifiers > Mesh Select.
  3. Open the Mesh Select modifier's hierarchy, and choose Polygon as the active sub-object level.

  4. Select the circular polygon at the end of the cylinder used to model the nozzle.

Nozzle sub-object polygon selection in Right viewport

Nozzle sub-object polygon selection in Camera01 viewport

Now you have a sub-object selection that the PArray particle system can use.

Set the PArray to use the sub-object selection:

  1. Click the Mesh Select entry in the modifier stack display to turn off sub-object selection.
  2. In a viewport, select the PArray icon.
  3. On the Modify panel, go to the Basic Parameters rollout, and in the Particle Formation group, turn on Use Selected SubObjects.

    Now particles are emitted from only the end of the cylinder, as if it were an actual nozzle.

Adjust the particle generation parameters:

  1. With the PArray still selected and the Modify panel still active, go to the Particle Generation rollout.
  2. In the Particle Quantity group, set the Use Rate value to 50.

    Now 50 particles per frame are emitted. (Viewports preview only 10 percent of the particles by default, so this change will be more obvious when you render.)

  3. In the Particle Motion group, set the Divergence angle to 15 degrees.

    This parameter controls how much the stream of particles spreads. At a Divergence of zero, particles are emitted in a straight line along the normals of the emitter object.

  4. In the Particle Timing group, set the Emit Stop value to 100.

    In other words, particles are emitted for as long as the animation lasts (100 frames).

  5. Set the Life value to 100.

    Particles should live for the duration of the animation, too.

Using Space Warps to Control the Stream

To make the stream of particles behave more effectively like water, you use two space warps: a Gravity space warp to make the stream fall realistically, and a Deflector space warp to model the roadbed.

Add gravity to control the stream:

  1. On the Create Panel, click Space Warps.
  2. With Forces the active space warp category, click Gravity. Drag in the Top viewport to create the space warp near the fire hydrant object.

    By default, Gravity is exerted along the negative Z axis (away from the viewer) in the viewport where you create it. So using the Top viewport to create Gravity makes it pull downward, as one usually expects.

Gravity in Top viewport

Gravity in Camera01 viewport

The default parameters for the Gravity space warp are satisfactory, so you don't need to adjust them. Gravity is pretty straightforward: simply a directional force with realistic acceleration.

Bind the gravity space warp to the particles:

  1. Click Bind To Space Warp.
  2. Drag from the PArray particle system to the Gravity space warp. When the cursor changes to notify you that the binding is legal, release the mouse button.

    The Gravity space warp highlights briefly to let you know that the operation is complete.

  3. Now drag the time slider again.

    Particles emitted from the nozzle are now affected by gravity, and fall downwards. Unfortunately, at this point they also fall through the street. Renderable geometry does not deflect particles. To model the street, you’ll create a Deflector space warp to stop the particles when they reach ground level.

Add a deflector at street level:

  1. On the Create panel, click Space Warps if necessary. Change the active space warp category to Deflectors, and then click Deflector.
  2. Drag in the Top viewport to create the Deflector space warp. This space warp's icon should cover the area covered by the Street and Curb objects. It can extend beyond their bounds, as well.

    Creating the Deflector in the Top viewport ensures that it is created at ground level. Unlike some kinds of space warps, the size and location of the Deflector icon have an effect in the scene. The deflector controls the region where particles will be deflected. A deflector doesn't render, but its placement affects particle interaction.

    Deflector in top viewport

Bind the deflector to the particles:

  1. Turn on Bind To Space Warp.
  2. Drag from the PArray particle system to the Deflector space warp. When the cursor changes to notify you that the binding is legal, release the mouse button.

    The Deflector space warp highlights briefly to let you know that the operation is complete.

  3. Drag the time slider.

    The PArray particles emit from the nozzle, fall downward due to Gravity, and then bounce off of the Deflector. At this point, the particles bounce too much. In reality, when an object bounces or reflects from an object, a certain amount of energy is lost. Also, the particles don't come to rest but keep moving as if the street object were a smooth sheet of glass. Both of these problems can be corrected by adjusting Deflector parameters.

  4. Select the Deflector space warp if necessary and go to the Modify panel.
  5. In the Parameters rollout, change the Bounce value to 0.2, and increase the Friction value to 10.0.
  6. Drag the time slider.

    Now particles reflect from the Deflector with less velocity, and as they slide across its surface, the increased friction makes them come to rest eventually.

Modulating the Rate of Particle Emission

So far, the fire hydrant emits water in a steady stream. This doesn't look too realistic, because gushing water tends to pulse. To simulate this, you can animate the PArray system's Speed parameter. In this tutorial, you combine a Bezier Float controller with a Noise controller to apply some randomness to the Speed, creating a pulsating motion.

Assign controllers to the Speed parameter:

  1. Select the PArray particle system in the viewport.
  2. On the Modify panel > stack display, click the PArray system to activate its controls, rather than one of the space warp bindings.

    Before and after selecting the PArray level

  3. On the Particle Generation rollout, right-click the PArray’s Speed value.
    WarningDon't right-click the up/down arrows to the right of the spinner. This resets the Speed to 0.0.
  4. In the pop-up menu, choose Show In Track View.

    Track View opens to show the various parameters for PArray.

  5. Locate the Speed parameter for the PArray Object by expanding Object (PArray).
    TipIf you can't locate PArray01 in the Track View dialog, choose Display > Filters, and assure that Objects is selected in the Show group of the Filters dialog.
  6. With the Speed parameter chosen, choose Controller > Assign. Choose Bezier Float from the Assign Float Controller dialog.

    The Bezier Float controller inherits a value of 10 from the original Speed setting. You can actually keyframe this value, but in this animation there is no need to do so.

  7. Choose Controller > Assign again, and choose Float List from the Assign Float Controller dialog.

    Float List is a List controller that combines controller values. If you expand the Speed hierarchy in Track View, a track labeled Available appears at the bottom of the Speed tracks. This is where you add new controllers to the list.

  8. Click the Available track to highlight it, then choose Controller > Assign once more, and choose Noise Float from the Assign Float Controller dialog.
  9. The List Controller dialog appears. Dismiss it, and select the Noise Float: Noise Float item in Trackview.
  10. Right-click Noise Float: Noise Float and select Properties from the quad menu.

    The Noise Controller dialog appears.

Adjust the Noise parameters:

The Noise controller can generate a randomly pulsating motion. The default settings for Noise don't accomplish this, so you need to adjust them.

  1. On the Noise Controller dialog, change the settings as follows:
    • Set the Frequency to 0.2. This makes the noise more undulating and less jittery.
    • Turn off Fractal Noise. This too makes the noise smoother by making value changes less abrupt.
    • Turn on the toggle labeled > 0. This constrains the value to be greater than zero. In terms of the Speed parameter, less-than-zero values would be rounded to zero, causing particles to have no speed when they are emitted.
    • Set the Strength value to 10.0. This constrains the value to be no greater than 20. The Speed value will range between 10 and 20.
  2. Close the Noise Controller dialog.
  3. Close the List Controller dialog that appears.

    Notice that there is still an Available track at the bottom of the Speed hierarchy. You can add as many controllers to the list as you want. This can be a powerful technique.

    Combining the Noise controller with Bezier Float gives you more control over the variation. Specifically, the Noise value modifies the Bezier value. With a Bezier value of 10 and a Noise range of 10, the result of the Float List potentially will range between 10 and 20, at a mean of 15. (It actually ranges from less than 12 to approximately 18.)

    NoteYou can achieve a similar effect by using the PArray Variation parameter for particle motion, but the controllers give you more control and eliminate the need for keyframing.
  4. Close Track View.

Preview the animation:

The animation is now ready to render, except that the water particles need an appropriate material.

Creating a Water Material

For gushing water, you want a material that appears like foamy water. This material is similar to the material you created for smoke. Facing particles with a soft radial gradient map causes rendered particles to blend together into a foamy stream that approximates the look of water.

Set up particles to render as facing geometry:

  1. Select the PArray particle system and go to the Modify panel.
  2. In the Particle Type rollout, go to the Standard Particles group, and choose Facing.
  3. In the Particle Generation rollout, go to the Particle Size group. Set the Size value to 4.0, and the Variation value to 25.0 %.

    If you render the scene right now you see that the particles are displayed as square facings. As with smoke, you need to soften their edges to make them appear more amorphous.

Create the material:

  1. Open the Material Editor and select an unused sample slot.
  2. Click the Diffuse color swatch to display the Color Selector, and change the diffuse color to blue-gray (for example, R=150, G=181, B=205).
  3. Make the material very glossy by setting the Specular Level to 131 and the Glossiness to 63.

Apply maps to control the material's opacity:

  1. Open the Maps rollout and click the Opacity map button.
  2. In the Material/Map Browser, choose a Gradient map, and then click OK.
  3. In the Gradient Parameters rollout, set the Gradient Type to Radial.
  4. Click Go To Parent to return to the parent material. In the Maps rollout, click the Diffuse map button.
  5. In the Material/Map Browser, choose a Mask map, and then click OK.
  6. In the Mask Parameters rollout, click the Mask button.
  7. In the Material/Map Browser, choose a Gradient map, and then click OK.
  8. In the Gradient Parameters rollout for the new gradient map, set the Gradient Type to Radial.

Turn on face mapping to match the particle system:

Assign the material:

The particles still look a bit "blobby," for water. To improve this, you can use Image Motion Blur.

Adding Motion Blur

There are several ways to generate motion blur in 3ds Max . For the water from the hydrant, you use the method called Image Motion Blur.

Assign Image Motion Blur to the PArray:

  1. Select the PArray particle system, and then right-click it.
  2. Choose Properties from the quad menu (lower-right, Transform quadrant).
  3. In the Motion Blur group of the Object Properties dialog, set the blur type to Image, and make sure Enabled is turned on. Click OK.

The scene is now complete.

The Final Animation

You are now ready to activate the Camera01 viewport and render the entire animation. Even at low resolution, this can take about half an hour. Alternatively, you can play the file gushing_water.avi, provided on the program disc.