Using affector nodes

Affector nodes apply force to particles. For an affector node to apply force to particles, it must be a direct child of the Particle System node on the particles of which you want to apply that force. To create different particle effects, you can use multiple affector nodes in a single Particle System node and use the Render Transformation or Layout Transformation properties to position them. To release particles that you affect with affector nodes, use emitter nodes. See Using emitter nodes.

Types of affector nodes

Kanzi Particles includes these types of affector nodes:

Using the Particle Attractor Affector

Particle Attractor Affector pulls particles toward or pushes particles away from itself.

Use these properties to adjust the affector:

  • Force property sets the magnitude and direction of the force that this affector applies to particles.

  • Range property sets the area in Kanzi units within which this affector applies force to particles.

You can limit the effect of a Particle Attractor Affector node to a specific volume. See Controlling the effect of an affector node.

Using the Particle Curl Affector

Particle Curl Affector defines an infinite force field that a curl noise function randomly distorts.

Use this affector to create natural looking movement for particles. With a high number of particles, this affector uses a lot of CPU resources.

Use these properties to adjust the affector:

  • Force property sets the magnitude and direction of the force that this affector applies to particles.

  • Frequency property sets how rapidly the noise field evolves.

  • Scale property sets the wavelength multiplier of the noise field.

  • Tightness property controls the amount that flow affects particles.

    With this property, you set the drag of the flow defined by the noise field. Higher tightness makes particles flow along the field. Use high values to achieve fluid-like motion and low values when you want other affectors and forces to have stronger impact on the particles.

  • Flow Speed property controls the speed of the flow.

  • Force Multiplier property multiplies the force for the force factor.

    In addition to using this noise field as force, you can use it as a flow that uses it.

  • Curl Dimension property sets the spatial dimension of curl forces.

    When set to 2D, the curl forces act on a two-dimensional plane extruded into 3D space. When set to 3D, the curl forces act on all three spatial dimensions. 2D curl requires around two to three times fewer computational resources than 3D curl does for the same amount of particles. Use 2D curl unless the content of your application requires curl to apply force on particles in all three dimensions.

../_images/curl-dimension.gif

You can limit the effect of a Particle Curl Affector node to a specific volume. See Controlling the effect of an affector node.

Using the Particle Drag Affector

Particle Drag Affector reduces the particle speed over time.

Drag property sets how the Particle Drag Affector influences particles on each axis.

You can limit the effect of a Particle Drag Affector node to a specific volume. See Controlling the effect of an affector node.

Using the Particle Force Affector

Particle Force Affector applies to particles a directional force.

Use these properties to adjust the affector:

  • Force property controls the strength of the force on each axis.

  • Layout Transformation and Render Transformation Rotation property field changes the direction of the force.

You can limit the effect of a Particle Force Affector node to a specific volume. See Controlling the effect of an affector node.

Using the Particle Mesh Affector

Particle Mesh Affector attracts particles toward the surface of a mesh.

Use this affector to make morphing effects. The Particle Mesh Affector works only with meshes that use the float data type for the mesh attributes.

Tip

To set the data type of mesh attributes in Kanzi Studio, either:

  • In the Library > Meshes, double-click the mesh for which you want to change the data type of attributes. In the Mesh Attributes Editor, set all attributes in the Data Type column to Float.

  • Before importing meshes, in the main menu, select Project > Properties and in the Binary Export property category, set the Default Vertex Attribute Data Type to Float.

Use these properties to adjust the affector:

  • Mesh property sets the mesh toward which you want to attract particles.

    When you change the value of this property, the affector causes the particles to move toward the mesh that you set.

  • Attraction Pattern property provides options to choose how particles are attracted toward the mesh surface:

    • Random attracts each particle to a random point.

    • Sequential attracts each particle to a mesh vertex with the corresponding ID as the particle.

    • Ordered by default attracts particles to each mesh vertex in the order as they appear in the data.

      If you use the Vertex Colors property, it attracts particles in the order specified by the vertex color data.

  • Distribution Variance property enables you to smoothly distribute the particles across the entire source primitive, or only across the vertex points.

  • Wireframe property enables you to attract particles to the mesh edges instead of faces.

  • Continuous Mode property prevents particles from locking onto their target positions once they are reached.

  • Edge Probability Weights property enables you to assign relative probabilities for a particle to be emitted from each edge of a triangle.

    You can use this property to simplify or distort the look of the underlying topology.

    This property only has an effect when the Wireframe property is set to enabled.

  • Tightness property sets the weight of the attraction toward the mesh surface.

    Lower values let other affectors have more effect.

  • Duration property changes the amount of time it takes for the particles to move to the surface of the mesh set in the Mesh property.

  • Duration Variation property adds randomization to the duration for each particle.

    At 0, each particle has the same duration. At 1, each particle has a duration between half and twice the value of the Duration property.

  • Delay Variance property adds variance to when the particles start moving toward the mesh.

  • Uniform Coverage property enables attracting particles uniformly onto the mesh surface.

    Enabling this property causes a moderate increase in CPU use and a minor increase in memory use.

  • Ordered Attraction Rate property allows you to control the rate at which ordered attraction runs.

  • Vertex Colors property allows you to use the mesh vertex color for attraction.

    Kanzi Particles uses this property when you enable the Uniform Coverage property. The property reads the color from the red color channel and ignores the other color channels.

    You can use the color data either for density of the attraction, to attract particles toward areas with brighter color values, or to attract particles in order from dark- to light-colored parts. To use the attraction order, set the Attraction Pattern property to Ordered.

