Color Modifier

Summary

This modifier changes particle color in a controlled fashion, that is, not just a simple color change but a graduated change over time. Various modes of operation are available.

Interface

This is the modifier's interface in the default mode:

For the 'Groups Affected', 'Mapping', and 'Falloff' tabs, and for the buttons at the bottom of the interface, please see the 'Common interface elements' page.

Parameters

Enabled

Uncheck this switch to disable the modifier.

Mode

Independent [default setting]

In this mode, the modifier will work in the same way as a standard Cinema 4D particle modifier: particles will be affected if they come into the field of effect of the modifier. X-Particle Actions have no effect on the modifier in this mode.

Action-Controlled

In this mode, the modifier will only act on a particle when told to do so by an Action. Until that point, the particle will not be affected, but once activated for a particular particle, the modifier will continue to influence it as long as it is in the field of effect of the modifier. The modifier's effect on a particle can be halted by means of another Action, if desired.

Operation

The modifier has several modes of operation, selectable from this drop-down:

Set Color (Immediate)

In this mode the modifier will change the color as soon as the particle is in the modifier's field of effect. It is not an incremental change as with 'Set Color' but it does require the particle to be within the modifier's falloff field and will still be affected by the 'Threshold' setting if that is greater than zero.

Set Color

The simplest mode, simply changes the particle color as it passes through the modifier's falloff. The color change is permanent. The rate at which the color change occurs is influenced by the modifier's falloff.

Set By Falloff

In this mode, the color changes while the particle is in the modifier's falloff, but reverts to the original color as it passes out of the falloff zone.

This image shows the difference between the two modes, with Set Color on the left and Set By Falloff on the right:

Color Modifier modes 1

Fade Between

This is similar to 'Set Color' but is simpler to use to get a smooth change in color. With 'Set Color' the only way to get a smooth change, as opposed to an abrupt one, is to use the modifier's falloff. This doesn't give precise control and is dependent on the particle's location within the field of effect. With 'Fade Between' you simply set the color to change to and adjust the 'Fade Value' to control the rate of change.

Note that the fade value is still dependent on the modifier falloff, and can be mapped as with other parameters.

Choosing this option will reveal these additional parameters:

Change Every

Sets how often the color is changed if 'Operation' is set to 'Fade Between'. The default is 1 frame, so the particle color may change every frame.

Fade Value

This controls the rate at which the color changes if 'Operation' is set to 'Fade Between'. The higher the value the faster the change. A value of 100% will cause an immediate change (assuming there is no falloff) while a value of 0% will result in no color change at all. A value of 5%, for example, will take about 20 frames to complete the color change (100 / 5 = 20) but this is dependent on the modifier falloff, so may take a little longer if there is a falloff present.

This value can be mapped if desired to give even closer control.

Increment/Decrement Color

In this mode, the modifier will change the color by a set amount as long as the particle remains within the modifier's falloff. The rate of change is governed by the three rate of change parameters. You can change the red, green, and blue components at different rates if desired.

Selecting this option reveals these additional parameters:

Red/Green/Blue Rate of Change

These parameters are used in conjunction with the 'Increment/Decrement Color' mode. The maximum value is 255, which will cause an instant color change. A value of zero will result in no change. Values less than zero will reduce the color values for each component.

Random

The modifier assigns a random color to each particle.

Use Texture Tag

With this mode you can drag a texture tag into the 'Texture Tag' link field and the particle color will be sampled from the shader in that tag. The sampling will be done in one of two ways;

  1. If the particle was emitted from an object, and you have turned on 'UV Emission Data' in the emitter's Extended Data tab, the particle will have stored its emission point UV coordinates. The texture will then always be sampled at that point, so if the texture is animated, the particle color will change as the texture at that point changes,
  2. If the particle was not emitted from an object, or if it was but you did not turn on 'UV Emission Data', the texture will be sampled at a randomly assigned point for that particle (and it will always be the same point for any specific particle).

The sampled color will be blended with the color from the 'Color' setting, depending on the 'Mix Mode' and 'Mix Strength' settings.

Note: this will only work with channel shaders, not materials such as Hair, Nukei, etc.

The following settings are available:

Texture Tag

Only available in 'Use Texture Tag' mode. Drag the tag to be sampled into this field. Note that the material must be a channel shader, not the Hair material, Nukei, etc.

Channel

Only available in 'Use Texture Tag' mode. This is the channel to sample from (Color, Luminance, etc.). The channel does not have to be used in the material. You can set up an unused channel and sample from that if desired.

Use Vertex Color Tag

