From the course: Blender: Tips, Tricks and Techniques

Random color nodes

- [Instructor] In this week's Blender Tips, Tricks, and Techniques, we're going to do something totally different, something totally random. We're going to make a random color generator. Let's figure it out! Now, first, I want you to go to cycles, render. Second, let's make something really interesting. So let's delete the cube, make a monkey, smooth the monkey, then hit T to hide that. Let's bring this out a little bit, modifier, subdivision, so we have a nice smooth monkey, drag this open a little bit, click on this and go to node editor, hit end to hide this little area, and you can click on new material, and if you don't see it, you can middle-mouse and drag the bar down here, or you can just drag this open and click on new material. We're going to add a few things. First, an object info node. Next, a color ramp node. We're going to add a hue and saturation, if we would like it. Now, I demonstrated this, sometimes when you hit A, it adds it between these two things. You can always hold down control, left click and drag to disconnect things, and then move it over. And then, finally, I'm going to add an emission. Okay, now if you haven't already, disconnect the diffuse, again, control, left-click, drag, just disconnect the diffuse and put it over here for now. Now, let's connect a few things. First, let's connect a random to factor, so just drag these little dots. Next, let's connect color to the color, hue, and saturation. Color to color. And then these top two green dots, emission in this case, to surface. Alright, now the next thing we need to do is add some colors, so let's zoom in, click this little triangle right here, and let's make this hot. Let's come over here, let's make this cool. And then, let's click the plus sign and add, like, a million more colors. Just drag them out a little bit. And you can really add whatever you'd like. I'll go with some pretty bright colors myself. There we go. That looks kind of fun. Now, if we come to our monkey, you'll see that it still looks white. Let's go to camera view by hitting zero on the numpad or going to camera, zoom in a little bit. Let's duplicate this monkey a few times. And then go into material mode, and whoa, look at that! Different color monkeys! In fact, every time you hit duplicate, you get a slightly different color, sometimes dramatically different color monkey. If you're feeling like your colors are a little bit too similar, you could always play with them a little bit. And in fact, that's the beauty of this node. Every time I duplicate it, I get another color monkey. So let's put this guy right about here. Now, let's go to world, click on world. Use nodes. Click on color, and let's make something kind of light and interesting. And now, render it. And hey, look at that! We now have a quilt of colorful bright monkeys. In fact, you don't necessarily need to use emission, I just wanted to do that so you could see the solid colors. We could cut this really quick, drag it into diffuse, and then render this. And just like before, you now have multiple color monkeys, this time on the diffuse shader, so it's got a little bit of a softness, a little bit of shadow to it. In fact, you can pipe in this random node into anything, so let's add a principle shader. Let's take the color and drag it to color. And let's take this random and pipe it into subsurface. Let's see what we get when we render this. Oh, wait a minute. Don't forget to connect BSDF to surface over here. There we go. And hit render. And hey, look at that. Now you have a bunch of jelly-ish, soft-ish looking monkeys. And that's the beauty of the random node. And mixed with a color ramp node, you can do some really really interesting things. You can even, if you want to, desaturate everything, or super-saturate them, change the values, hue, and saturation over here, you can change the colors, specifically here, and it's all generated randomly each and every time you create a new monkey. Like all things in Blender, you can do so much more with this node than we can cover in one short video. You're probably wondering why we spent so much time and effort making a random color node. Well, honestly, we've used this technique for background shots, for different-colored shirts and outfits, or to generate multiple variants of buildings. It's incredibly handy, and incredibly useful. I highly recommend you get in there and see how you can incorporate this trick into your future workflow.

Contents