X-Particles

 

X-Particles is a powerful, commonly used third-party particle simulation engine developed by Insydium Ltd. C4DtoA is shipped with native support for X-Particles. The X-Particles Emitter object is automatically translated to an Arnold points node with default settings (as points). To define parameters for the points node, you must add an Arnold tag to the Emitter.

 

 

Limitations

  • Size variation and scale settings of the X-Particles material does not work in XP v2.5. In v3 it only works in the PV render and not with the IPR.
  • Particle filling is not supported. It is not accessible via the API.
  • Trails are not directly supported. A workaround is to use a Tracer object.
  • X-Particles does not work correctly in the IPR in some cases. It is a current limitation.

 

See the Particles page for more information about general particle parameters.

Channels

 

Each particle has several data channels assigned which can be exported to Arnold and read within a shader network. On the Channels tab, you can define which channels you want to export. Values are added as user parameters with an xp_ prefix (e.g. xp_id, xp_velocity, xp_color, etc.) and can be read via the appropriate user_data shader.

If an X-Particles Material is added to the emitter then radius, color, and transparency are sampled using the material.

The following channels are available:

NameParameter nameTypeDescription
IDxp_idintThe unique identifier of the particle.
velocityxp_velocityvectorThe velocity of the particle (m/s).
agexp_agefloatThe age of the particle (seconds).
lifexp_lifefloatThe lifespan of the particle (seconds). -1 if Full Lifespan is enabled.
massxp_massfloatThe mass of the particle.
speedxp_speedfloatThe speed of the particle.
densityxp_densityfloat

The density of the particle.

spinxp_spinfloatThe spin of the particle.
UVxp_uvvectorThe UV coordinates at the given particle.
temperaturexp_temperaturefloat

The temperature of the particle.

fuelxp_fuelfloatThe fuel value of the particle.
firexp_firefloatThe burn value of the particle.
smokexp_smokefloatThe smoke density of the particle.

 

Channels can be mapped to the 0-1 range (between the minimum and maximum value of the current frame) where it's possible. Any custom mapping can be achieved within the shader network by exporting the minimum and maximum channel values (Export channel min/max value is enabled). The min and max values can be read via a user_data_float shader. The name of the parameter is the channel name with the xp_ prefix and a _min or _max postfix (e.g. xp_age_min, xp_density_max, etc.).

An example setup of custom mapping of the density channel.

Motion Blur

Enable

Enable/disable motion blur of the particles.

Use Motion Vector

When enabled the motion blur will be calculated using a velocity channel instead of taking the position of the particles in subframes.

Unit

Specifies if the velocity is interpreted as a 'per frame' or 'per second' value.

Scale

A float scale field (with a default value of 1) to do time scaling effects.

Shading

If no Arnold shaders are defined for the Emitter, then a default xparticles shader will be assigned to display the color of the particles. You can also use any surface shader (e.g. standard_surface) together with xparticles.

  1. Create a standard_surface shader by clicking Create > Arnold > Surface > standard_surface in the Material Manager.

  2. Open the network editor and add an xparticles shader from the tree.

  3. Connect the xparticles shader to the Base > Color parameter of the standard_surface.

  4. Select the xparticles shader and set the color channel to age for example.

  5. Don't forget to enable the age channel export in the Arnold tag of the Emitter. Change the render mode to spheres as well.

  6. Setup the standard_surface shader by your needs and assign the material to the X-Particles emitter. You can also add an X-Particles Material to the emitter and use its color output to colorize the particles. The Color channel in the xparticles shader must be set to color in this case.

 

User data shaders can also be used to read exported channels. In this case, you have to use the xp_ prefix in the attribute name (e.g. xp_velocity, xp_age).

 

 

 

 

 

 

  • No labels