Coloring Particles Individually (MAYA Texturing)


You can split particle texturing into two major categories: hardware rendered and software rendered. You can allocate hardware-rendered particles, which comprise MuliPoint, MultiStreak, Points, Spheres, and strip, to any material. Though, just the color information is used. In adding, you have to cause to be the particles with the Hardware Render shock absorber window or the Hardware renderer, or else the particles vanish. Though texturing ability of hardware- rendered particles is incomplete, you are free impart exclusive colors to human being particles. To do so, generate a per-particle characteristic with the subsequent steps:

1. Make a new scene. Generate a particle emitter by switching to the Dynamics menu set and choosing Particles / Create Emitter. Open the Hyper graph Scene pecking order window, choose the particle1 node, and open its quality Editor Tab. button to the particleShape1 tab. In the Lifespan Attributes segment, control Lifespan Mode to steady. Modify Lifespan to the figure of seconds you would similar to the particles to exist. In the Render Attributes segment, control the Particle Render Type characteristic to the hardware-rendered element type of your option.

2. In the Add lively Attributes section, click the Color key. The Particle Color window opens. Check the Add Per Particle Attribute check box and click the Add Attribute key. The window closes and the rgbPP attribute is extra to the Per Particle (Array) Attributes segment.

The Per Particle (Array) Attributes and Add Dynamic Attributes sections

3. RMB click the meadow to the correct of rgbPP and decide make Ramp from the shortcut menu. A Ramp texture and an Array Mapper utility are further to the particleShape1 shading network. This is represented by the subsequent text, which appears in the meadow to the right of rgbPP:

4. Open the Hypershade window. Control to the Textures tab. MMB drag the ramp1 texture icon into the employment area. Click the Input And Output relations key (the icon has two arrows bounded by a box). The arrayMapper1 and particleShape1 nodes are revealed. The Array Mapper utility is designed to relate the age of each particle to a location on the ramp texture. A youthful particle receives its color from the base of the ramp. An aged particle receives its color from the pinnacle of the ramp. At this period, the particles just alter from red to green to blue.

5. To create the particle colors additional attractive, open the ramp1’s Attribute Editor tab.

Put in extra color handles into the ramp field. The additional color handles you make, the better the particle variety. Change the Noise attribute to 1 and the Noise Freq quality to 5. The ramp is thus knotted.

6. In a workplace view, check on flat Shade every one. Play the Timeline. The particles take on exclusive colors based on the ramp1 texture. An instance scene, which uses globe hardware-rendered particles, is built-in as hard_color.mb in the Chapter 6 scene folder on the CD.

Hardware-rendered particles colored with a Ramp texture and Array Mapper utility

With this instance, the particles shift through a variety of colors. To allocate an exact color to a particle and have the particle keep that color all through its life, you have to apply an appearance. To become accustomed the particle emitter that was shaped at the start of this segment, carry on with these extra steps:

7. In the Per Particle (Array) Attributes segment, RMB click the meadow to the correct of rgbPP. Highlight the

8. RMB click the field to the true of rgbPP and decide formation Expression from the shortcut menu. The appearance Editor opens. Type the subsequent code into the employment area and click the generate key:

float $r = rand(1) + .25;

float $g = rand(1) + .25;

float $b = rand(1) + .25;

vector $pColor = <>;

particleShape1.rgbPP = $pColor;

9. Play the Timeline. Every particle receives a arbitrarily chosen Red, Green, and Blue channel value, which is stored by the $r, $g, and $b variables. The rand(1) purpose generates accidental values from 0 to 1. A supplementary 0.25 is added to each channel, thereby biasing brighter colors. The three channels are stored in the vector $pColor so that they might be passed to the rgbPP attribute. An example scene is included as hard_color_2.mb in the Chapter 6 scene folder on the CD.

Hardware-rendered particles assigned random, life-long colors

If you’re inquisitive as to which colors are assigned to a human being particle, RMB click over the subdivision in a workplace view, choose Particle from the marking menu, and choose the particle. Decide Window / General Editors / Component Editor and control to the Particles tab. rgbPP R, rgbPP G, and rgbPP B values are scheduled in their own columns.