Using the Particle Trajectory Affector

Particle Trajectory Affector attracts particles toward points in the shape of a trajectory.

Use these properties to adjust the affector:

  • Trajectory property sets the trajectory toward which you want to attract particles.

  • Trajectory Animation Speed property sets the speed of the movement of particles toward the trajectory.

  • Factor property sets the strength of the force.

  • Gap property sets the distance between the points in the trajectory to which the affector attracts the particles.

  • Offset property sets the offset for all points along the trajectory.

  • Spread Offset Minimum property sets the lower bound of random spread around the attraction target position.

  • Spread Offset Maximum property sets the upper bound of random spread around the attraction target position.

Using the Particle Vector Field Affector

Particle Vector Field Affector defines a volumetric field of force vectors from an fga file.

Use these properties to adjust the affector:

  • Vector Field property sets the file to use from which the affector generates vectors.

  • Origin Point property sets the center point of the vector field.

  • Cube Length property sets the size of the vector field.

  • Factor property sets the force multiplier on each axis.

  • Trilinear Interpolation property controls the force field interpolation.

    You can use this property to reduce the sharp edges in complex force fields.

  • Outside Behavior property sets the behavior of the affector to particles that are outside the bounding box:

    • No Force does not affect the particles.

    • Clamp applies to the particles the force of the nearest boundary cell.

    • Repeat repeats the vector field continuously across all dimensions.

  • Compress to Binary property compresses the fga file to reduce the size of the kzb file.

    When you enable this property, the loading time of the kzb file increases.

  • Tightness property sets the weight of the attraction to this force.

    Lower values let other affectors have more effect.

  • Flow Speed property controls the speed of the flow.

  • Force Multiplier property multiplies the total force.

Using the Particle Vortex Affector

Particle Vortex Affector generates a spinning vortex force.

Use these properties to adjust the affector:

  • Force property sets the force strength multiplier.

  • Pull property sets the strength of the pull force toward the center of the vortex.

  • Axial Drop property controls the up and down forces of the vortex.

  • Axial Power property controls the amount the distance decreases the axial drop force.

  • Range property controls the distance to which the vortex still have effect.

  • Tightness property sets how tightly the particles adjust to the speed of flow.

    0 sets to no tightness, 1 sets to follow the gradient field exactly and overrides force.

  • Flow Speed property sets the multiplier applied to tightness.

  • Gravity Well Strength property sets the depth and strength of the gravity well near the vortex center.

    Use this property to limit the maximum orbital speed.

You can limit the effect of a Particle Vortex Affector node to a specific volume. See Controlling the effect of an affector node.

Controlling the effect of an affector node

You can limit the effect of these affector nodes to a specific volume:

  • Particle Attractor Affector

  • Particle Curl Affector

  • Particle Drag Affector

  • Particle Force Affector

  • Particle Vortex Affector

Use these properties to control the effect of an affector node:

  • Affector Volume property sets the dimensions of the volume that limits the effect of an affector node.

  • Affector Falloff property sets how the effect of an affector node decreases in relation to the size of the volume set by the Affector Volume property.

    For example:

    • 0 creates an immediate falloff at the volume boundary. This is the default value.

    • 0.5 creates a falloff that is the average side length of the volume.

    • 1 creates an infinite falloff. The volume does not affect the effect of an affector node.

  • Volume Behavior property defines how Kanzi Particles applies to an affector node the volume set by the Affector Volume property:

    • Disabled ignores the volume. This is the default value.

    • Inside limits the effect of an affector node only to the particles that are inside the volume.

    • Outside limits the effect of an affector node only to particles that are outside of the volume.

See also

Getting started with Kanzi Particles