Add color to fluids
 
 
 

Color fluids using shading color

The fluid container has a built-in shader that you can use to modify the color, texture, and other attributes of the container to give the fluid a particular look.

To color a fluid using shading color

  1. Select the fluid container.
  2. In the Contents Method section of the fluidShape Attribute Editor, set the Color Method to Use Shading Color (the default).
  3. Open the Shading section of the Attribute Editor, and in the Color section select a Color Input and set the ramp colors.

    The ramp colors map to the values of the Color Input you select. Colors at the far left of the ramp (position 0) map to input values of 0. Colors to the far right of the ramp (position 1), map to input values of 1.

    For details, see Color.

    You can also set the Incandescence and Opacity of the fluid using the built-in shader.

Color fluids using grids

As with other fluid properties, adding color to a grid gives you control over the precise color values placed in each voxel.

The default grid color is green/brown (close to RGB 0.4 0.4 0.3) to minimize fringing when you add color. If this is not an acceptable grid color, flood the color grid with the color you want and set it as your initial state, see Flood a container with values and Fluids initial state.

When you add color to a dynamic grid, the color values are solved using the fluid dynamics equations.

You can add Color to grids as follows:

To emit color into a container

  1. Add a fluid emitter to the container. See Add fluid emitters to containers.
  2. In the Fluid Attributes section of the fluidEmitter Attribute Editor, turn on Emit Fluid Color.

    If the Color Method is not set to Dynamic Grid, you are prompted to set it.

  3. Click the Fluid Color box to open the Color Chooser and select the color you want to emit.
  4. Play the simulation using the playback controls at the bottom of the main Maya window.
    NoteIf Color Method is set to Dynamic Grid, any emitters in the container that are emitting Density values, but are not emitting Color will take on the default grid color (green/brown) because those values are already in the grid.

Color fluids using lighting

You can use internal and ambient lighting to add color to your fluid effect. The internal and ambient lights do not assign color values to fluid density, but rather the light's color is projected onto the fluid. The type of light you use and the position of the light affects how color appears in the fluid. See Lighting fluids with internal lights.

To color a fluid using internal lighting

  1. Select the fluid container.
  2. In the Lighting section of the fluidShape Attribute Editor, select a light from the Light Type list. See Light Type.
  3. To set the color of the internal or ambient light, click the Light Color and Ambient Color swatches, and select colors from the Color Chooser.
  4. Adjust the Light Brightness and Ambient Brightness to produce the desired color effect.
NoteTo render your fluid with the internal light settings, turn off Real Lights. See Lighting fluids with internal lights.