tyCache Object

The tyCache object can be used to load tyCache files, which store particle data for rendering.

The tyCache (.tyc) format is a custom data format used to store tyFlow particle data. tyCache files can be exported from the “Export: tyCache” rollout of any tyFlow object.


tyCache Rollout

Sequence

  • Filename: choose a .tyc sequence to load. You can choose any single file from a sequence and the rest of the matching files will be loaded automatically.

  • Reload this: reloads particle data of the selected object.

  • Reload all: reloads all particle data in all tyCache objects in the scene.

Time

  • Frame offset: offsets the timing of sequence playback.

  • Clamp frame range: controls whether the input sequence frame range will be clamped.

  • Clamp range: define the clamped frame range of the sequence.

Out-of-range
  • Hold: requested frames outside of the clamp range will be set to the nearest frame within the clamp range.

  • Loop: requested frames outside of the clamp range will be set to loop within the clamp range.

In hold mode, a requested frame of 125 in a clamp range of 0-100 will be set to 100. In loop mode, a requested frame of 125 in a clamp range of 0-100 will be set to 25.

  • Round to nearest frame: prevents sub-frame evaluation. Can alleviate some rendering errors caused by changing topology.

When “round to nearest frame” is enabled, deformation motion blur will no longer occur.

Retimer

  • Enable retimer: controls whether playback will be controlled by the retimer frame value.

  • Retime type: controls whether the retimer affects playback frame or speed.

By frame
  • Frame: the retimer frame value that controls playback. Animate this value to control the current playback frame.
By speed
  • Speed %: the percent value that controls playback speed.

  • Ref Frame: the reference frame that the speed multiplier will be relative to.

Setting a proper reference frame is important for the speed multiplier. The reference frame should typically be the start frame of your playback sequence, not necessarily the start frame of the tyCache.

The equation for the speed retimer is:

playbackFrame = [referenceFrame + abs(time - referenceFrame) * speed * sign(time - referenceFrame)].

The speed value is not animatable. If you need a variable playback speed, use the retimer in “frame” mode instead.


Coordinates

  • Local/Global: controls the coordinate system that the processed particles will be displayed in. Setting this to local means the loaded transforms will be displayed relative to the transform of the tyCache object.

Particle Scale

  • Multiplier: controls the global scale multiplier for particles.

  • X/Y/Z: controls the per-axis scale multiplier for particles.

Press the “>>” checkbutton to switch between scale modes.

Memory

  • Keep frames in RAM: loaded data will be kept in RAM, for faster previews. Disable this to conserve memory.

Elements Rollout

Enable tyCache Elements

  • Particles: load particle data from the input file sequence.

  • Deforming meshes: load deforming mesh data from the input file sequence.

tyCache files may contain both particle data and deforming mesh data. Deforming mesh data corresponds to the cloth/skin meshes of the originating flow.

ParticleObject Interface

  • Enable Particle Interface: controls whether the particle interface will be returned when the tyCache object is queried for its default interface. Returning this interface allows third-party plugins to query a tyCache for its particles.

  • Incl. legacy interface: when enabled, 3ds Max’s legacy particle interface (I_PARTICLEOBJ) will be enabled, as well as its modern interface (IParticleObjectExt).

Disabling the “incl. legacy interface” setting can improve compatibility with certain 3rd party plugins.

Born/Deleted Particles

  • Subframe scale up: new particles will by scaled up from zero between the first and second whole frames of their life.

  • Subframe scale down: deleted particles will be scaled down to zero between the second last and last frames of their life.

  • X/Y/Z: the axis which will be scaled to/from zero.

Enable up/down scaling when slowing down tyCache playback with the retimer, to avoid jarring pops as particles appear or disappear.

If “subframe scale up” is enabled, particles will be scaled to zero (and therefore invisible) on their birth frame.

Cull Particles

Material ID
  • Cull By material ID: allows you to cull particles by their material ID.

  • MatID: the material ID value.

  • Equal/Not Equal: determines whether particles will be culled if their material ID is equal to the specified value, or not equal to it.

Surface Area
  • Cull by surface area: allows you to cull particles by the surface area of their mesh.

  • Area: the surface area value.

  • Smaller/Larger: determins whether particles will be culled if their surface area is smaller or larger than the specified value.

Simulation Groups
  • Simulation Groups: controls which particle simulation groups will be culled by the tyCache.
Export Groups
  • Export Groups: controls which particle export groups will be culled by the tyCache.

Display Rollout

