Material Dynamic Operator
 
 
 
Command entry:Particle View Click Material Dynamic in an event or add a Material Dynamic operator to the particle system and then select it.

The Material Dynamic operator lets you give particles material IDs that can vary during the event. It also lets you assign a different material to each particle based on its material ID. When used with an animated texture, this lets you assign a different frame or map to each particle based on its total age or the amount of time it has spent in the current event. In this context, one example of an animated texture is a material that uses a multi-frame bitmap, such as an AVI file, as the Diffuse Bitmap map. Other examples of animated textures are materials that use the Particle Age map or the Particle MBlur map. Alternatively, you can use different sub-materials from a compound material such as Multi/Sub-Object.

NoteWhen using Object Motion Blur, if an event contains a Material Dynamic operator that uses a material with a Particle Age/MBlur/Bitmap map, the event should not also contain a Delete operator, or a Spawn or Collision Spawn test. Also, the event should not contain any tests that are wired to another event. The only exception to this is the Age Test operator when set to Absolute Time without any variation; that is, all particles leave the event at the same time. This applies to the use of Object Motion Blur only; there are no restrictions with Image Motion Blur.

Procedures

Example: To assign animation frames to particles based on age:

  1. Prepare a file to be used as the animated bitmap. This can be a multiple-frame format such as AVI, or an image file list (IFL file) that points to a sequence of still images. With the latter, you can use images in a format such as Targa that contain predefined alpha channels to specify particle opacity selectively.
  2. Open the Material Editor, and assign a Bitmap map as the Diffuse map.
  3. Use the Select Bitmap Image File dialog to assign the file from step 1 as the bitmap. This dialog appears automatically when you first assign a Bitmap map; alternatively, click the Bitmap button on the map's Bitmap Parameters rollout.
  4. On the map's Time rollout, turn on Sync Frames To Particle Age.
  5. If you want to use the image background or alpha channel to define transparency, on the Maps rollout, copy this map to the Opacity slot, and set the parameters accordingly.
  6. At the material level, turn on (Show Shaded Map In Viewport).
  7. Add a camera to the scene and set it up as desired. Activate the Perspective viewport and press the C key to set the viewport to show the camera view.
  8. Create a default Particle Flow system.
  9. Open Particle View.
  10. Replace the Shape operator with a Shape Facing operator.

    Using this operator makes it easier to see the animation.

  11. Click the Shape Facing operator, and in its rollout, click the Look At Camera/Object button, and then select the camera.
  12. In the Size/Width group, increase In World Space Units to about 15.
  13. Add a Material Dynamic operator to Event 01, and assign it the material from the beginning of this procedure.
  14. Turn on Show In Viewport.
  15. In the Animated Texture group, make sure Same As Particle ID is chosen, and turn on Reset Particle Age.

    Always choose Same As Particle ID with an animated texture, and one of the Sub-Material Rotoscoping options when using a compound material.

    Turning on Reset Particle Age causes Particle Flow to set particles to age 0 as they enter the event. In this example, the particles are born in the event, so technically it's not necessary to turn on Reset Particle Age. However, it's a good habit to get into to ensure that the animation always plays from the first frame.

  16. Play the animation.

    In the viewport, the bitmap animation advances as the particles move, but all the particles show the same frame, regardless of age. This is anomalous behavior related to the limitations of viewport interactivity. The particles render correctly, however.

  17. Render the animation.

    As each particle is born, it begins displaying the animation from the first frame. At each frame, each particle's age is incremented, and it displays the next frame from the applied map.

Example: To use the Particle Age map:

The Particle Age map applies up to three different colors or maps to particles throughout their life span, gradually changing from one to the next as the particles age. This effect can be used, for example for sparks flying from a fire: At first they're yellow; then, as they cool down, they turn red, and finally they become gray ashes. In order for Particle Age to know how far a particle has progressed through its life span, the particle has to be given a finite life. You do this using the Delete operator.

  1. Start or reset 3ds Max, and add a Particle Flow system.
  2. Open Particle View and the Material Editor. Position them side by side.
  3. In Particle View, add a Material Dynamic operator and a Delete operator to Event 01.

    For Particle Age to work, the Delete operator must be in the same event as the Material Dynamic operator. Alternatively, you can add the Delete operator to the global event so that it affects every event.

  4. Click the Delete operator, and in the parameters panel, choose By Particle Age, and set Life Span=100 and Variation=0.

    This gives each particle a life span of 3 1/3 seconds.

  5. Click the Material Dynamic operator.
  6. In the Material Editor, assign a Particle Age map as the Diffuse map. On the Particle Age Parameters rollout, set three different colors, such as red, green, and blue. Also change the Age percentage values as necessary. For example, if you want each particle to show the second color a third of the way through its life instead of halfway, change Age #2 to 33.
  7. Drag the active material from its sample slot to the material button on the Material Dynamic parameters rollout in Particle View. When the Instance (Copy) dialog appears, click OK to accept the default choice: Instance.
  8. In the Material Dynamic parameters, make sure Assign Material ID is on.

    If it isn't, the particles all change color at the same time.

    There's no need to turn on Show In Viewport; the Particle Age map doesn't appear in the viewports.

  9. Render the animation, or a few representative frames.

    As each particle falls, it gradually changes color, with the oldest particles changing first.

    TipYou needn't actually delete the particles to use this method. There are several ways to avoid this. You could set Life Span to a higher number than the length of the animation, and then, in the Particle Age map parameters, lower the Age #2 and Age #3 settings. Or, if you're using a local Delete operator, you could use an Age test to move the particles into another event just before they're scheduled to be deleted. In that case, to avoid an abrupt color change, you might want to add to subsequent events a Material Static Operator with a material that uses the same final color or map as the Particle Age map.

