In this recipe we will create a leather-like material:
Getting ready
Start Blender and load the file 1301OS_06_start.blend, where there is an already unwrapped Suzanne mesh.
How to do it...
Now we are going to create the material:
Click on New in the Material window under the Properties panel or in the Node Editor header; rename the new material Leather_dark.
In the Material window switch the Diffuse BSDF node with a Mix Shader node; in the first Shader slot select again a Mix Shader node and in the second one an Anisotropic BSDF shader node.
Add a Fresnel node (Shift + A | Input | Fresnel) and connect it to the Fac input sockets of both the Mix Shader nodes. Set the IOR value to 1.490.
Set the Anisotropic BSDF node's color to a pure white and the Roughness value to 0.100. Add a Tangent node (Shift + A | Input | Tangent), connect it to the Tangent input of the Anisotropic shader, and in its Method to use for the tangent slot select UVMap. Optionally, click on the blank slot at the right to select the name of the UV layer to be used (useful if the mesh has more than one UV layer).
Add a Diffuse BSDF shader (Shift + A | Shader | Diffuse BSDF) and a Glossy BSDF shader (Shift + A | Shader | Glossy BSDF); connect the Diffuse to the first Shader input socket of the second Mix Shader node and the Glossy to the second one. Set the Diffuse Roughness to 0.800, the Glossy color to pure white, and its Roughness to 0.300.
Add two RGB nodes (Shift + A | Input | RGB) and a Mix node (Shift + A | Color | Mix); connect the two RGB nodes to the Color1 and Color2 input sockets of the Mix node and then connect its Color output to the Color input socket of the Diffuse node.
Change the color of the first RGB node to R 0.156, G 0.113, B 0.086 and the color of the second RGB node to R 0.042, G 0.049, B 0.029.
Add a Texture Coordinate node (Shift + A | Input | Texture Coordinate) and two Mapping nodes (Shift + A | Vector | Mapping). Connect the Object output of the Texture Coordinate node to the Vector input sockets of both the Mapping nodes, then in the second Mapping node change the RotationY value to 90°.
Add two Voronoi Texture nodes (Shift + A | Texture | Voronoi Texture) and two Wave Texture nodes (Shift + A | Texture | Wave Texture); place them in a column to the side of the Mapping nodes like this: from the top, first the Voronoi Texture, below it the Wave Texture, below that again the second Voronoi Texture, and lastly the second Wave Texture.
Set the first Voronoi Texture node Coloring to Cells and the Scale to 60.000; go to the first Wave Texture and set the Scale to 10.000, Distortion to 10.000, Detail to 16.000, and Detail Scale to 0.300. Set the Scale of the second Voronoi Texture node to 10.000 and copy the exact same values from the first Wave Texture to the second one.
Now connect the first Mapping node output to the Vector input sockets of the two Voronoi Texture nodes and of the first Wave Texture nodes; connect the output of the second Mapping node to the Vector input socket of the second Wave Texture node.
Add a Mix node (Shift + A | Color | Mix), set the Blend Type to Difference and the Fac value to 1.000; connect the Color output of the first Wave Texture to the Color2 input socket of the Difference node and the Color output of the second Voronoi Texture to its Color1 input socket.
Press Shift + D to duplicate the Difference node and connect the Color output of the second Voronoi Texture node also to its Color2 input socket; connect the Color output of the second Wave Texture to the Color1 input socket of this second Difference node.
Press Shift + D to duplicate again a Difference node, change its Blend Type to Multiply, and connect the output of the first Difference node to the Color1 input socket and the output of the second Difference node to the Color2 input socket.
Add a Math node (Shift + A | Convertor | Math) and connect the output of the Multiply node to the second Value input socket; connect the Color output of the first Voronoi Texture node to the first Value input socket.
Add two Bump nodes (Shift + A | Vector | Bump); connect the first one to the Normal input socket of both the Diffuse and Glossy shader nodes, the second to the Normal input of the Anisotropic shader. Set the Strength of the first Bump node to 0.050 and the Strength of the second one to 0.025. Connect the output of the Add node to the Height input sockets of both the Bump nodes.
Add a ColorRamp node (Shift + A | Convertor | ColorRamp) and paste it between the first Difference node and the Multiply node; set the Interpolation to B-Spline and move the white color marker 3/4 to the left. Press Shift + D to duplicate and paste it between the second Difference node and the Multiply node too.
Add a Math node (Shift + A | Convertor | Math) and paste it between the first Voronoi Texture node and the Add node; set the operation to Multiply and the second value to -0.200.
Press Shift + D to duplicate the Multiply math node and paste it between the multiply Mix node and the Add node; set its second value to 0.100.
How it works...
From step 1 to step 7 we built the basic shader for the leather material; obviously there is not strictly the need to mix two different colors via RGB nodes inputs, one could be enough, but this way it can be easier to obtain certain hues.
From step 8 to step 19 we built the bump pattern for the leather. We used two different Bump nodes with different values for the Diffuse and Glossy and for the Anisotropic shader, to have slightly different light reflections on the surface.
Note that we used the UVMap layer information of the mesh for the Tangent node to be connected to the Anisotropic shader, and the Object mapping mode for the bump textures, instead; actually, because the mesh had been unwrapped already, we could have used the UV mapping output for the texture nodes too, but in that case the scale values for all the nodes would have been double and the flow of the textures on the polygons different (because forwarded by the flow of the unwrapped faces in the UV window).