Building the armor shaders in Cycles

The last thing to do, for this chapter, is to create the shaders for the Armor object, made up of metallic plates and leather tiers.

Getting ready

Continuing from the previously saved blend file:

  1. Enable the 6th and the 13th scene layer and select the Armor object in the Outliner.
  2. Put the mouse pointer in the 3D viewport and press the 0 key on the numpad to go into Camera view; fit the window into the field of view.
  3. Go to the Material window and press the + icon button to the right side to add four empty material slots to the armor. Select the first material slot and click on the New button in the Surface subpanel, and rename the material Armor_U0V0.
  4. Select the second material slot, click on the New button and rename the material as Armor_U1V0; repeat for the third slot and rename the material as Leather and repeat also for the fourth slot and rename the material Armor_rivets.
  5. Switch the Node Editor window temporarily with a UV/Image Editor window, then press Tab to go into Edit Mode; go to the UV Maps subpanel under the Object Data window to be sure you have the UVMap coordinates layer (the first one) as the active one, then enable the Keep UV and edit mode mesh selection in sync button on the UV/Image Editor toolbar.
  6. In the Node Editor window, box-select the UV islands of the U1V0 tile, then in the Material window, select the Armor_U1V0 material and click on the Assign button.
  7. Still in Edit Mode, select all the tiers vertices and then select the Leather material, click on the Assign button; repeat the operation by selecting all the rivets and assigning them to the Armor_rivets material.
  8. Disable the Keep UV and edit mode mesh selection in sync button on the UV/Image Editor toolbar, go out of Edit Mode and switch the UV/Image Editor window back to the Node Editor window.
  9. Put the mouse pointer inside the 3D viewport and press Shift + Z to start the Rendered preview.

How to do it…