If you select this option you can drag a vertex color tag into the link field which appears and the modifier will take the particle color from the tag.

In order to use this feature, you must:

  • be using Cinema 4D R18 or higher
  • emit from an object's vertices
  • and turn on 'Emission Vertex' in the emitter's Extended Data tab (this is so the modifier knows which vertex to sample for which particle)

Gradient By Parameter

In this mode the color modifier functions in the same way as if you had selected 'Gradient (Parameter)' from the 'Color Mode' drop-down menu in the emitter's 'Display' tab. The interface will change to look like this:

Note that unlike the emitter there is no 'Auto' switch, so you must enter the required range of values into the 'Min.' and 'Max.' settings.

Time-Dependent

This mode displays a color gradient and when the particle enters the modifier's falloff it will change the color to the color on the left of the gradient. Then over time it will change the color to the color on the right of the gradient. How long it takes to make the full change is governed by the 'Time to Completion' parameter. The interface changes to look like this:

When the color change is complete, what the modifier does then is governed by the 'On Completion' parameter.

Distance From Object

This is the same as for the 'Time-Dependent' mode but the rate of change is governed by the distance of the particle to an object in the scene. With this mode, two additional settings are available: 'Nearest Distance' and 'Furthest Distance'. All particles closer to the object than the nearest distance will have the color at the left of the gradient, while all particles farther away from the object than the furthest distance will have the right-hand gradient color. Particles with a distance from the object in between the two distance values will have a color somewhere along the length of the gradient.

Distance From Camera

Exactly the same as the 'Distance From Object' mode except that the current camera is used instead of a scene object.

Change on Birth Only

If this switch is checked, the color is only changed for newly-created particles. After that, the modifier will not affect the particle at all (and no other color modifier will do so either, if that switch is also checked in them). This has been added specifically to help this modifier work in conjunction with the Infectio modifier. See that modifier page for more details.

Store Color Brightness

If this switch is checked, when the color is changed the overall brightness will be stored as a particle data item. This can then be used later elsewhere in X-Particles. Note that the stored brightness will continue to be updated as long as the modifier affects the particle, unless the 'Change on Birth Only' switch is also checked.

This has been added specifically to help this modifier work in conjunction with the Infectio modifier. See that modifier page for more details. You can also use data mapping with this value. It is in the list of maps as 'Color Modifier Brightness (Color Mod.)'.

Color

Only available in 'Set Color', 'Set Color (Immediate)', 'Fade Between' and 'Set By Falloff' modes. It sets the particle color, in combination with color from a shader (if present).

Shader settings

If 'Operation' is set to 'Set Color (Immediate)', 'Set Color', 'Fade Between' or 'Set By Falloff' there is the option to use a shader to generate the color. In these modes, the following parameters become available:

Shader

A link field for a channel shader.

To the left of the word 'Shader Sampling' is a little arrow. Click this to reveal the other parameters.

The shader sampling is a true 3D sampling for those shaders which support it. For example, here is a Box emitter with the particles colored by a Noise shader:

Although you cannot see from this image, the sampling is carried through the volume of the emitter.

Note that not all shaders will give a 3D sample of this kind. 'Noise', 'Rust' and 'Earth' will do so for example, but 'Brick', 'Simple Turbulence' and a number of others will not.

Shader Sampling

This menu determines how the shader is sampled.

The options are:

  • Shader Space: this will sample the color at the particle position in the 3D world (this is the default setting)
  • Random (Variable): this will sample the shader at a different random point in each frame.
  • Random (Fixed): the shader will be sampled at a point which will always be the same point for each particle but will be a different point for different particles.

Scale U, Scale V, Scale W

These three parameters control the size of the shader across the sample space. To put it another way, if the 'Tile' parameter is checked a bitmap will be tiled across the sample space and the number of tiles is controlled by these parameters. If 'Tile' is unchecked the bitmap is simply scaled.

Procedural shaders are scaled using these parameters but the 'Tile' switch has no effect.

Offset U, Offset V, Offset W

The shader will be offset by these amounts in the respective direction.

Mirror U, Mirror V, Mirror W

Checking these switches will mirror the shader across the respective axis.

Tile

If a bitmap is used, checking this switch will cause it to be tiled across the sample space. The number of tiles is controlled by the 'Scale U' and 'Scale V' settings. The switch has no effect on procedural shaders.

Gradient Settings

These settings become available if 'Operation' is set to 'Gradient By Parameter', 'Time Dependent', 'Distance From Object' or 'Distance From Camera'.

Gradient

The color gradient used in the the gradient modes.

