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

Simple non-metals

The walls, dishes, chair seats, and other objects have materials that require minimal setup. We'll use their materials to study some additional ideas. First, let's add a ceramic material:

  1. Add a new material called Ceramic. For the initial Principled BSDF, let's use a nice blue for its Base ColorSpecular is .9, and Roughness of .01.
  2. Add a Layer Weight node, and assign a preview to its Fresnel output.

The Fresnel effect makes light affect a material differently depending on the angle of a given plane: weaker when face normals orient toward the viewer, and stronger when oriented away from the viewer. When you look across a lake, it mirrors the sunset because the distant water is almost perpendicular to your line of sight, making the water appear reflective. But when you look down at your feet, the angle is parallel, and the water is instead transparent. Many materials benefit from even a mild influence of layer weight. The Layer Weight node's strength is controlled with the blend. The facing output gives a similar black-and-white map for meshes facing toward or away from you, as you can see in the following screenshot:

The Fresnel effect
  1. Assign the Layer Weight node's Fresnel output to the Specular input of Principled BSDF. Set the Layer Weight blend to 0.3; this will give us a nice result that you can see in the following screenshot:

The ceramic material nodes

Our ceramic is looking nice and shiny with an appropriate amount of Fresnel effect.

For the wall paint material, let's take a different approach:

  1. On a new tester object, add a material called housepaint. Recreate the node tree from the following screenshot:

The wall paint's starting nodes

The problem with this setup is clarity. It all works, but figuring out which nodes are doing what is a pain! The Frame node cleans up your layout, with labels and colors to help clarify further:

  1. Add a Frame node with Add | Layout | Frame.
  2. Select the Texture Coordinate, Mapping, and Voronoi textures and Mix node. Grab them with G, and hover them over the Frame node. Frame encompasses them in a box, and after clicking in Frame, they can be moved en masse.
  3. Select Frame, and then hit F2 and rename its label Vectors. Hit N for the Sidebar panel, and on the Items tab, this node can be further customized. Turn on Color, and choose a purple color reminiscent of the Vector Output dots.
  4. Repeat this process with a frame for the Base Color nodes and Specular nodes, naming those frames Color and Specular. If you accidentally drop a node into Frame, moving it will just resize the frame. Instead, remove it from the frame with Alt + P.

There, that's much clearer! Your Vectors, Color, and Specular frames should look something like this:

Frame nodes, used to organize and label a node tree

The generated vector is distorted by adding a tiny bit from a starting Voronoi Texture. This controls the Vector of the Voronoi at the heart of the material, whose nooks and crannies are colored with a ColorRamp and Hue Saturation Value. The Specular mixes a Fresnel pass with the inverted Voronoi, making it shiny on the bumps and matte in the nooks and crannies. Lastly, more detail is added via a Bump. If you handed this off to another Blender user, they would have a much easier time understanding your node logic now.

Now, let's make some glass, using the following steps:

  1. Create a new material, add a GlassBSDF node to Add Shader GlassBSDF, and assign it to the Material Output. This is similar to using the Principled BSDF node with Transmission at 1, but is much simpler.
  2. The window glass can ignore shadows to simplify rendering and allow sunlight passing through them. Open the Sidebar panel with N, go to the Options tab, and change the Shadow Mode to None.
  3. Rays going through glass will eventually run out of bounces, resulting in black artifacts. We'll solve this with a Math node set to Greater Than 10.
  1. Combine your Glass BSDF and a Transparent BSDF with a Mix Shader node, and use the Greater Than node as the factor.
  2. Add a Light Path node with Add | Input, and use Ray Depth as the first value in your Math node.

The result: when rays are still bouncing about, Blender will use the Glass BSDF. When it runs out of rays, it will use the Transparent BSDF node and let whatever's behind the material instantly pass through your glass. The glass nodes should look like this:

The glass material

Up next, we need some rough plastic, so recreate the following node tree:

Rough plastic

Remember, you can always use the search function from the Add menu to find nodes by name.

For fabric, the addition of displacement adds even rougher texture. You can create this material be recreating the node tree you see here:

Couch fabric material

When adding materials to the kitchen scene, use these materials as a baseline for similar objects. For instance, you can duplicate the glass material to make a wine bottle's glass material with the addition of some roughness and red color.

Next up, we're going to make some slightly more complicated procedural materials, starting with wood.