Join EJ Hassenfratz for an in-depth discussion in this video Use 3D Linear Gradients in Cinema 4D, part of Motion Graphics Weekly.
- Welcome to another Motion Graphics Weekly where you up your mograph knowledge one week at a time. I'm EJ Hassenfratz. Let's get our learn on. Gradients are a big part of design trends these days. Just look at the new Instagram logo and other app logos that utilize gradients. In this video, I'm gonna show you how you can use 3D gradients in Cinema 4D to make some interesting abstract compositions and learn a little Xpresso in the process. So here's the scene I'm gonna be breaking down today.
Just a piece of cloth blowing in the wind and when I render this, you can see this is actually a pretty cool abstract composition. You can still make out the folds in the geometry with our 3D gradient. So let me just build this gradient from scratch. I'll just delete this texture and also delete this texture as well. And let's go ahead and create a brand new material. And let's make this a flat material, just a flat luminance material.
And you'll see what happens when I apply this material to my cloth surface, and render. You're gonna see that it's just totally flat. You don't even see those wrinkles or anything anymore. So let's actually apply a gradient now. So you can get and pull up a gradient by going into this menu, grabbing a gradient and let's just click this Gradient button and go into the gradient options. So already you can see that just adding a little bit of a black and white default gradient, you can see a lot of that cloth detail is coming back just with this simple gradient.
So we can actually change this from 2D - U, which is just left to right to 2D - V, and that'll actually go up and down as you can see in our preview window. And you can see even more detail on our cloth object here. This type of gradient application is by using the UVs of your object. So we actually want to use a gradient that is completely independent of the object's UV system, and we're just gonna use a gradient in 3D space.
So the gradient that we're gonna be using is this 3d gradient. Now you're gonna see what happens if I render this out. You're gonna see this applies the gradient pretty flat and it's just going from left to right as you can see in our preview here. Now the way the 3D gradient works and why it's 3D is that we can actually start and end our gradient in 3D space. So this Start and End actually represents the start position in X, Y, and Z, and then the end position in X, Y, and Z.
So you can see if I turn off Cycle, that'll actually unloop our gradient. So you can actually see where the black part of our gradient starts and where the white part starts as well. So it starts, and it starts with the black chip or the black color at negative 100 centimeters. So you can see that it starts right here and then it ends 100 centimeters in the positive X, which is right here. So, hopefully that makes sense.
We can actually zero this out and if we want this to be a vertical gradient, we can actually say alright let's have the start be 100 centimeters negative in the negative Y, and then end 100 centimeters positive Y. And you can see how that works right there. So let me actually, I can move my cloth up. And you can see how this changes as I manipulate this value. So now I'm actually starting this gradient way lower and I can actually have this end fairly high.
So we get this nice, smooth gradient. So basically I'm just controlling this in 3D space. So then I can add some positive X values, and you can see that now this is starting to be a little diagonal. So we can control this using the X, Y, and Z, but actually there's a better way to achieve this. And what we can do is actually create a couple of Nulls to control the start and end positions, cause again this is just the X, Y, Z and the end X, Y, Z. The one thing I wanna go over though is this space.
So right now it's actually using the object's space. We can actually use the world space and it will use world values, so it's not gonna be dependent on where that object is. So now let's go ahead and zero out all this stuff. So let's go and say let's have this gradient start at positive 200, and then we can go negative 300 or so, and you can see how that works. If we change this Space back to Texture, you can see that actually completely changes that.
So it's always dependent on the texture space. So let's just use the world space so it's a little bit more predictable. We're actually using the world values in our scene and not depending on any object setting. So let's setup an Xpresso rig to control our Start and End of our 3D - Linear gradient. Now that might sound daunting, but it's actually quite simple. What we're gonna use is a system called Set Driver Set Driven.
And what that means is that we use the most basic application of Xpresso that there is, and we use an object or an object's parameter to drive other parameters in our project. So let's just create a Null. And we're gonna make this Null be the start position of our gradient. And again, our Start here represents the start in the X, Y, and Z. So our start Null also has an X, Y, and Z.
So with all of the X, Y, and Z parameters selected, or X, Y, Z position parameters selected, I can right-click and go to XPressions and say Set Driver. I want these values of the position X, Y, and Z on this Null to drive another set of values. And that value is gonna be the Start position value. So the X, Y, and Z of the start of the gradient. So with this Start word selected, I can right-click on it, go back to Xpressions and go to Set Driven (Absolute).
And what that's gonna do... You can see we still have some values in here. When I right-click, go to Xpressions, Set Driven (Absolute), it's actually gonna zero out everything because it's going to match the exact same parameters in the X, Y, Z on our Null, so it just zeroed everything out. Now the cool thing is, is if I did this correctly... If I move this around, the Null is actually controlling where the start position of my 3D gradient is, which is really cool. And I can move this in Z space and you can see that that is adjusting the Z parameter here.
So really, really cool, you get more visual feedback than just adjusting these little values in the Start position here. So we're gonna the same thing with the End parameters on our 3D gradient. So let's go ahead and create another Null. This will be the end of our 3D gradient. And the same thing, we're gonna right-click on all these position coordinates here. And we'll right click, go to Xpressions, Set Driver. We're gonna use these values to drive the End parameters here.
And then with the End word selected, we're going to go to Xpressions, Set Driven (Absolute), and that'll zero everything out to match the zeroed out end position here. And then we can control the end of the gradient as well. So we got some visual helpers to control where this gradient is. So that's a lot better doing the controlling of the gradient here than trying to fuss around with all of these values here.
So we can just close this down if we want to, and just adjust using the Start and End. But what I wanna do is add some color to this gradient. So let's just go into interactive render region here. So we can see what this render is gonna look like. And I just wanna sample this color of the background here as our one chip. So we can actually have some of our object look like its fading into the background. And then what I'll do is get like a darker purple.
And then we can get a nice pink or magenta going on in here. And we can adjust these Gradient chips, of course. And I think what I wanna do is actually have this fade out at the bottom too. So I'll copy this chip and move this over so you can see that this is kinda fading away. And let me actually move my gradients here so you can see a little bit of that fade of our gradient.
So can you can see how this is way easier, it's way more predictable. You can actually adjust this visually in your project and get the exact type of 3D gradient positioning that you're going for. So by using a 3D gradient loaded in the luninance channel, we just created a really cool, abstract gradient composition inside of Cinema 4D. Don't wanna wait until the next week to learn something new? No problem. Here are other ways to feed your creative brain to keep you busy in the meantime.
You can check out my other courses in the library, visit my website eyedesyn.com for more tutorials, subscribe to my YouTube channel to be alerted when I post a new video, join my Facebook page for daily mograph inspiration, and keep up-to-date on all my latest mograph creations on Instagram. Thanks for watching and I'll see you here again next week.