Fluid Effects


Fluid effects are used to create a realistic simulation of a particle's movement that depends on the surrounding environment; for example, if the temperature of the air is higher in a certain area, a particle will rise more quickly through that area. (The word fluid in this context refers to motion, rather than a simulation of actual fluid. You can use fluid effects to create such effects as explosions, smoke, flames, oceans, clouds, and thick liquids.

At the time of this writing, fluid effects are available only in Maya Unlimited.

About containers

At the heart of fluid effects is the container. All fluid effects take place inside a container; in fact, they can't exist outside a container. Containers are 2D or 3D rectangular objects.

  • 2D containers are useful for any effect where the camera is not moving around the effect. The container can be translated, rotated, and animated, but it has no thickness or depth (Figure 18.56).

    Figure 18.56. A 2D fluid container.


  • 3D containers have depth, which you can set in the Options window when you create the container. These containers are useful for creating clouds, explosions, or any other effect that requires depth (Figure 18.57).

    Figure 18.57. A 3D fluid container.


A container uses voxels (short for volume pixels) arranged in a grid to display the fluid effect. Each voxel has multiple associated attributes and values that determine the way the fluid effect behaves and appears (Figure 18.58).

Figure 18.58. The Density grid values for a 3D container.


Grids are used for multiple attributes of fluid objects, and each attribute can use a different type of grid. The attributes for fluid effects are as follows:

  • Density The Density grid determines where the fluid will be visible as well as its opacity.

  • Velocity The Velocity grid determines the direction, or flow, of the fluid.

  • Temperature The Temperature grid determines the amount of heat emitted by a particular voxel. (Heat rises and dissipates as time passesparameters that you can control.)

  • Fuel The Fuel grid determines where a reaction will take place within the grid. Temperature will ignite fuel to start the reaction. Thus, density is affected as the fuel burns off.

  • Color Method The Color Method grid determines whether the color will be a shaded color, dynamic grid, or static grid.

You can use three grid types for these attributes:

  • Static Grid This type of grid lets you define the values of each voxel in the grid. These values remain static throughout the simulation.

  • Dynamic Grid With this type of grid, you can assign a value to each voxel it includes. As the simulation plays, the value of each voxel dynamically changes depending on the forces acting on it.

  • Gradient A gradient assigns a linear value of 0 to 1 across the grid in any direction or out from the center. These values do not change over time.

There are a number of ways to get a fluid into a container: You can create an emitter, paint fluids, or use gradients. We're going to create a 2D container with an attached emitter.

To create a 2D Container:

1.

From the Fluid Effects menu, select the box next to Create 2D Container with Emitter (Figure 18.59).

Figure 18.59. From the Fluid Effects menu, select the box beside Create 2D Container with Emitter.


In the options that appear, you can define the container's size (in units) and resolution (in number of voxels).

2.

Rewind the animation and click Play .

As the simulation runs, you should see a white stream of particles being emitted from the center of the container (Figure 18.60).

Figure 18.60. The fluid is emitted upward from the center of the container.


Now that you've emitted a fluid, you can change the value of each attribute by using the Artisan Paint tool.

To edit the contents of a container using paint fluids:

1.

Select the fluid container.

2.

Rewind the animation.

3.

From the Fluid Effects menu, select Add/Edit Contents > Paint Fluids Tool > Options box (Figure 18.61).

Figure 18.61. From the Fluid Effects menu, select the box beside Add/Edit Contents > Paint Fluids Tool.


The Paint Attributes tool opens.

4.

From the Paintable Attributes pop-up menu, select Density and Fuel.

A dialog box appears informing you that you must set the attribute to Dynamic Grid; click Set to Dynamic (Figure 18.62).

Figure 18.62. Setting the Density and Fuel grid to Dynamic.


5.

Paint a few strokes into the container (Figure 18.63).

Figure 18.63. A few strokes of Density and Fuel will change the behavior of the fluid effect.


6.

Click Play to see how Density and Fuel affect the results.

