Cache Operator

The Cache operator records and stores particle states to memory. This is particularly useful with large or complex particle systems, where playback, and particularly backtracking, are slow because of the large amount of processing required.

When Cache is in effect, the first time you play or go to a frame, the particle motion up to and including the frame is calculated and recorded in the cache. Thereafter, playing the frame or any previous frames uses the data in the cache, rather than recalculating the particle action. With caching on, the particle system needs to be calculated only once for each frame, and thereafter playback and moving among frames is significantly faster.

To cache an entire flow, add a Cache operator to the global event. To cache an individual local event, add a Cache operator to it.

To determine how best to implement caching in your particle system, turn on Particle View Track Update Update Progress, and then play the animation or go to a frame relatively distant from the current frame. Observe the particle diagram, and watch for events with actions that highlight longer than a fraction of a second, or events with more activity than the rest. Any such events could benefit from caching.

Note: Use no more than one Cache operator per event, unless you’re using two: one set up for viewports, and the other for rendering. Similarly, don’t use global and local Cache operators in the same flow, unless one is set up for viewports, and the other for rendering.
Tip: When using real-time playback, if playback isn't fast enough, you can use the Cache operator to speed it up. For best results, set the Viewport integration step to the same value as the real-time playback speed, and set cache sampling to Integration Step. For example, if the real-time playback speed is set to 1/4x, then the Viewport Integration Step for viewport should be also set to 1/4 Frame, and the Cache operator Sampling parameter should be set to Integration step. Thus, because real-time playback is showing four times as many frames per second, and the Cache operator has stored four times as many frames per second, the two are synchronized. If the real-time playback speed is set to 2x or 4x, set the Viewport Integration Step to Frame.

Procedures

Example: To use the Cache operator:

  1. Start or reset 3ds Max, and then add a Particle Flow system.
  2. Open Particle View.
  3. In Particle View, go to Options menu Track Update and turn on Update Progress.

    This lets you monitor calculation of the particle system by highlighting actions in Particle View as the system executes them.

  4. In Particle View, Add a Keep Apart operator to Event 01.

    Keep Apart is a fairly calculation-intensive operator.

  5. Go to frame 100 by clicking the right end of the time slider track.

    There is a delay as the system calculates all particle motion between frames 0 and 100. This is necessary because Particle Flow is a history-dependent system. At the same time, the actions in the system highlight briefly in Particle View as they're executed at each frame.

  6. Go to frame 50 by clicking the center of the time slider track.

    There is a another delay as the system calculates all particle motion between frames 0 and 50.

  7. In Particle View, drag a Cache operator from the depot to Event 01. Insert it anywhere in the event.

    When you release the mouse button, there is a delay as the Cache operator automatically caches particle motion from the start of the animation to the current frame. Meanwhile, each action highlights briefly at each frame.

  8. Go to frame 20 or so.

    The only operators that highlight are Cache (very fast) and Display; there is no delay for calculation. All frames between 0 and 50 have been cached.

  9. Go to frame 100.

    The delay this time is a result of caching particle motion for frames 50 to 100.

  10. Jump to different frames, and drag the time slider.

    All particle motion is now cached, so no delays occur. But if you change a setting's value, the Cache operator automatically recalculates and stores the particle motion.

  11. Go to frame 100, and then, in Particle View, click the Keep Apart operator and use the keyboard to change the Falloff Zone value to 8.0.

    By default, the Cache operator automatically updates the cache when you change any parameters it stores. Thus, when you change the Falloff Zone value at frame 100, it recalculates and recaches the entire animation.

    Next, you'll briefly explore how manual caching works.

  12. Click the Cache operator and set Update to Manually.

    The Cache operator no longer updates the stored data automatically when you change a parameter.

  13. Click the Keep Apart operator, change the Falloff Zone value to 9.0, and then drag the time slider.

    There is no delay, because the animation is still playing back from the cached data. However, the cached data is now invalid, because you changed a parameter in the particle system.

  14. Click the Cache operator, and in the Manual Update group, click Update.

    3ds Max closes Particle View, updates the cache for the active segment, and then reopens Particle View. The cached data is now accurate.

    Other manual update options let you update the cache for the entire animation or a custom frame range.

    As you can see, the Cache operator is quite powerful. When present and active, by default it overrides recalculation of the particle system, except when you change any action parameters, whereupon it automatically updates the cached data. Used appropriately, it can save a good deal of time in setting up and testing particle systems.

Interface

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

Use At
Caches particle motion when playing back in the viewports, or at render time, or both. Default=Viewport.
Important: Choose the Viewport/Render option only when using the same number of particles in the viewports and for rendering. In other words, the two Quantity Multiplier settings on the Emission Rollout of the global event (or Particle Flow source) must be identical. Otherwise, unpredictable results can occur.
Update
If you change a parameter in the particle system, the cached data might become invalid. This setting determines whether Particle Flow should update the cache automatically, or let you do it manually. Default=Always.
  • Always Changing any parameter under the Cache operator's purview causes it automatically to update stored data from the start of the current range (see next parameter) to the current frame.
  • Manually Updating occurs only when you click the Update button, or clear the cache and then move to a different frame.
