Skip to Main Content

Tutorials + Resources

Cycles and Shader Nodes

Cycles and Shader Nodes

Charlie Pollock | Last Updated: Summer 2024

This tutorial will cover the Cycles render engine, and provide an introduction to editing materials with shader nodes.

Tutorial Contents

Cycles Rendering

If we want to improve the quality of our shading and rendering, we have to get a bit more in depth with the shader and rendering systems. We'll start by switching our render engine.

What's a render engine? Essentially, a render engine is the code that calculates lighting and shadows in our 3D scenes. The default render engine in Blender is called EEVEE, and it renders like a video game- fast, but missing some features to make it look completely realistic. One of the biggest things EEVEE is missing is the ability to calculate accurate reflections on objects. 

The other main render engine in Blender is called Cycles. Cycles renders in a much more computationally expensive way, through ray tracing- essentially, calculating bounces of light to accurately simulate all aspects of lighting. This gives more realistic shadows, proper reflections, and many other things. The big downside of this, however, is that it takes a lot of computing power and will render far slower.

Above: Switching between EEVEE and Cycles shows Cycles rendering slower - with a more complicated scene, this difference would be much bigger.

Lower left: EEVEE with a completely reflective surface. Lower right: Cycles with the same shot.

Switching to Cycles is done by switching to the Render tab in the same menu as where material settings are located. The Render tab is at the top of the window, with a camera icon on it. In that tab, the option at the top of the menu will be labeled Render Engine. Open the dropdown and select Cycles. The other render engines in there are called Workbench and Hydra Storm, and these are intended for more specialized uses - Workbench is for making solid renders of scenes, to show off geometry, and Hydra Storm is for previewing imported scenes. Neither is really useful for our purposes, so don't worry about them.

Cycles is incredibly hardware-intensive to use, so I'll quickly cover some things we can do to make it render faster. 

In the render settings window, there is a section labeled "Sampling" that controls how many light rays Cycles tries to calculate per pixel. More samples means higher quality renders, but also means longer renders. You can lower the sample count all the way down to 1 if you want, but somewhere between 64 and 128 samples is usually plenty good for a render. The boxes you'll want to change are both labeled "Max Samples." There are separate options for Viewport and Render, because it can be helpful to see a lower quality render in the viewport to improve responsiveness, but still have the high quality render as the final output.

The biggest performance boost you can get is by enabling a dedicated graphics card, if you have one. If you're using a gaming computer for Blender, you probably have a graphics card. You can enable this by going to the top left of the screen and selecting Edit > Preferences and then going to System, selecting CUDA at the top of the menu, and selecting your graphics card. Then, close the preferences menu and go to the render settings window, and change the dropdown labeled "CPU" to "GPU Compute."

Shader Nodes

Now, let's start looking at how to make a more complicated material. The way we make custom materials in Blender is through what is called the Shader Node system. Nodes are connected together to control settings in other nodes, so for example, you can use a texture to control a roughness setting.

An example of some nodes in a material.

To start working with nodes, let's start a new project and switch workspaces. Go to File>New>General to make a new project, which will start out the default scene. The tabs at the top of the screen are labeled "Layout," "Modeling," "Sculpting," and so on. The one we want is labeled "Shading." Once you click on that, you should see a whole new window arrangement. The 3D viewport is now in the middle on the top, and there is a new window in the middle on the bottom with nodes in it. This is the Shader Editor.

To make it easier to see what we are working on, we can resize windows in Blender. In fact, the whole UI can be edited to our liking. Just click on the edge of any window and drag it around. We can make the Shader Editor window bigger and make the side windows smaller, so we have more room to see the shader nodes.

Now, we can see the first nodes that any material starts out with. The Principled BSDF and Material Output nodes are default because they represent a good starting point for making a material.

The Output node is the end of the node tree, where you plug in the final shader result to be displayed on the object. It's required for any material, hence why it's default.

The Principled BSDF node is a very general-purpose shader node, which can be adapted to replicate almost any material. This will be the basis of our material we'll make later. 

Nodes come in quite a few categories depending on their function. The categories are all listed in the add menu, and the most commonly used nodes are spread out through the first seven categories. We'll go through a few useful nodes when we make a material later on. 

The Shader node category holds the nodes that determine how a material reacts to light. The Principled BSDF node has the most options to replicate materials, but the other options have more specialized functions and can be useful as well. For example, the Glass BSDF node is well suited to replicating transparent materials like glass and water. The Glossy BSDF node is better for reflective materials, and the Emission node is for materials that are exclusively outputting light - like the sun. 

