Creating a rusty metal material with procedurals

In this recipe, we will create a rusty shader that will be mixed with the metal shader by a stencil factor, as shown in the following screenshot:

Creating a rusty metal material with procedurals

The rusty metal material as it appears in the final rendering

Getting ready...

Start Blender and load the 9931OS_Suzanne_vcol.blend file. Then perform the following steps:

  1. Go to the World window. Click on the dotted little box to the right of the Color slot under the Surface subpanel. In the pop-up menu, select the Environment Texture item.
  2. Click on the Open button and browse to the textures folder to load the Barce_Rooftop_C_3K.hdr image.
  3. Set the Strength value to 0.200. Then go back to the Material window.

How to do it...

Now we are going to create the shader by performing the following steps:

  1. Click on the File item in the upper main header. Select the Link item. If necessary, browse to the folder where you stored all the blend files. Select the 9931OS_04_metal_group.blend file. From there, click on the NodeTree entry and then select the Metal item. Click on the Link/Append from Library button to link the node group.
  2. Click on New in the Material window under the Properties panel or in the Node Editor toolbar. Rename the material Rusty_metal.
  3. In the Material window, switch the Diffuse BSDF shader with a Mix Shader node, and in the first Shader slot, select a Diffuse BSDF shader. In the second Shader slot, under Group in the pop-up menu, load the linked Metal node group, as shown in the following screenshot:
    How to do it...

    The Properties pop-up menu used to select different nodes

  4. Add Frame (press Shift + A and navigate to Layout | Frame). Select the Diffuse BSDF shader, the Metal node group, the Mix Shader node, and then the Frame. Press Ctrl + P to parent them. In the Properties panel of the Node Editor window (press the N key to make it appear), label the Frame as SHADERS.
  5. In the Metal group, set the IOR value to 1.370. Change the Color values for R to 0.229, G to 0.307, and B to 0.299. Set the Roughness value to 0.200, Aniso_Amount to 0.200, and Anisotropy to 0.600.
  6. Add a Texture Coordinate node (press Shift + A and navigate to Input | Texture Coordinate) and two Mapping nodes (press Shift + A and navigate to Vector | Mapping). Connect the Object output of the Texture Coordinate node to the Vector input of both the Mapping nodes. Label them as Mapping1 and Mapping2.
  7. Now add a Musgrave Texture node (press Shift + A and navigate to Texture | Musgrave Texture) and label it as Musgrave Texture1. Add a Noise Texture node (press Shift + A and navigate to Texture | Noise Texture), label it as Noise Texture1, and add a ColorRamp node (press Shift + A and navigate to Converter | ColorRamp). Label this node as ColorRamp1.
  8. Set the Musgrave Texture node's Scale value to 6.000 and Detail to 1.300. Press Shift + D to duplicate it, and label the duplicate as Musgrave Texture2. Set the Noise Texture node's Scale value to 7.800, Detail to 8.000, and Distortion to 2.000.
  9. Connect the Vector output of the Mapping1 node to the Vector input sockets of the Musgrave Texture1 and Noise Texture1 nodes. Then connect the Vector output of the Mapping2 node to the Vector input sockets of the Musgrave Texture2 node. In the Mapping2 node, set the Location value to 0.100 and Scale to 0.600 for the three axes. Then change the Rotation value of X to 7 and Y to -5.
  10. Connect the Fac output of the Noise Texture node to the Fac input of the ColorRamp1 node. Set its Interpolation to Ease. Move the black color stop to the 0.321 position and the white color stop to the 0.600 position.
  11. Add a MixRGB node (press Shift + A and navigate to Color | MixRGB). Set the Fac value to 1.000 and Blend Type to Add. Then connect the color output of the Musgrave Texture1 node to the Color1 input socket and the Color output of the Musgrave Texture2 node to the Color2 input socket of the Add-MixRGB node.
  12. Press Shift + D to duplicate the Add-MixRGB node. Set Blend Type to Divide and the Fac value to 0.309. Connect the Fac output of the Noise Texture1 node to the Color1 input socket and the output of the Add-MixRGB node to the Color2 input socket of the Divide-MixRGB node.
  13. Connect the output of the Divide-MixRGB node to the Fac input socket of the ColorRamp1 node. Press Shift + D to duplicate the Divide-MixRGB node, and change the Blend Type to Multiply. Set the Fac value to 1.000 and connect the output of the ColorRamp1 node to the Color1 input socket.
  14. Add an Attribute node (press Shift + A and navigate to Input | Attribute) and connect its Color output to the Color2 input socket of the Multiply-MixRGB node. In its Name slot, write the name of the Vertex Color layer, (Col_vp).
  15. Add Frame (press Shift + A and navigate to Layout | Frame). Select the Musgrave Texture node, the Noise Texture node, the ColorRamp1 node, the three MixRGB nodes, the Attribute node, and then the Frame. Press Ctrl + P to parent them. Label the frame as STENCIL.
  16. Connect the output of the Multiply-MixRGB node under the STENCIL frame to the Fac input socket of the Mix Shader node under the SHADERS frame, as shown in the following screenshot:
    How to do it...

    The first two frames of the material, SHADERS and STENCIL

  17. Add two Voronoi Texture nodes (press Shift + A, navigate to Texture | Voronoi Texture, and label them as Voronoi Texture1 and Voronoi Texture2) and a Wave Texture node (press Shift + A and navigate to Texture | Wave Texture). In the Voronoi Texture1 node, set the Coloring to Cells and the Scale value to 20.000. In the Voronoi Texture2 node, set the Scale value to 19.000. Set the Wave Texture node's Scale value to 1.000.
  18. Connect the Vector output of the Mapping1 node to the Vector input sockets of these three new texture nodes.
  19. Add a MixRGB node (press Shift + A and navigate to Color | MixRGB), set the Blend Type to Difference, and label it as Difference1. Set the Fac value to 1.000. Then connect the Voronoi Texture1 node's Color output to the Color1 input socket and the second Voronoi Texture2 node's Color output to the Color2 input socket.
  20. Press Shift + D to duplicate the Difference1 node, and label the duplicate as Difference2. Connect the Color output of the Difference1 node to the Color1 input socket of the Difference2 node. Then connect the Color output of the Wave Texture node to the Color2 input socket.
  21. Add two ColorRamp nodes (press Shift + A and navigate to Converter | ColorRamp), label them as ColorRamp2 and ColorRamp3, and connect the output of the Difference2 node to their Fac input socket. Set the ColorRamp2 node's Interpolation to Ease and move the black color stop to the 0.486 position. Set the ColorRamp3 node's Interpolation to B-Spline and move the black color stop to the 0.304 position.
  22. Press Shift + D to duplicate the Difference2 node, and label the duplicate as Difference3. Place it after the ColorRamp2 node and ColorRamp3 nodes. Connect the ColorRamp2 node's Color output to the Color1 input socket and the ColorRamp3 node's Color output to the Color2 input socket of the Difference3 node.
  23. Add Frame (press Shift + A and navigate to Layout | Frame). Select these lastly added nodes and then the Frame. Press Ctrl + P to parent them. Rename the frame RUST_BUMP.
  24. Select the SHADERS frame and add a Bump node (press Shift + A and navigate to Vector | Bump). Connect the Difference3 node's output to the Height input socket of the Bump node. Connect the Normal output of this node to the Normal input socket of the Diffuse BSDF node inside the SHADERS frame, as shown in the following screenshot:
    How to do it...

    The frame for the bump of the rust

  25. Select the STENCIL frame and add a MixRGB node (press Shift + A and navigate to Color | MixRGB) and a Bright/Contrast node (press Shift + A and navigate to Color | Bright Contrast). Paste the MixRGB node right after the Multiply-MixRGB node. Set Blend Type to Difference and then connect the output of the Difference3 node inside the RUST_BUMP frame to the Color2 input socket. Paste the Bright/Contrast node right after this last Difference node. Set the Bright value to 0.500 and the Contrast value to 1.000, as shown in the following screenshot:
    How to do it...

    The RUST_BUMP output added to the stencil to separate the metal surface from the rusty surface

  26. Add an RGB Curves node (press Shift + A and navigate to Color | RGB Curves), two ColorRamp nodes (press Shift + A, navigate to Converter | ColorRamp, and label them as ColorRamp4 and ColorRamp5), a Noise Texture node (press Shift + A, navigate to Texture | Noise Texture, and label it as Noise Texture2), and a MixRGB node (press Shift + A and navigate to Color | MixRGB).
  27. In the RGB Curves node's interface, click on the diagonal line to add a control point. In the X and Y slots at the bottom, set the values to 0.50000 and 0.26000, respectively. Click again to add a new control point, and set X to 0.51000 and Y to 0.75000.
  28. Connect the Color output of the RGB Curves node to the Fac input of the ColorRamp5 node.
  29. Go to the ColorRamp4 node. Select the black color stop and change the color values of R to 0.991, G to 0.591, and B to 0.084. Select the white color stop and change the color values of R to 0.105, G to 0.013, and B to 0.010.
  30. Click four times on the + icon on the ColorRamp4 node interface to add four new color stops. Select 4 as the index number and move it to the 0.889 position. Change the color values of R to 0.930, G to 0.456, and B to 0.105. For index 3, set Pos to 0.754, R to 0.624, G to 0.250, and B to 0.053. For index 2, set Pos to 0.521, R to 0.418, G to 0.159, and B to 0.068. Finally, for index 1, set Pos to 0.286, R to 0.246, G to 0.098, and B to 0.034.
  31. With the mouse arrow inside the colorband on the ColorRamp4 node, press Ctrl + C to copy it. Move the mouse arrow to the colorband of the ColorRamp5 node. Press Ctrl + V to paste the colors and the stops. Set the ColorRamp5 node's Interpolation to Constant.
  32. Connect the Color output of both the ColorRamp4 and ColorRamp5 nodes to the Color1 and Color2 input sockets of the MixRGB node, respectively. Set the MixRGB node's Blend Type to Dodge and the Fac value to 1.000.
  33. Press Shift + D to duplicate the Dodge-MixRGB node, set the Blend Type to Multiply, and label it as Multiply2. Lower the Fac value to 0.500. Connect the Dodge-MixRGB node's output to the Color1 input of the Multiply2 node and the Color output of the Noise Texture2 node to the Color2 input.
  34. Set the Noise Texture2 node's Scale value to 16.000, Detail to 2.500, and Distortion to 1.000. Connect the Object output of the Mapping1 node to the Vector input of the Noise Texture2 node.
  35. Add a Hue Saturation Value node (press Shift + A and navigate to Color | Hue Saturation Value). Place it right after the Multiply2 node. Connect the Multiply2 output to the Color input socket of the Hue Saturation Value node. Then set the Hue value to 0.465 and the Saturation value to 1.050.
  36. Press Shift + D to duplicate the Multiply2 node, and place the duplicate close to the Noise Texture2 node. Set the Blend Type to Overlay and the Fac value to 0.250. Connect the Fac output of the Noise Texture2 node to the Color1 input socket of the Overlay-MixRGB node, and change Color2 to pure white. Connect the Overlay-MixRGB node's output to the Value input socket of the Hue Saturation Value node.
  37. Add Frame (press Shift + A and navigate to Layout | Frame). Select these recently added nodes and then the Frame. Press Ctrl + P to parent them. Rename the frame RUST_COLOR.
  38. Connect the output of the Hue Saturation Value node inside the RUST_COLOR frame to the Color input socket of the Diffuse BSDF shader node inside the SHADERS frame. Then connect the Color output of the Divide node inside the STENCIL frame to the Color input of the RGB Curves node inside the RUST_COLOR frame, as shown in the following screenshot:
    How to do it...

    The color of the rusty surface added to the network

  39. Save the file as Metal_rusty.blend.

How it works...

From step 2 to step 4, we built the basic shader arrangement. From step 6 to step 15, we made the STENCIL frame to separate the rust material from the polished metal.

From step 17 to step 23, we built the bump effect for the rust, and from step 26 to step 37, we added the rust color.

There's more...

We used the Dirty Vertex Colors layer named Col_vp again, this time to give a denser pattern to certain areas of Suzanne compared to other areas. Remember that a Vertex Colors layer can be modified and improved by manual vertex painting on the mesh in Vertex Paint mode. We can also use a gray-scale image map, painted in GIMP or in Blender itself and then UV-mapped on the mesh to obtain more precise and localized effects.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.130.185