Gradient Parameter

This drop-down menu is only used in the 'Gradient By Parameter' mode. The color change is dependent on one of several particle parameters. The parameters available are:

  • 3D Linear
  • Age
  • Direction*
  • Distance Travelled
  • Fire
  • Fluid Density**
  • Fuel
  • Mass
  • P-P Distance***
  • Radius
  • Speed
  • Smoke
  • Temperature

* Direction is an absolute value and there is no min/max setting possible with this. You can select the direction axis to test; this can be either Heading, Pitch or Bank. Particle direction is a vector, with three components to indicate the amount of movement along each axis. Each component can be between 0 and 1 and this is used as an index into the gradient to choose the color.
** Fluid Density will only work if the SPH Fluid object is active in the scene.
*** P-P Distance is the distance to the nearest particle from the one to be colored. It will only work if the 'Nearest Particle Data' switch has been checked in the emitter's 'Extended Data' tab so that the particle holds the distance to the nearest other particle.

To determine the position along the gradient to sample the color, the 'Min.' and 'Max.' settings are used. You should alter these values to fit the expected range of the parameter used. For example, if 'Speed' is chosen in 'Gradient Parameter', particles with a speed at or less than the 'Min'. value are given the color at the left edge of the gradient, while those with a speed at or greater than the 'Max.' value are given the color at the right edge.

If the option '3D Linear' is chosen, the following settings are revealed:

In this mode the gradient is used to color the particles depending on their position along a specified axis. For example, with the default settings seen above, if the particle Y position is at zero or less, the color will be taken from the left-hand end of the gradient. If it is +500 or more, the color comes from the right-hand end of the gradient.

Linear Mode

The axis to use - X, Y or Z.

Axis Min.

The lowest position along the axis.

Axis Max.

The highest position along the axis.

Space

This menu has two options:

  • World: the position along the axis is the actual position in the 3D world.
  • Local: the position is relative to the position of the object given in the 'Object' setting. This can be the emitter itself or any scene object.
Object

The object used if 'Space' is set to 'Local'. If it is left empty, the world position is used instead.

Min., Max.

These are the values which set the range for the parameter chosen in the 'Gradient Parameter' setting. These are not available for the 'Age' or 'Direction' parameters.

Direction Axis

The axis to use when 'Gradient Parameter' is set to 'Direction'. The three options are Heading, Pitch, and Bank.

Time to Completion

This parameter is only available if 'Operation' is set to 'Time-Dependent'. It is the amount of time taken to change the color from the left of the gradient to the color at the right of the gradient.

On Completion

This parameter is only available if 'Operation' is set to 'Time-Dependent'. It governs what happens when the color change is completed. There are three options:

Do Nothing

No further change to the particle color will occur.

Wrap to Start

The color will be changed back to the color at the left of the gradient and the process repeated.

Reverse

The color change will be reversed: it will begin to change back to the color at the left of the gradient, taking the time in 'Time to Completion' to reverse the change.

Object

The object to measure particle distance from if 'Operation' is set to 'Distance From Camera'.

Nearest Distance, Furthest Distance

These parameters are only available if 'Operation' is set to 'Distance From Object' or 'Distance From Camera'. All particles closer to the object or camera than the nearest distance will have the color at the left of the gradient, while all particles farther away from the object or camera than the furthest distance will have the right-hand gradient color. Particles with a distance from the object or camera in between the two distance values will have a color somewhere along the length of the gradient.

Vertex Color Tag

A link field for a vertex color tag if you set 'Color Operation' to 'Use Vertex Color Tag' (Cinema 4D R18 or higher only).

Threshold

This is a setting designed to introduce some random chance into the color change. Each time the color is due to change for a particle (see 'Change Every' above) a random number is generated; if that number exceeds the threshold, the change will take place, but if it does not there will be no change. You can see that a value of 0% will always result in a change occurring; a value of 100% will mean that a change never occurs.

Mix Mode/Mix Strength

This drop-down determines how the color from the 'Color' and 'Shader' fields are blended. The standard four blend options are available. The 'Mix Strength' parameter governs the relative contribution of each color to the final result. A value of 100% means that only the shader color is used, while 0% will only use the Color field color.

These parameters have no meaning if no shader is present in the 'Shader' field.

Change Shape

The Color modifier can also change the particle shape without changing the particle's group. The shape change will occur as soon as the particle enters the modifier's field of effect. It is not affected by any other parameter and is independent of the choice in 'Color Operation'.

Shape

If 'Change Shape' is enabled, this drop-down menu enables you to choose the new shape.