The same principles guide the creation of 3D containers. You get an extra manipulator to control where you're painting in the Z axis, or Depth. To create a 3D container, follow the steps you used to create the 2D container.

About fluid container attributes

Fluid containers have many unique attributes, which you can adjust in the Attribute Editor. The following describes each section of the Attribute Editor and its contents.

  • Container Properties Determines the resolution (number of voxels) and size of the grid.

  • Contents Method Determines the grid type for each fluid property.

  • Display Determines how the fluid appears in the View pane.

  • Dynamic Simulation Determines the gravity, viscosity (thickness), and friction of the fluid.

  • Contents Details Determines multiple parameters for each fluid property: Density, Velocity, Turbulence, Temperature, Fuel, and Color.

  • Grids Cache Determines the options for saving the simulation to a file.

  • Surface Defines how the surface renders. For various fluids, you can choose between Volume Render and Surface Render. Use a Volume Render for voluminous things like smoke or steam. Use a Surface Render for surfaces that need to look as though they have thickness, such as mud.

  • Shading Determines the fluid's color, incandescence, and opacity.

  • Shading Quality Displays options to control the way the fluid is depicted.

  • Textures Provides options for color, incandescence, and opacity texture types.

  • Lighting Lets you use Self Shadowing, which makes the effect cast shadows on itself. You can also use the lights in the scene by checking the Real Lights box, or you can set your own direction for lighting.

Sample fluid effects

Sometimes the best way to learn a new effects procedure is to look at systems that are already created. A great place to start is Maya's library of sample fluid effects. Import one of these sample effects into your scene, and then use the Attribute Editor to view the settings used to create it.

In addition, the Attribute Editor in Maya includes a new section at the bottom of the editor window called Notes. This area also includes an explanation of the procedure used to create certain effects. You can also use the Notes section to add your own comments about an effect. The comments are then saved with that specific node for later viewing.

To import a fluid example:

1.

From the Fluid Effects menu, select Get Fluid Example.

This opens the Visor, which contains the sample effects (Figure 18.64).

Figure 18.64. Importing a fluid example from the Visor.


2.

In the left column of the Visor, select the folder for the type of effect you want to import.

3.

In the right column, right-click the effect you desire and select Import Maya File (your file.ma).

The effect is imported into the scene at the center of the grid.

4.

Experiment with the settings in the Attribute Editor by pressing to change the way the fluid is displayed and evaluated (Figure 18.65).

Figure 18.65. The attributes for a fluid effect.


Maya Ocean and Ocean shader

Maya uses an advanced shading network along with fluid dynamics to create an Ocean object: With just one click, you can create a photorealistic ocean and control the calmness or storminess of the seas (Figure 18.66). By creating a locator and connecting it to the fluid simulation, you can even make objects appear to float in your ocean.

Figure 18.66. A render of the Maya Ocean effect.


As with the other fluid effects, Maya provides ocean examples that you can import into your scenes.

To create a default Maya Ocean:

1.

From the Fluid Effects menu, select Ocean > Create Ocean (Figure 18.67).

Figure 18.67. From the Fluid Effects menu, select Ocean > Create Ocean.


A NURBS plane is created on the grid in the scene.

2.

Open the Attribute Editor and select the OceanShader tab.

3.

Open the Ocean Attributes section and adjust Wave Height, Turbulence, Peaking, Speed, Frequency, Direction, and so on.

Most of the adjustments for the Ocean effect are available in the Ocean shader, which uses the output to displace the NURBS surface.

Tips

  • Maya won't shade the ocean plane because it would slow playback too much. You can create a preview plane when you create the ocean by opening the Option dialog box and checking Create Preview Plane. You can add a preview plane to an existing ocean by selecting Ocean > Add Preview Plane from the Fluid Effects menu (Figure 18.68). The preview plane is a small patch with the Ocean shader attached to it so that you can see the results as you make adjustments.

    Figure 18.68. Adding a preview plane to the ocean will help you interactively view the adjustments you make to the ocean.


  • You may want to attach the ocean to the Perspective camera in the Create Ocean options. This will move and scale the ocean with the camera to give you an acceptable resolution wherever the camera is positioned.