Upper Left: The scene we are demonstrating materials with. Upper Right: The Glass BSDF in the scene.

Lower Left: The Glossy BSDF in the scene. Lower Right: The Emission BSDF in the scene.

If you're wondering what BSDF stands for and why it isn't appended to the name of every node, it stands for Bidirectional Scattering Distribution Function and essentially just means that a material is reacting to light. The reason the Emission node doesn't have it, then, is because a pure emission surface is only outputting light, and can't be affected by other light sources. Think about what happens if you try and shine a flashlight at a light bulb - the area around the bulb might get brighter, but the bulb itself won't be affected.

On the left: An emissive tube in front of a textured wall. On the right: The same scene with a spotlight shining on top. Notice the brightness of the tube remains the same.

Connecting Nodes

Let's try putting some nodes together. To add nodes in the Shader Editor, go to the top of that window and click on "Add," same as you would in the 3D viewport. You can also use the same keyboard command, Shift+A, to add nodes. You'll see a menu with the different node categories listed appear, and if you mouse over the categories you can see what nodes are available in each. You can also start typing on the keyboard while the menu is open to search for a specific node.

Let's add a Noise Texture node from the Texture category. This generates a random-looking pattern that resembles colorful clouds across a surface, which can be modified to resemble lots of different real materials. After adding the node by clicking on it in the add menu, it will follow your mouse until you click again to confirm its position in the workspace. 

To see this node in action, we can plug it into the Material Output node. Click on the yellow circle on the right side of the Noise Texture node labeled "Color," and drag to create a link. Don't release the mouse button until you've placed the end of the link over the green circle labeled "Surface" on the Material Output node, where the Principled BSDF node is already plugged in. The link should connect to the Material Output, replacing the Principled BSDF, and the surface of the cube visible in the 3D viewport will change to the colorful clouds mentioned earlier. Also, noise textures generate their own UV coordinates, so don't worry about the texture mapping here.

Now, the noise texture is showing up on the object, but it doesn't have any shading - the environmental light has no effect on the cube. Make sure you've switched to rendered view in the 3D viewport so you can see the lighting. To make this look like a real object, we should apply shading to the texture. Like before, to plug the output of one socket into the input of another, just drag from the right side of a node (where all the outputs are) to the left side of another node (where all the inputs are.) Connect the Color output of the noise texture to the Base Color input of the Principled BSDF. Then, connect the output of the Principled BSDF to the Surface input of the Material Output. 

Making a Rusty Metal Material

Let's make a rusty metal material. This will introduce a few new concepts and get you familiar with connecting and adjusting nodes. This material is also a useful one to have around, as lots of scenes can use rusty metal to add detail. 

To make a material look rusty, we need to mix together two different aspects of metal: the shiny, metallic part, and the orangey rusted part.

The way we'll accomplish this is by mixing the color of the metal with a rust color using a noise texture, as well as using the noise texture to control the metallic slider. We'll go over this in more detail soon.

Let's start by making the metal material. The Principled BSDF node has a "Metallic" slider at the top, which we will be using. This controls how much the material will reflect the things around it. It isn't limited to uses in metal materials either, you can use it to make materials like glass look more reflective. Set the Metallic slider to 1, and look at how the material suddenly looks much more like, well, a metal. You may need to rotate it around to see the sheen from the light.

To give this a more detailed look, we can use the noise texture to make the metal look more varied. Right now, it's coloring the metal, but most metals look more like various shades of gray. The noise texture has a second output labeled "Fac," short for Factor, which looks like a black-and-white version of the colorful clouds we've seen before. Try previewing this by connecting it to the Material Output's Surface socket. Then, connect it into the color of the Principled BSDF and connect the Principled BSDF back up to the material output.

The material already looks more like a speckled metal, but we can limit what range of gray we have - right now, the noise texture is going completely from white to black, and it would be nice to have a little less range there. We're going to add a new node, which comes in useful all the time. Open the add menu, go to the Converter category and select Color Ramp. When you are adding a new node, if you click to place it while hovering over a node connection, it will add the node in between those two connected ones. Add the Color Ramp in between the Noise Texture and the Principled BSDF.

The Color Ramp node takes an input with a range of colors, and remaps them based on how bright the colors are to a new range of colors. This range is determined by the gradient shown on the node. At each end of the gradient is a color selector, which you can click to select. With one selected, you can then click on the color window at the bottom of the node to change the color at that point in the gradient. The color selectors can also be dragged around on the gradient, to change the range. Additionally, you can add more color selectors by clicking the plus sign on the left above the gradient.

