Creating a multipurpose metal node group

All the metal materials you can see in the following screenshot (pewter, gold, silver, chromium, and aluminum) were obtained from a single shader node group linked and applied to each Suzanne with different interface settings.

To take a look at the scene, open the 9931OS_04_metals.blend file. In this recipe, we will build the generic Metal node group shader. You can find it in the 9931OS_04_metal_group.blend file, as shown in the following screenshot:

Creating a multipurpose metal node group

Some examples of different metal materials created by the same node group

Getting ready...

Start Blender and load the 9931OS_Suzanne_start.blend file.

How to do it...

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

  1. Click on New in the Material window under the Properties panel or in the Node Editor toolbar.
  2. In the Material window, switch the Diffuse BSDF shader with a Mix Shader node, and in the first Shader slot, select a Glossy BSDF shader. In the second Shader slot, select an Anisotropic BSDF node.
  3. Press Shift + D to duplicate the Mix Shader node, and paste it just after the first Mix Shader node. Add a Diffuse BSDF shader (press Shift + A and navigate to Shader | Diffuse BSDF) and connect it to the second Shader input of the second Mix Shader node, as shown in the following screenshot:
    How to do it...

    The basic metal shader network

  4. Add a Fresnel node (press Shift + A and navigate to Input | Fresnel) and connect it to the Fac input of the second Mix Shader node.
  5. Add a Bright Contrast node (press Shift + A and navigate to Color | Bright Contrast). Connect its Color output to the Color input sockets of the Glossy BSDF and Anisotropic BSDF shader nodes.
  6. Add a Bump node (press Shift + A and navigate to Vector | Bump). Connect its Normal output to the Normal input sockets of the Fresnel, Diffuse BSDF, Glossy BSDF, and Anisotropic BSDF shader nodes.
  7. Select all the nodes except the Material Output node, and press Ctrl + G to create a group, as shown in the following screenshot:
    How to do it...

    The nodes inside the node group

Now we must expose all the values necessary to tweak the node group for the different types of metal:

  1. Click and drag the IOR input socket of the Fresnel node into the empty socket of the Group Input node.
  2. Repeat step 1 with the Color input socket of the Diffuse BSDF shader node. Then drag the Color socket of the Bright/Contrast node and connect it to the same Color socket on the Group Input node, as shown in this screenshot:
    How to do it...

    Creating the exposed sockets

  3. Add a Math node (press Shift + A and navigate to Converter | Math). Set Operation to Subtract and first Value to 1.000. Drag its second Value input socket to the Group Input node, label the new socket as Coated, and then connect the Value output to the Bright input socket of the Bright/Contrast node. In the Interface subpanel under the Properties panel, set the Max value for the Coated socket to 1.200, as shown in the following screenshot:
    How to do it...

    The setting of the Min and Max values through to the Interface subpanel

  4. Drag the Roughness input socket of the Glossy BSDF shader. Then drag the Roughness socket of the Anisotropic BSDF shader and connect it to the same socket on the Group Input node.
  5. Click and drag the Fac socket of the first Mix Shader node into a new, empty socket. Rename it Aniso_Amount. Click and drag the Anisotropy socket of the Anisotropic BSDF shader node into a new, empty socket. Repeat this step for the Rotation input socket.
  6. Now click and drag the Height socket of the Bump node into a new, empty socket. Rename it Bump. Repeat this step for the Distance and the Strength sockets, and rename the sockets Bump_Distance and Bump_Strength, respectively.
  7. Also repeat for the Normal socket of the Bump node.
  8. Finally, click and drag the Tangent input socket of the Anisotropic BSDF shader.
  9. Use the arrows in the top-right corner of the Interface subpanel to order the sockets in the Group Input node (the same order should be used for the Group Output node), as shown in the following screenshot:
    How to do it...

    The final layout of the completed node group in Edit Mode

  10. Exit Edit Mode by pressing Tab. Rename the group Metal. Although this is not "strictly necessary here, you can also click on the F icon on the interface to activate the fake user for the node group.
  11. Save the file as Metal_group.blend.

How it works...

The effect of this node group is mainly based on the IOR value (the refractive index of a material is a number that describes how light propagates through that material or gets reflected on its surface). This value can be quite different for each kind of metal. In the node, the exposed IOR value drives the amount of blending of the Diffuse component with the Mirror component made by the Glossy BSDF and Anisotropic BSDF shader nodes combined, but that can also be mutually blended accordingly to the Aniso_Amount value.

The Anisotropy and Rotation values of the Anisotropic BSDF shader are exposed as well. and the same for the Tangent input if a particular mapping option must be used (for example, a layer of UV coordinates).

Textures must be connected to the Bump input socket on the Bump node. The Bump_Strength socket establishes the amount of bump influence. The Bump_Distance socket is a multiplier for the strength of influence. The Bump node output is piped to all the Normal input of the Fresnel, Diffuse BSDF, Glossy BSDF, and Anisotropic BSDF nodes to keep a consistent effect among all the components. Similarly, both the Glossy BSDF and Anisotropic BSDF nodes' Roughness values are driven by a single-interface input.

Finally, let's discuss the color of the metal. The color that arrives at the Diffuse BSDF shader by passing through the Bright/Contrast node gets modified by a Coated value larger than 0.000. The result is a different input for the mirror component. The Subtract-Math node simply inverts the effect of the numeric input of the Coated socket.

Besides the links provided at the end of the previous chapter, for a list of IORs, you can take a look at these links:

Note

Note that for some materials (especially metals), different lists report different IOR values.

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

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