Display Cache Geometry

  • Display in viewport: controls whether loaded particles will be displayed in the viewport. Disabling this (as well as particle display) will prevent any data from being loaded outside of rendering, increasing viewport performance when loading a large number of particles.

  • Meshes/Bounding boxes: controls whether particles will be displayed in the viewport as full meshes, or bounding boxes. Depending on the resolution of the particle geometry, setting this to “bounding boxes” can dramatically increase viewport performance.

Acceleration
  • Use GPU instancing: controls whether particles are displayed as a single mesh, or as individual meshes instanced with the GPU. Enabling this setting will dramatically increase viewport performance if compatible hardware is found.

GPU instancing’s efficiency comes from the fact that no per-particle meshes need to be generated or combined for display. Since raw mesh data is sent directly to the GPU, tyCache objects themselves will contain no mesh data corresponding to what is displayed in the viewport. This means that while you will be able to see the particles in the viewport, you will not be able to see the effects of any mesh modifiers added to the tyCache object itself, since it contains no modifiable mesh data. If you need to see the effects of mesh modifiers in the viewport, GPU instancing must be disabled.

GPU instancing will only work with Nitrous viewport display drivers.

  • Ignore UVW overrides: Controls whether UVW (mapping) overrides on particles will be ignored.

Nitrous GPU instancing does not support UVW (mapping) overrides on instances. Therefore, if particles have active UVW overrides, instead of being instanced they will be combined into a single (potentially gigantic) mesh. Depending on the number of particles in the cache, this can eat up huge amounts of system resources. For example, a million identical particles with no mapping override can be sent to the GPU as a single mesh and a million transforms. But, a million particles with mapping overrides will be sent to the GPU as a million different meshes – something even the most powerful systems will have a hard time processing. By enabling “ignore UVW overrides”, mapping overrides on particles will be ignored for viewport display, maximizing the number of particles that can be efficiently instanced in the GPU. The drawback is that with “ignore UVW overrides” enabled, particle mapping channels will not have a visible effect on particle material display in the viewport.

Mesh Optimization
  • Simplify meshes: enabling this option will only display a subset of tyCache mesh faces in the viewport, for potentially faster viewport display.

  • Max faces: the maximum number of mesh faces to draw when simplification is enabled.

Display Cache Particles

  • Display in viewport: displays cached particles in the viewport as points

Viewport Optimization

  • Display %: controls the percentage of loaded particles to display in the viewport.

Icon

  • Show icon: controls whether the tyCache icon is displayed in the viewport.

  • Icon size: controls the size of the tyCache icon.

  • Show name: displays the name of the tyCache next to its icon in the viewport.


Render Rollout

Rendering

  • Render %: controls the percentage of loaded particles to render.

  • Enable VRay Interface: controls whether the I_VRAYGEOMETRY interface will be returned when the tyCache object is queried by VRay for its VRay-compatible interface.

  • Load instance materials: controls whether instance materials exported from the source flow will be loaded (if available) onto render instances.

  • Pre/post render refresh: controls whether tyCache will send reset notifications to objects which depend on it (before and after rendering), if its viewport display is not necessary identical to its render output.

A tyCache has several ways to display its data in the viewport (Mesh vs GPU instances, Display %, etc). These methods may not align with its rendered representation. Because of this, a tyCache will send reset notifications to Max telling Max that it has changed and needs to be updated before and after rendering. Normally, this ensures that the tyCache’s viewport representation remains consistent and its render meshes are not displayed in the viewport after rendering completes. However, because a tyCache has no way of knowing the manner in which other objects reference it, it is pretty liberal in how it determines whether or not to send the reset notifications (to ensure maximum compatibility), and sometimes these notifications are technically unnecessary. Not only are they sometimes unnecessary, but if you have a tyFlow object that depends on your tyCache object (ex: the tyCache is the input object in a Birth Flow operator), the reset notifications will cause your tyFlow to refresh its simulation when rendering begins or ends, which can undesirable. This setting allows you to disable the reset notifications, thereby avoiding that potentially unwanted behavior.

  • Meshes/Instances: controls whether particle meshes will be rendered as a single editable mesh, as or instances.

Rendering as instances can vastly improve rendering speed and efficiency for any given group of particles. However, modifiers added to a tyCache object set to render as instances will not work, since the tyCache object will not return any modifiable mesh data for them to modify during the evaluation of the modifier stack. If you want to assign modifiers to a tyCache object, you must render as meshes, not instances.

tyCache objects set to render as meshes that contain a changing number of particles will not render with correct motion blur. This is due to the fact that changing particle counts will result in changes to the topology of the rendered mesh over time. The only way to ensure correct motion blur on particles is to render as instances (with a compatible renderer), or ensure that particle counts do not change over time.