particle glitter/flicker using rgbPP expression


#1

Hi all, long time no post.
I was wondering if someone had an idea of how to achieve this;
Trying to make particles choose a predefined colour per frame.
Make particles glitter/flicker per frame, ie the brightness of the chosen colour is random.
so thought the best way to do this would be an expression.
Got the colour part sorted:

vector $rgb1=<<.776,1,.927>>; vector $rgb2=<<.620,.427,1>>;

    vector $colors[] =

 {

 $rgb1,$rgb2

 };

   $size = `size($colors)`;

 int $color_picker = `rand 0 $size`;

  nParticleShape1.rgbPP = $colors[$color_picker];

 

But im stuck with the glittering. As an idea of the glittering i mean, runtime expression: rgbPP =rand(0.3,1); Something as simple as that, but using the predefined colours outlined above.

So im thinking i want to use a rand on the V of HSV perparticle, the HS stay the same just the V is randomized giving a flicker. But as far as i know theres no hsvPP? So how do i translate what im trying to do to rgb.
(theres an rgb_to_hsv command but i think it just prints values, not editable)

Also thought about randomizing the vector:
vector $zero=<<0,0,0>>
vector $randomized=rand($zero,$rgb1);
but this will return values mixed anything between 776,1,.927 and 0, which means multi-coloured rainbow mess. I sort of meant randomizing uniformally so values were reduced by the same amount together, which would keep the chosen colour just raise and lower to black.

Or is there an easier way to achieve this, without expressions?
Thanks guys.


#2

Managed to sort it, for those who are interested i just added some more variation with some new vectors and used a small amount of incanPP rand and got a similar effect i was after. Thanks anyway to those who read :slight_smile:


#3

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.