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.
- 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.
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:
|ID||xp_id||int||The unique identifier of the particle.|
|velocity||xp_velocity||vector||The velocity of the particle (m/s).|
|age||xp_age||float||The age of the particle (seconds).|
|life||xp_life||float||The lifespan of the particle (seconds). -1 if Full Lifespan is enabled.|
|mass||xp_mass||float||The mass of the particle.|
|speed||xp_speed||float||The speed of the particle.|
The density of the particle.
|spin||xp_spin||float||The spin of the particle.|
|UV||xp_uv||vector||The UV coordinates at the given particle.|
The temperature of the particle.
|fuel||xp_fuel||float||The fuel value of the particle.|
|fire||xp_fire||float||The burn value of the particle.|
|smoke||xp_smoke||float||The 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.
Enable/disable motion blur of the particles.
When enabled the motion blur will be calculated using a velocity channel instead of taking the position of the particles in subframes.
Specifies if the velocity is interpreted as a 'per frame' or 'per second' value.
A float scale field (with a default value of 1) to do time scaling effects.
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.
Create a standard_surface shader by clicking Create > Arnold > Surface > standard_surface in the Material Manager.
Open the network editor and add an xparticles shader from the tree.
Connect the xparticles shader to the Base > Color parameter of the standard_surface.
Select the xparticles shader and set the color channel to age for example.
Don't forget to enable the age channel export in the Arnold tag of the Emitter. Change the render mode to spheres as well.
- 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).