Now that your scene includes an ocean, let's add an object that floats. We can use the Make Boat command to float objects or groups of objects and control their buoyancy and other attributes.

To make a boat:

1.

Create an ocean by following the steps in the previous task.

2.

From the Create menu, select Polygons > Cube.

3.

Scale the cube to represent the size of a boat.

4.

With the cube selected, choose Fluid Effects > Ocean > Make Boats (Figure 18.69).

Figure 18.69. From the Fluid Effects menu, select Ocean > Make Boats.


The cube is now parented under a locator, which is controlled by the ocean and in turn controls the movement of the cube (Figure 18.70).

Figure 18.70. A locator controls the way the ocean affects the boat.


5.

Select the locator and open the Attribute Editor by pressing .

6.

In the Attribute Editor, open the Extra Attributes tab.

7.

Click Play in the playback controls.

8.

Interactively adjust Buoyancy, Water Damping, Air Damping, Roll, and Pitch to set the way the boat reacts.

You will want at least 500 frames in the range slider to give you enough time to adjust and see the effect.

Tip

  • Now that you've made a boat and familiarized yourself with the attributes, try creating a motor boat: Follow the steps in the preceding task, but in step 2 select Fluid Effects > Ocean > Make Motor Boat. The motor boat includes Throttle and Rudder controls so you can interactively drive the boat through your scene!


Ponds

Ponds have similar controls to those for oceans and can have floating boats or other objects. Ponds are useful when you have a smaller body of water in your scene that may not look like a realistic ocean. To make small bodies of water, you'll use the Create Pond command.

To create a pond:

1.

From the Fluid Effects menu, select Pond > Create Pond (Figure 18.71).

Figure 18.71. From the Fluid Effects menu, select Pond > Create Pond.


A 2D fluid is created in the scene.

2.

With the fluid selected, open the Attribute Editor by pressing and select the pondShape1 tab (Figure 18.72).

Figure 18.72. Changing the color in the Pond attributes.


In the Shading section, you can adjust the color, opacity, and transparency, as well as other pond properties. We will keep the default properties for this example.

Now we'll create some motion for the surface of the pond. To do this, we will create a wake, which will ripple the surface of the pond.

To create a wake:

1.

Select the pond you created in the preceding task.

2.

From the Fluid Effects menu, select Pond > Create Wake (Figure 18.73).

Figure 18.73. From the Fluid Effects menu, select Pond > Create Wake.


A spherical fluid emitter is created in the middle of the pond.

3.

With the emitter selected, open the Attribute Editor by pressing and select the PondWakeEmitter1 tab.

4.

Open the Fluid Attributes section and set the Density/Voxel/Sec value to 1 (Figure 18.74).

Figure 18.74. Adjust the size of the wake in the Attribute Editor.


The Density/Voxel/Sec value defines how powerful the wake is; by default, the Density/Voxel/Sec value is set to 5. This setting creates a large wake, which may be too large for your scene.

5.

To see the effect, click the Play button in the animation controls.

6.

Adjust the Density/Voxel/Sec value until you get the desired ripple.

Tips

  • Wakes can be used with the Ocean object as well. Follow the same steps as in the preceding task, but in step 2 select Ocean > Create Wake.

  • Wakes can also be attached to objects or boats. To do this, select the object and, from the Fluid Effects menu, select Pond > Create Wake. The emitter will now be parented to the object. If you animate the object, the emitter will follow and create a dynamic V-shaped wake behind it (Figure 18.75).

    Figure 18.75. An animated cube moves through the pond and leaves a wake in its path.





    Maya for Windows and Macintosh
    MAYA for Windows and MacIntosh
    ISBN: B002W9GND0
    EAN: N/A
    Year: 2004
    Pages: 147
    Authors: Danny Riddell

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net