Particle COLOR
----------------
The script in this example is:
default {
state_entry() {
llParticleSystem( [
PSYS_PART_START_COLOR,< 0.0, 1.0, 0.0 >,
PSYS_PART_END_COLOR, < 1.0, 0.0, 0.0 >,
PSYS_PART_START_SCALE,< 3.0, 3.0, 0 >,
PSYS_SRC_BURST_PART_COUNT,2,
PSYS_SRC_BURST_RATE,5.2,
PSYS_PART_MAX_AGE,5.0,
PSYS_SRC_PATTERN,PSYS_SRC_PATTERN_DROP,
PSYS_PART_FLAGS, PSYS_PART_INTERP_COLOR_MASK
] );
}
}
(Ignore the middle section with SCALE, COUNT, RATE, AGE and PATTERN until later.)
COLOR < red, green, blue >:
maximum: < 1, 1, 1 > (white, the default)
minimum: < 0.0, 0.0, 0.0 > (black)
Particles in this example start green and end red.
Àý×ÓÖеÄÁ£×ÓЧ¹û£¬´ÓÂÌÉ«¿ªÊ¼µ½ºìÉ«½áÊø
The option to re-color particles, like all flags, is OFF by default.
¸Ä±äÉ«²ÊµÄÁ£×ÓЧ¹û£¬Ä¬ÈÏÊ**رյġ£
To enable it, you must include the PSYS_PART_INTERP_COLOR_MASK as one of the PSYS_PART_FLAGS as shown above. (No other flags are used in this example)
Particle color CAN be affected by nearby light sources.
Á£×ÓÉ«²ÊЧ¹û£¬¿ÉÄÜ»áÓ°ÏìÖÜΧµÄ¹âÔ´¡£
One of the most common particle options causes particles to
be 'full brightness'. To add it to this script you would change the
flags line to be:
Ò»¸ö×î³£ÓõÄÁ£×ÓЧ¹û£¬ÄÜʹÁ£×Ó³ÉΪ¸ßÁÁ£¬ÓÃÏÂÃæµÄÃüÁ¸Ä±äÆì×Ó£º
PSYS_PART_FLAGS, PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_EMISSIVE_MASK
See the example on FLAGS and MASKS for an explanation.
¿´Àý×ÓÖÐµÄÆì×ÓÓëÃɰåЧ¹û
If you're not familiar with color vectors, it's helpful to know that:
red is <1,0,0>, green <0,1,0>, blue <0,0,1>
yellow is <1,1,0>, cyan <0,1,1> and magenta <1,0,1>
Pink is <1,0.5,0.75>, etc...
Õâ¸öÉ«²ÊÖµºÍÍøÒ³Öе͍ÒåÊÇÒ»ÑùµÄºÇ¡£¡£¡£¡£