PDA

View Full Version : Particle Color

 lil star08-24-2004, 05:45 PMHey guys, Quick question for you, if you have an emitter emitting a multipoint particle how can you make the particle emitted two different colors at the same time? I didn't like the look of a color ramp I want two colors at once not for the particles to change from one color to another...Help!? Please... Thankyou!
codenamejyn
08-25-2004, 04:34 PM
The reason why you particle color changes according time is because by default when you assign a ramp to rgbPP you set the particle age to control the ramp...

There are plenty of ways to assign two different colors...

1. You could emit from a surface and map the "particle color" attribute that could be found under the emitter.

2. Using the "modulus" operation you could quickly assign two different colors that would be distributed randomly.

3. Use your own attribute e.g "pos.x" .Then choose this attribute to control your ramp when you assign a ramp on the rgbPP.

lil star
08-25-2004, 04:38 PM
What is the "modulus" operation?:shrug: If it would make the particles being emitted look more randomly colored then the others it would probably look more realistic.

codenamejyn
08-25-2004, 04:53 PM
The modulus operation:

if ( (particleId % 2 ) == 0 )
rgbPP = << 1 , 0 , 0 >> ;
else
rgbPP = << 0 , 0 , 1 >>;

...or if you want a simpler method....

When you assign a ramp under rgbPP there will be dialog box asking what attribute you want to control the ramp. Choose rgbVPP...and then set the ramp color....or if just want to have only two color use the "none" rather than the "linear"...and add a creation expression to the rgbVPP "rgbVPP = rand ( 1 ) "....

blacknight
08-25-2004, 05:31 PM
yeah the modulus operator would work very well, if you like some kind of degradation in the color you could try using something like

rgbPP = rand(<<0,0,0>>,<<1,1,1>>);

with the value of the two color that you want.
i mean something rgbPP = rand(<<0.95,0,0>>,<<1,0,0>>);

and rgbPP = rand(<<0,0.85,0.5>>,<<0,1,1>>);

for the if-else condition that way you get a little more variation

lil star
08-26-2004, 04:17 PM
WOW!! That worked awesome thanks!!:thumbsup: SSSOOO much better then the ramp that's exactly what I was wanting!

lil star
08-26-2004, 06:03 PM
okay here's another one for you guys, having to do with particle colour again, I thought it would be just as easy to continue it here. If you have a an emitter is there a mel script that you could use to create the end (or top of where the particles reach) to turn black. IE I've created fire now...hehe...and I would like it to look more smoky black at the top instead of it having look the same all the way through...sugguestions??

blacknight
08-27-2004, 12:20 PM
okay here's another one for you guys, having to do with particle colour again, I thought it would be just as easy to continue it here. If you have a an emitter is there a mel script that you could use to create the end (or top of where the particles reach) to turn black. IE I've created fire now...hehe...and I would like it to look more smoky black at the top instead of it having look the same all the way through...sugguestions??
use ramps controlled by the lifespan

or create your own with expression with an smoothstep command

lil star
08-28-2004, 10:20 PM
Okay, I've tinkered with the ramps that go with the crater color (life, transperancy and incandesence) but none of these are giving me the look that I want to achieve with the black color being at the top instead of throughout. I have a feeling that those are the ramps that you meant. I looked under lifespan and what not under the particle's attributes but there is no where where I could attach a ramp to the particle itself??? Does this make sense to you cuz my head is spinning!?

alex.ongaro
08-29-2004, 03:40 AM
Ther's a lot of way to achieve this effect and I would use an expression with smoothstep or linestep like blacknight suggested
Or you you don't want to use expressions, one is to add a per particle attribute, let's say colorGainPP (of type vector), connect a ramp controlled by the particle's age (default),make the bottom knot white and the top black, delete the middle one, than if you 're controlling the color through an expression just write somthing like:

rgbPP *= colorGainPP;

Right after where you set you color, or if you're using a ramp to color you particle, just use the connection editor and feed the outColor of the colorGainPP ramp to the colorGain attribute of the ramp you use in rgbPP.

CGTalk Moderation
01-19-2006, 01:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.