4
$\begingroup$

I have five separate color ramps for leaf colors and I want the leaves to choose their colors randomly.

My setup looks like this:

Enter image description here

But this doesn’t work as I want:

Enter image description here

I want it to looks like this:

Enter image description here

But with my gradients.

I tried adding a round math node after the object info, but that didn't have any effect.


Thanks to Allen Simpson, it works!

Enter image description here

$\endgroup$
4
  • $\begingroup$ Then it just looks like the last photo and I want that nice gradient to be on these leafes $\endgroup$
    – Michael
    Commented Dec 21, 2020 at 14:49
  • $\begingroup$ ok my bad I misunderstood $\endgroup$
    – moonboots
    Commented Dec 21, 2020 at 14:54
  • 2
    $\begingroup$ Not an answer to the question, but in your case you could have just 1 color ramp in Black & White and just change the color with a mix RGB set to "Color" and use the factor the same way. My 2 cents $\endgroup$
    – Gorgious
    Commented Dec 21, 2020 at 15:11
  • $\begingroup$ That's a pretty good idea, or just defining a hue range to go into HSV. $\endgroup$ Commented Dec 21, 2020 at 20:50

1 Answer 1

7
$\begingroup$

As mentioned, if you can combine your color choices into one ramp, you can plug the Random output directly into that. To do this with this level of control, you need to do some math to convert the random output into a straight 0 or 1 over a given range. I've done this with a compare node.

enter image description here

The bottom compare node is everything in the range of .8 to 1.0, which, at the end of this group, is the same as the top color input (that top input is the 'default' case, or in other words "everything that's not caught by these other compare nodes"). That's why it's not connected to anything.

$\endgroup$
1
  • $\begingroup$ Works just I wanted, thanks! $\endgroup$
    – Michael
    Commented Dec 21, 2020 at 15:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .