Blender 3D By Example
上QQ阅读APP看书,第一时间看更新

Simple metals

We can make kitchen materials now that we know how nodes and the BSDF works. We'll start with simple metals for polished chrome, buffed steel, and cast iron. We'll use these on things such as the faucet and mirror in our kitchen.

First up, let's make the polished chrome:

  1. Open the Ch06_nodepractice_start.blend file.
  2. Add a new material to a new testing object. Name it chrome_polished.
  3. Change the Metallic attribute to 1. Again, BSDF materials should almost always have a metallic value of either 1 or 0.
  4. Change Roughness to 0.02. Even in laboratory settings, materials have tiny amounts of imperfection. Avoid putting the roughness at full 0 or 1.

That one was easy! Next, let's do the buff stainless steel:

  1. Select a new tester object, and then in the Shader editor, create a new material  and name it steel_buffed.
  2. Change the diffuse color to an RGB of .3, 3, .25, and a roughness of .2 for a baseline. Metals rarely go beyond a roughness of .3.
  3. Add a Noise Texture node, and plug it into the Roughness value. Press Ctrl + Shift + click on the noise texture, which hooks it into the Viewer node thanks to Node Wrangler. Press Ctrl + Shift + click again to cycle through the outputs and view its factor. Using Viewer nodes to preview different data in our shaders is crucial to the node workflow. Based on the Viewer node, I changed the Noise Texture node's scale to 30.
  4. The Noise texture is overkill when plugged into the Roughness value; limit it to .3 with a Math Node via Add | Vector | Math or by using the search field. Node Wrangler also simplifies math node operations; type Ctrl Shift * to hook it up to a Math node set to Multiply. Type in .25 for the second value. For any given pixel (0 at black, white at 1), it multiplies it by .25. The result is that our noise pixels only range from black (0) to dark gray (.3). Hook the Multiply Math node into Roughness.
  1. Add a ColorRamp node, which we'll use to increase the noise contrast. Move ColorRamp over the noodle between the Noise Texture and Multiply math nodes. It lights up with a new connection and execution inserts it into the node tree at that point. ColorRamp nodes remap an input to match the color stops along the way. New stops can be added by pressing Ctrl + clicking on the ramp. Delete selected stops by clicking on the minus button. For this ramp, I increased the noise's contrast by pulling the black and white stops to positions of .15 and .85.
  2. These variations in roughness are accompanied by nooks and crannies, which can be faked via normals by using a bump map. We show these nooks and crannies by controlling the material's normal output. Add a Bump node. Connect the cloud texture's Factor output to the Height input of Bump. Set Strength and Distance to .05, and assign it to the Normal attribute of Principled BSDF.

This one was a touch more complicated, but our result should look like this:

A rougher metal using a noise texture

To finish out our set of simple metals, let's make a cast iron material. Cast iron is about as rough as metal can get, and brings a strong dark base color. Don't forget to gather references! A pitfall that happens all of the time is to spend hours tinkering in confusion on a shader or model when a 30 second trip to the kitchen could solve a problem. For all of the materials in this chapter, we looked around at real-world sources to see what the materials should look like. For the cast iron, we can reference a cast iron skillet like the one in the following screenshot:

A cast-iron skillet to which materials can be compared

Now that we have our reference, we can get started:

  1. Create a new material on your next testing dragon called cast_iron. Get a baseline that matches the reference using only the Principled BSDF. I landed on a dark gray base color, .34 roughness, and .4 specular.
  2. For the texture of cast iron, create a noise texture and adjust its scale until it matches the scale of a cast iron pan. The dragon is 2 meters tall, so his eye is about the size of a pan. Duplicate your Noise Texture node, then combine it with a MixRGB node set to Linear Light, which both lightens using a texture's light values and darkens with the dark values. Adjust the scale of the new texture to even larger.
  3. For the Base Color, multiply the Linear Light node's output by .07 with a Math node.
  1. For the Roughness, duplicate the Multiply math node while maintaining the connection by pressing Ctrl + Shift + D, and run this into the Roughness. Change it to 0.9.
  1. Add a Bump node. Run the Linear Light's color output into its Height. Turn on Invert, set Strength to .15, and Distance to .5. Run its Normal output into the Normal input of Principled BSDF.
  2. Too many nodes result in noodle soup, where you can't understand the flow of decisions that resulted in a material output. Rerouting nodes, found in Add | Layout | Reroute, is a handy way to clean these up. These vertex-like points can be dropped onto a noodle and allow for clean, readable flow. Via Node Wrangler, add reroutes easily by pressing Shift + right-click-dragging over a noodle.

And there we have it, a cast iron material. Our node tree ended up looking like this:

The finished cast iron skillet node tree

Not all objects in a kitchen are made of metal, but this is a good start. Up next, we'll create some of the non-metal materials for the kitchen.