We want the color of the metal to be a range of grays, to give it some realism. Set one of the color selectors on one end to a darker gray, and one on the other end to a lighter gray. You can mix in a bit of yellow to make it look older and grosser, or a bit of blue to make it look newer. 

Another thing we can do to make the metal look more realistic is by adding variations in the roughness. Just like we can connect nodes into the base color socket, we can connect nodes into the roughness socket. We can even use textures to control the roughness. The brightness value of the texture is used to determine the value of the slider, where a completely black color corresponds to 0 and completely white corresponds to 1. You can see the brightness of an image by plugging it into a color ramp. 

You'll notice in this example, that since the image texture I'm using is mostly dark, the cube ends up being mostly reflective. We can adjust this by changing the colors in the color ramp again, so that the texture has mostly gray in it. This will make the metal look less polished and more like it's been in some weather. I'll go ahead and plug the noise texture into this as well, so I'm not using that chair render still.

Now that the metal part of this material is ready, let's start on the rust part. We're going to be mixing the color of rust in with the metal color using another noise texture, as well as using the noise texture to control the metallic slider. Rust is almost completely nonreflective, so we'll be making the material rough and nonmetallic in the rusty parts. 

Add another noise texture. We're going to change the settings this time to make the pattern different from the other one. The Scale slider will make the texture bigger or smaller, the Detail slider will add more fine detail, and the Roughness slider will change how small the detail looks. The other sliders won't be used here, but you can mess around with them to figure out what they do - Lacunarity is very hard to explain, and Distortion is self-evident. 

For the noise texture that will control the rust, we want it to have more detail and roughness, and have larger spots of rust. I set the scale to around 3, the detail to 6, and the roughness around .65. I also added a color ramp to the noise texture, and moved the sliders closer together to make the contrast higher. Seeing this, it already looks like rust splotches without the color. I also went and turned up the detail on the other noise texture.

Now, we're going to introduce a new node: the Mix Color node. This takes two color inputs and then uses the factor to blend between them. We are going to use the noise texture we just added as the blend factor, and use the metal color as one of the color inputs.

Add a Mix Color and connect the output into your principled BSDF. Then, connect the metal color into the top color input, and connect the new noise texture into the factor. Set the bottom color input to a rusty color, and you should see it appearing on the material.

I'm also rearranging the nodes a bit while doing this, to make things easier to understand.

Now, we'll connect the color ramp controlling the rust into the metallic slider. This should make the rust part completely nonreflective, but it's reversed-  which makes sense if you think about it, as the white part of the texture (corresponding to 1) is also driving where the rust is. We can fix this pretty quickly, though, with another new node: the Invert Color node, located under the Color section of the add node menu. This node will flip the black and white of the noise texture, and fix the metallic slider.

Let's give the rust color a bit of variation. We're going to connect the noise texture that controls where the rust is into another color ramp, and connect that into the socket with the rust color. This way, we can make the rust darker the closer to the center of a patch it is. 

Last thing, we'll use the rust noise texture to control the roughness value. We're going to use another mix color node, but we'll change the settings on it. Duplicate the mix color node or add a new one, and put it into the roughness slider. The node that was controlling the roughness should go into the top slider. Now, we're going to change the settings on the mix color node. The dropdown that says "Mix" has a bunch of color blending modes, but the one we're going to use is labeled "Add."

Instead of blending between the two color inputs, this mode adds the value of the second input to the first one. Remember that black has a value of 0, and white has a value of 1. When you add the value controlling the rust to the roughness, the areas that are rusty (and have a value of 1) will be rough as well. The slider on the mix node will control how much is added, so you can change how much of the rust is rough.

Connect the rust color ramp into the second color input and then adjust the factor slider until it looks good.

With the rust finished, the material is basically done! You can apply this material to any object by just selecting it in the material tab. 

For the example here, I added a monkey from the add mesh menu. This is an object included alongside the other basic objects because the geometric complexity of the model is good for showing how materials look.

Before finishing, let's look at this material in a more interesting rendered scene. I've set up a simple scene with colored walls and lights, so that the metal can reflect the surrounding area.

This is a pretty quick scene to make, I just added 4 planes and gave them colored materials, and then added lights around the scene. 

With that done, we're done with this tutorial! I highly recommend you go look on Youtube for more tutorials on modeling and shading in Blender. Thanks to Blender being free, there's about a million tutorials for anything you could possibly want to do available online.