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

The Principled BSDF material

Almost every item in the kitchen will use the Principled BSDF material, and to make successful materials, we need to understand the science and practice of physically-based materials. BSDF (short for Bi-directional Scatter Distribution Falloff). When an emission of light hits a surface, there's a limited number of plausible physical effects.

First, the light ray is an emission. That ray can reflect off the surface, bouncing back light's energy. The ray can scatter through the surface, partially getting absorbed, and partially bouncing that light back out as diffuse reflections, also called albedo. The part of this scattered ray that sends out the remaining light is characterized by the energy that wasn't absorbed, as seen in the base color. When the light can scatter deeper in and back out of a surface, like a candle flame visible through the wax, it's called subsurface scattering. But the light ray might never reflect, having transmission through a surface, going straight through, and continuing on the other side. This transmission through the shader can slow the light ray, changing its angle, known as refraction.

We can visualize many of these properties with the following screenshot:

A light ray and the things it might do when hitting a surface

Roughness complicates this model. On a perfect mirror, the ray bounces directly off of the surface in one direction. Most surfaces have nooks and crannies that change the angle at which the light bounces based on a polygonal angle (called normals) or microscopic detail (called roughness). The result is an approximation of bounces, with more roughness spreading the reflection out. This softened averaging of rays at the surface level could also happen at the emission level, based on the surface area of the light. A tiny lightbulb filament means all of those rays coming from one point in space, but a cloudy day or photographer's softbox means many points in space averaging out together.

Here is a similar reference with roughness taken into account:

Light rays potentially scattered via the light source, normals, roughness, and scattering

Reflections can further be broken down into two types, Diffuse and Specular, which have an influence on two categories: metals and non-metals. Specular reflection directly bounces off the surface. Although roughness can distribute the rays, they bounce at a predictable angle of incidence. Diffuse rays will instead have a dispersed direction from scattering in and out of the surface and limit their color to the energy that wasn't absorbed in that scattering.

We can see these effects on metal surfaces versus non-metal surfaces in the following screenshot:

Ways that metals and nonmetals play with light

A material in Blender should be explicitly metal or non-metal. There are exceptions, such as superconductors or the anti-alias pixel between metals and non-metals in a texture map, but usually, there is no in-between. Metals should have their Metallic property set to 1. The Base Color property of the shader can combine with the metallic property to color a metal brilliant gold or dark iron.

Non-metals, also called dielectrics, show their diffuse reflection via the base color. They can also have specular reflections at the same time, and most materials will be a combination of the two. The physics can get much more complex than that, but Blender's Principled BSDF strikes a balance between physical accuracy, ease of use, and potential edge cases. For instance, clay tiles are rough and low on specular reflection. However, a glaze would make them shiny, while allowing the light to transmit to their base color below. This edge case is shown in the Clearcoat property.

Transmissive materials let light rays pass through them. Transmission should usually be set to either 0 or 1. The Index of Refraction (IOR) determines how much a light ray slows while transmitting through a substance, resulting in a warped look. The vacuum of space has an IOR of 1, and the air we breathe has such a low IOR that it, too, can just be 1. Water has an IOR of 1.325 and glass 1.5. You can find the IOR for exotic materials such as diamonds or emeralds online. Tint your transmissive materials with the Base Color, and "frost" them with Roughness. Transmissive materials also reflect specular light.

By messing with each of these properties on the Principled BSDF node, we can create all sorts of combinations, as seen in the following PBR chart:

The PBR chart

The PBR chart is a fun example of node power itself. If you would like to see the node setup for the PBR chart, open up the ch06_bsdfChart.blend file from the source files. The Principled BSDF is doing most of the work, as you can see here:

Automatic BSDF chart values controlled in a material

You can use the materials here to test other attributes in the BSDF from 0 to 100%. The shader starts with a Geometry node (Add | Input | Geometry) whose Position output is separated with Add | Convertor | Separate XYZ. Previewing the X output shows a black to white gradient based on its position in 3D. One meter from the world origin is seen as 100% (white) and anything further than 1 clips this value. The 1-meter spheres have array modifiers going out 5 meters, so multiplying this by 0.2 with a Math node stretches the gradient from 0 to 100% over 5 meters. Feed this into a ColorRamp set to Constant, and then add stops at positions of 0, 0.1, 0.3, 0.5, and 0.7, whose corresponding colors have a value set to 0, .25, .5, .75, and 1.

Most of that might sound really complicated, but you don't need a physics degree to make good materials. From here, material design is an artistic choice, mostly a matter of trusting your eye and comparing it to a real-world reference. In fact, lots of attributes on the Principled BSDF are hacks that break the laws of physics to achieve a look more artistically, such as sheen (which fakes the light-catching of some fuzzy fabrics) or Specular Tint (which colors the specular reflection with the Base Color, even though specular reflections are light rays that didn't scatter through the material.) And when you're struggling to make shaders for plastic cups or painted walls, start by looking at real-world examples around you. Many of the BSDF values for real-world materials can be found with an internet search.

Let's get out of science mode and back into kitchen creation mode! We'll start by making some metal materials for the kitchen.