Range
Sets the frame range within which the Cache operator operates. Default=Active Segment.
  • Complete Particle Flow caches the entire animation.
  • Active Segment Particle Flow caches only frames in the active segment, as defined by the Start Time and End Time settings on the Time Configuration dialog. This is the frame range shown on the track bar. You can also change the active segment by holding down Alt+Ctrl and dragging the track bar with the mouse—for this operation you can use the left, middle, or right mouse button.
  • Custom Particle Flow caches only frames in the custom range, as defined by the Cache operator's Start Time and End Time settings (see following).
    Note: If you cache only part of the animation, Particle Flow calculates particle behavior in subsequent, non-cached frames using the cached data. For example, if you cache frames 0 to 50, and then jump to frame 60, Particle flow will calculate frame 51 based on the cached data, and frames 52 to 60 based on each previous frame.
Start/End Time
The first and last frames of the range considered for caching when Range=Custom (see above). Default=0, 30.
Note: The frame range time frame is in absolute time; that is, in terms of the entire animation. If you use a Cache operator locally, and specify a frame range during which no particles are present in the event, Particle Flow won't use the cache.
Sampling
Determines how often the Cache operator samples and caches the animation. Default=Every Frame.
  • Every Frame Particle Flow caches animation data once per frame.
  • Integration Step Particle Flow caches animation data at each integration step, using the Integration Step setting as specified in the Use At setting (see above). If Use At is set to Viewport/Render, it uses lower of the two Integration Step values. For example, if Viewport is set to Half Frame, and Render to 1/8 Frame, the sampling rate would be eight per frame.
  • Every Nth Frame Particle Flow caches animation data at frame intervals specified by the N value, below.
N
Determines the frame interval for caching when Sampling (above) is set to Every Nth Frame. Default=5.

For example, with N set to the default value of 5, the cache stores animation data for every fifth frame.

Cache Test Results
When caching particle data, this caches the results of test actions as well. Default=on.

This is important if Cache is used as a local operator, and the next event doesn’t have a Cache operator. For the next event to work properly, it should receive particles from the current event. Those particles result from the activity of a test action. The Cache operator can record the test activity to play it back later.

If the Cache operator is used as a global operator, there is no need to cache the test results. This is because the system has cache data for every event, and is able to jump to an arbitrary frame without the need for test results.

Save Cache with File
When on, Particle Flow Includes the cached data with scenes that you save to disk. This can significantly increase the size of saved files, but saves the time of recalculating the particle motion upon reloading the file. Default=off.

Normally, the cached data is saved only in disk files that you create with the Save or Save As commands. You can also instruct 3ds Max to include cached data with other types of files using the two following options.

Save Cache with Hold
Saves cached data in the Hold file, created with Edit menu Hold. Default=off.

Manual Update group

These controls let you update or clear the cache manually within a frame range, or clear the entire cache.

Update
Calculates particle motion within the current range (defined below) and stores it in the cache, replacing any existing cached data. Available only when Range is set to Active Segment or Custom.

During the update, 3ds Max temporarily closes Particle View and displays a Cache Update Progress bar, while moving the time slider through the cached range. At the same time, by default, the animation plays in the viewports. To prevent this, and speed calculation, turn off Update Viewports.

If the cache runs out of memory during a manual update, Particle Flow halts the update operation and displays an alert. Click OK to continue, and then, if possible, increase the Limit value before updating the cache again.

Clear
Deletes any cached data.

After you clear the cache buffer, if you go to a different frame or change any action parameters, Particle Flow automatically caches particle motion even if Update is set to Manually.

Range
Sets the frame range within which the Cache operator recalculates data when you click Update. Default=Active Segment.
  • Complete Particle Flow clears the cache for the entire animation. Choosing Complete makes the Update button unavailable; this option is for clearing the cache only.

    To update the entire animation, set the active segment or the custom range to encompass all frames, and then use the corresponding choice and click Update.

  • Active Segment Particle Flow updates the cache only for frames in the active segment, as defined by the Start Time and End Time settings on the Time Configuration dialog. This is the frame range shown on the track bar. You can also change the active segment by holding down Alt+Ctrl and dragging the track bar—for this operation you can use the left, middle, or right mouse button.
  • Custom Particle Flow updates the cache only for only frames in the custom range, as defined by the Start Time and End Time settings (see following).
Start/End Time
The first and last frames of the range that's updated when Range=Custom (see above). Defaults=0, 30.
Update Viewports

When on, the animation plays in the viewports during manual updating of the cache. Turn this off to disable playing the animation in the viewports during manual caching; this can speed up the caching process, especially with large or complex particle systems. Default=on.

Memory Used (K) group

The Cache operator stores data in system memory; you can specify an upper limit for the amount of memory it uses. If the Limit setting and the amount of cached data exceeds the available free memory, the computer system might use virtual (hard disk-based) memory instead, which slows down the caching. If Particle Flow fills the cache, any remaining frames are calculated on the fly.

This group also lets you monitor the amount of memory used for caching data.

Limit
The maximum amount of system memory used to cache particle data, in kilobytes. Default=100,000, or 97.6 MB.
Total
The amount of memory currently used by the cached data, in kilobytes. Read-only.
Note: Even animation frames with no particles will probably consume a certain amount of cache memory. The reason for this is that the cache also stores states for randomly calculated values such as Variation, to ensure that particle activity is consistent across a rendering network, and with machines that might not have regular access to all frames.
Current Frame
The amount of memory used by the data cached for the current frame, in kilobytes. Read-only.