Color emitted particles using a texture

You can color emitted particles with a 2D or 3D texture. The texture can be the same as the underlying surface or any other texture you create in the scene. Each of the emitters has its own texture emission attributes, so you can apply a different texture (or color) to each group of particles even though each emitter emits the same nParticle object.

With this technique, you can layer a single emitted nParticle object with various colors to create complex particle effects such as smoke or fire. The particles use the emitted nParticle object’s attributes except for color (and optionally opacity), regardless of which emitter emits them.

For example, suppose you add two surface emitters to a plane and connect a single nParticle object to the emitters. The plane can emit particles colored by a black and white checker texture at the same time as particles colored by a purple to yellow ramp texture. The particles are a single emitted particle object. You can display the emitted particles as any render type, for example, spheres, by setting the appropriate attribute in the Attribute Editor for the emitted nParticle object.

  1. Add a surface emitter to the surface. See Emit nParticles.
  2. Select the emitted particles and add a per particle color attribute (rgbPP) and a per particle opacity attribute (opacityPP) from the Add Dynamic Attributes section of the Attribute Editor.
  3. Select Windows > Rendering Editor > Hypershade.

    If you need to create the texture, do so now. See Rendering for details. You don’t need to make the texture a part of a shading group. After you create the texture, make sure it’s visible in the Hypershade. Leave the Hypershade displayed on your screen.

  4. In the Outliner, select the emitter; it’s indented under the emitting surface object.
  5. Display the Texture Emission Attributes section of the Attribute Editor.
  6. Middle-drag the texture’s icon from the Hypershade onto the Particle Color attribute in the Attribute Editor.
  7. Turn on Inherit Color.

    When you rewind and play the scene, the particles emit from the texture with the same color and position as the texture. Note that you must turn on Shading > Smooth Shade All to see particle colors in your scene.

  8. Turn on the following attributes as desired: Inherit Opacity, Use Luminance, and Invert Opacity.
    Note: If you set the opacityPP attribute of the emitted particle with an expression or other technique, the attribute value overrides the above attributes.