Interface

The user interface appears in the parameters panel, on the right side of the Particle View dialog.

Assign Material

When on, the operator assigns the specified material (see next parameter) to the particles. Default=on.

[button]

Use this button to assign a material to the operator. Click the button and then use the Material/Map Browser to choose the material. Alternatively, drag the material from a Material Editor sample slot to the button.

After you assign a material to the operator, its name appears on the button.

Assign Material ID

When on, the operator defines a material ID number for each particle. Default=on.

In general, this should remain on. Particle Flow uses the material ID with the Particle Age map to find the particle's other properties, including its life span and current age. And it uses the material ID with compound materials to know which sub-material to assign to a particle.

Show In Viewport

When on, the material is shown applied to the particles in the viewports when the particles are displayed as geometry.

Assignment Method

The Material Dynamic operator lets you assign Material IDs to particles in several different ways, depending on whether you're using an animated texture or a compound material. Default=Same As Particle ID.

Animated Texture group

Same As Particle ID

Assigns the same material ID to a particle as its particle ID. Choose this when using a material containing an animated texture, such as a Bitmap, Particle Age, or Particle MBlur map.

NoteParticle Flow assigns Particle IDs consecutively to particles at birth, starting with 0. Although the highest possible Particle ID is over 2,000,000,000, the highest possible material ID is 65535. Thereafter, the numbering sequence starts again at 0. Thus, when using a Particle Age map in a material assigned to the Material Dynamic operator, for best results, use a total of 65,536 particles or fewer.
Reset Particle Age

When on, sets each particle's age to 0 when it enters the event.

When using an animated material with a Bitmap map, turn this on to ensure that the animation always plays from the first frame.

Randomize Age Offset

When on, Particle Flow varies the difference between the particle age and the starting material ID at random. The maximum difference is determined by the Max Offset parameter.

Max Offset

The maximum number of frames by which Particle Flow can randomly vary particle age.

Sub-Material Rotoscoping group

These settings let you choose the basis on which the operator changes material ID assignments when using a compound material such as Multi/Sub-Object, and specify the rate of change.

Material ID

Assigns the same material ID to all particles. Use the numeric field to set the ID value.

Cycle

Assigns each particle a material ID in the range 1 to N, where N=# Sub-Materials, in increasing sequential order. The first ID assigned is 1, then 2, continuing to increment each by 1 until N; then 1 again, and so on.

Random

Assigns each particle a random material ID in the range 1 to N, where N=# Sub-Materials.

# Sub-Materials

The highest ID number assigned to particles using the Cycle or Random option.

In general, set this to the same number of sub-materials in the Multi/Sub-Object material. If you set it to a smaller number, the operator will use only that many sub-materials, starting with the first and counting upward.

Note3ds Max automatically sets this value to the number of sub-materials in the material, once only, the first time you apply the material to the operator. Any subsequent changes in the material itself, or applying a different material to the operator, will not change or update the setting.
Rate Per Sec(ond)

Sets the number of times per second that the assigned material ID is incremented. If this value is the same as the rate at which particles enter the event, then one ID is assigned per particle. If it's lower, then multiple particles are given the same ID, or if it's higher, then Particle Flow increments the assigned ID faster than 1 per particle.

For instance, if particles enter the event at intervals of 1/60 of a second, and Per Second=30, then each pair of particles will be assigned the same ID. Or if particles enter the event at intervals of 1/15 of a second, and Per Second=30, then the ID is incremented (or changed randomly) twice per particle.

Loop

When on, and the last ID has been assigned, Particle Flow loops back around to the first ID and continues the cycle. When off, Particle Flow assigns the last cycle ID to all subsequent particles. Available only with the Cycle assignment method. Default=off.

For example, say you want the first eight particles that enter the event to use different materials, and all subsequent particles to use a ninth material. To do so, you would create a nine-sub-material Multi/Sub-Object material and assign it to the Material Dynamic operator. Choose the Cycle assignment method, and set # Sub-Materials=9. Set the Rate Per Sec value to the rate at which particles enter the event. Lastly, turn off Loop.

Sync By

Choose the time frame for applying animated parameters. Available only with the Material ID and Cycle options.

  • Absolute TimeAny keys set for parameters are applied at the actual frames for which they're set.
  • Particle AgeAny keys set for parameters are applied at the corresponding frames of each particle's existence.
  • Event DurationAny keys set for parameters are applied to each particle starting when it first enters the event.
Rand Offset

When on, Particle Flow varies the difference between the particle age and the assigned material ID at random. The maximum difference is determined by the numeric parameter. Available only with the Material ID and Cycle options.

Uniqueness group

The Uniqueness setting varies the sequence of assigned IDs with the Random option, and the offset with the Randomize Age Offset option.

Seed

Specifies a randomization value.

New

Calculates a new seed using a randomization formula.

See Also