We are first going to create the shader for the metal plates:

  1. In the Material window, select the Armor_U0V0 material slot.
  2. Go to the Node Editor window and switch the Diffuse BSDF shader node with a Mix Shader node; in the first Shader slot, select a Diffuse BSDF shader node and in the second one, select an Anisotropic BSDF shader.
  3. Go to the Node Editor window and set the Roughness of the Diffuse BSDF shader to 0.300 and the Anisotropy of the Anisotropic BSDF shader to 0.300.
  4. Add a Fresnel node (Shift + A | Input | Fresnel) and connect its output to the Fac input socket of the Mix Shader node; set the IOR to 100.000.
  5. Add a Tangent node (Shift + A | Input | Tangent) and connect its output to the Tangent input socket of the Anisotropic BSDF shader node; set the Tangent to Z.
    How to do it…

    Starting to build the metal shader for the armor

  6. Add a Frame (Shift + A | Layout | Frame) and parent the nodes, except the Material Output, to it, then label it as SHADERS.
  7. Add three Image Textures nodes (Shift + A | Texture | Image Texture) and a Voronoi Texture node (Shift + A | Texture | Voronoi Texture), then add two Attribute nodes (Shift + A | Input | Attribute) and a Texture Coordinate node (Shift + A | Input | Texture Coordinate).
  8. Label the Attribute nodes as Attribute_UV1 and Attribute_UV2. Label the Image Texture nodes as COL_iron, NORMALS_iron, and VCOL_iron.
  9. Connect the Vector output of the Attribute_UV1 node to the Vector input socket of the COL_iron node. Connect the Vector output of the Attribute_UV2 to the Vector input sockets of both the VCOL_iron and NORMALS_iron nodes. Connect the Object output of the Texture Coordinate node to the Vector input socket of the Voronoi Texture node.
  10. Click on the Open button of the VCOL_iron node, browse to the textures folder and load the image vcol2.png. Set the Color Space to Non-Color Data. Connect its Color output to the Roughness input socket of the Anisotropic BSDF shader node.
  11. Click on the Open button of the COL_iron node, browse to the textures folder and load the image iron_U0V0.png. Connect its Color output to the Color input sockets of the Diffuse BSDF and Anisotropic BSDF shader nodes.
  12. Click on the Open button of the NORMALS_iron node, browse to the textures folder and load the image norm2.png. Set the Color Space to Non-Color Data.
  13. Set the Scale of the Voronoi Texture to 15.000:
    How to do it…

    Adding the textures to the "Armor_U0V0" material

  14. Add a ColorRamp node (Shift + A | Converter | ColorRamp) and a Math node (Shift + A | Converter | Math). Paste the ColorRamp node right after the VCOL node, and the Math node right after the ColorRamp.
  15. Label the ColorRamp as ColorRamp_Vcol and set the Interpolation to B-Spline, then move the black color stop to position 0.245 and the white color stop to position 0.755.
  16. Label the Math node as Spec_soften and set the second Value to 0.100.
  17. Add a MixRGB node (Shift + A | Color | MixRGB) and label it as Difference_Col_iron; set the Blend Type to Difference and the Fac value to 0.300.
  18. Connect the Color output of the COL node to the Color1 input socket and the Color output of the ColorRamp_Vcol node to the Color2 input socket. Connect the Color output of the Difference_Col_iron node to the Color input sockets of the Diffuse BSDF and the Anisotropic BSDF shader nodes, replacing the old connections.
  19. Add a Normal Map node (Shift + A | Vector | Normal Map), a Bump node (Shift + A | Vector | Bump), and a Vector Math node (Shift + A | Converter | Vector Math).
  20. Connect the Color output of the NORMALS_iron node to the Color input socket of the Normal Map node; click on the empty slot (UV Map for tangent space maps) on this latter node to select the UVMap_norm item.
  21. Connect the Normal output of the Normal Map node to the first Vector input socket of the Vector Math node; label this latter as Average_Normals and set the Operation to Average, then connect its Vector output to the Normal input sockets of the Diffuse BSDF and Anisotropic BSDF shader nodes.
  22. Add a MixRGB node (Shift + A | Color | MixRGB), label it as Add_Bump, set the Blend Type to Add and the Fac value to 1.000. Connect the Color output of the COL node to the Color1 input socket of the Add_Bump node also, and the Color output of the Voronoi Texture node to the Color2 input socket.
  23. Connect the Color output of the Add_Bump node to the Height input socket of the Bump node, and the Normal output of this latter node to the second Vector input socket of the Average_Normals node. Set the Strength of the Bump node to 1.000.
  24. Add two Math nodes (Shift + A | Converter | Math), label them respectively as Bump_strength1 and Bump_strength2; set the Operation to Multiply for both, then paste the Bump_strength1 node between the COL_iron and the Add_Bump nodes and set the second Value to 0.020. Paste the Bump_strength2 node between the Voronoi_Texture and the Add_Bump nodes, and set the second Value to 0.010.
  25. Add frames to highlight the different components:
    How to do it…

    The completed "Armor_U0V0" material

    The first Armor shader is ready! Now it's very easy to obtain the others:

  26. Press A twice to select all the nodes, then press Ctrl + C to copy them.
  27. In the Material window, select the Armor_U1V0 material slot and in the Node Editor window, delete the default Diffuse and Material Output nodes; then press Ctrl + V to paste the nodes copied from the other material.
  28. Zoom to the COL node and click on the numbered button to the right side of the texture name slot to make it single user, then click on the folder icon button to browse to the texture folder and load the image iron_U1V0.png.
  29. Reselect the Armor_U0V0 material slot and repeat the step 26 and 27, this time pasting the nodes inside the Armor_rivets material slot:
    How to do it…

    The "Armor_rivets" material and the rendered completed armor

  30. Save the file.

How it works…

The construction of the metallic armor plates material follows basically the same scheme we used for the other materials:

  • First the shaders were produced, where the metallic look is mainly due to the Anisotropic BSDF shader mixed with the diffuse component with a quite high IOR value (metals can often have values from 20.000 to 200.000; we used a midway value of 100.000).
  • The shininess of the metallic surface has been modulated through the output of the vcol2.png image, a Dirty Vertex Color layer we had previously baked to an image.
  • The color of the Armor surface has been modulated as well through a Difference node with the same vcol2.png image.
  • The bump pattern works by first adding the Voronoi and the color map output and then averaging the result with the normal map output.

There's more…

The last material created for our character is a very simple leather material made mainly from the output of a Voronoi Texture node, contrasted, inverted, and used as bump pattern:

There's more…

The simple "Leather" material

This completes the creation of the Gidiosaurus shaders in Cycles:

There's more…

The completed Gidiosaurus character in Cycles

Of course, reflecting materials, for example, the metallic armor surface or the corneas (but to some extent also the reptile skin), need something to reflect to show them at their best; we'll see this in the last chapter of this cookbook.

In the next chapter, which is the penultimate chapter, we'll see the creation of the same materials in Blender Internal.

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

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