Sub topic 3
What a BSDF is
This chapter assumes you can add nodes in the Shader Editor, know that a material ends at the Material Output node, and can run a short script from Blender's Scripting workspace. It explains the idea behind the Principled BSDF's name, so the inputs in later chapters make sense.
The name, piece by piece
BSDF stands for Bidirectional Scattering Distribution Function. Each word narrows the meaning:
- Function: a rule that takes inputs and returns a number.
- Distribution: the number describes how light is spread across directions, not along one direction.
- Scattering: light that arrives at a surface can bounce off it (reflection) or pass into and through it (transmission). Scattering covers both.
- Bidirectional: the rule depends on two directions. One is where the light comes from. The other is where the viewer or camera is.
In practice, a BSDF answers this question: if light arrives at this point from direction A, how much of it leaves toward direction B?
Two common special cases have their own names:
| Term | Meaning | Example |
|---|---|---|
| BRDF | Reflection only, light stays on the incoming side | A painted wall |
| BTDF | Transmission only, light crosses to the other side | Light entering clear glass |
| BSDF | Reflection and transmission together | A glass surface that both mirrors and refracts |
Blender uses "BSDF" in node names for all of these, even when a node only reflects.
Lobes: the shape of the answer
Plot the outgoing light for one fixed incoming direction and you get a shape called a lobe. Different surfaces produce different lobes.
- A diffuse surface such as matte paper scatters light almost evenly in all directions. The lobe is a wide dome, so the surface looks the same from any angle.
- A glossy surface such as polished plastic sends most light near the mirror direction. The lobe is narrow and points away from the surface. Roughness widens it. At roughness 0 the lobe collapses to a perfect mirror.
- A transmissive surface sends light through to the other side, bent by the material's index of refraction (IOR).
Real materials combine lobes. Glossy plastic is a diffuse lobe from the pigment underneath plus a glossy lobe from the clear surface on top. This is why the Principled BSDF has so many inputs: it is one node that mixes several lobes and exposes a control for each.
Two rules every physical BSDF follows
Renderers expect a BSDF to behave sensibly. Two properties matter for you as a material author.
- Energy conservation. A surface cannot send out more light than it receives. The sum of light in all lobes is at most the light that arrived. Blender's BSDF nodes are built so that raising one lobe takes energy from the others. For example, a highly transmissive Principled BSDF reflects less diffuse color.
- Reciprocity. Swapping the incoming and outgoing directions gives the same result. This lets Cycles trace paths from the camera toward lights and still get correct answers.
Neither rule needs action from you. They explain why physically plausible settings look right without extra tuning.
BSDFs in the node editor
In Blender, a BSDF node's output is a Shader socket, drawn in green. A Shader value is not a color or a number. It is a complete description of how that surface scatters light. The renderer evaluates it at each point it hits.
This has practical consequences:
- A Shader output can only connect to Shader inputs. The main one is the Surface socket on the Material Output. The Mix Shader and Add Shader nodes also accept Shader inputs.
- You cannot connect a Shader output to a color socket, or run it through Math or Color Ramp nodes. To change how a surface looks, change the values that go into the BSDF.
- Mix Shader blends two BSDFs by a factor. A factor of 0 gives only the first shader, and 1 gives only the second. Add Shader sums them, and can emit more energy than arrives, so it is mainly useful for effects like adding an emission shader.
Common shader-output nodes you will meet:
| Node | What it models |
|---|---|
| Diffuse BSDF | Matte reflection, with an optional Roughness input |
| Glossy BSDF | Mirror-like to blurry reflection |
| Glass BSDF | Reflection and refraction together |
| Translucent BSDF | Diffuse transmission, light scattered through thin material |
| Principled BSDF | Diffuse, specular, transmission, coat, sheen and subsurface in one node |
| Emission | Light output, not a BSDF in the strict sense, but it uses the same Shader socket |
Building a simple BSDF mix in Python
This script creates a material with no Principled BSDF. It uses a red Diffuse BSDF and a white Glossy BSDF, blended 20 percent toward glossy. It assumes Blender 4.0 or later and can run with or without an object selected.
import bpy
mat = bpy.data.materials.new(name="DiffuseGlossyMix")
mat.use_nodes = True
nodes = mat.node_tree.nodes
links = mat.node_tree.links
# Remove the default Principled BSDF, keep the Material Output
bsdf = nodes.get("Principled BSDF")
if bsdf is not None:
nodes.remove(bsdf)
output = nodes.get("Material Output")
diffuse = nodes.new("ShaderNodeBsdfDiffuse")
diffuse.inputs["Color"].default_value = (0.8, 0.05, 0.05, 1.0)
glossy = nodes.new("ShaderNodeBsdfGlossy")
glossy.inputs["Color"].default_value = (1.0, 1.0, 1.0, 1.0)
glossy.inputs["Roughness"].default_value = 0.2
mix = nodes.new("ShaderNodeMixShader")
mix.inputs["Fac"].default_value = 0.2 # 0 = all diffuse, 1 = all glossy
# The two Shader inputs of Mix Shader are inputs[1] and inputs[2]
links.new(diffuse.outputs["BSDF"], mix.inputs[1])
links.new(glossy.outputs["BSDF"], mix.inputs[2])
links.new(mix.outputs["Shader"], output.inputs["Surface"])
# Assign to the active object if it is a mesh
obj = bpy.context.active_object
if obj is not None and obj.type == 'MESH':
obj.data.materials.append(mat)The two Shader inputs of the Mix Shader share the name "Shader", so the script addresses them by index. A name lookup would return only the first.
This mix reflects 20 percent glossy light at every angle. A real clear coat reflects more at grazing angles, an effect called Fresnel reflection. Driving the Mix factor from a Layer Weight node's Fresnel output is the classic fix. The Principled BSDF does this for you.
How the Principled BSDF fits
The Principled BSDF is a BSDF in the same sense as the Diffuse and Glossy nodes. It outputs one Shader value. Internally it layers several lobes and handles Fresnel and energy balance. Its inputs, such as Base Color, Metallic and Roughness, are the controls over those lobes. The next chapter walks through them.
Common errors
- Trying to feed a Shader into a color input. Blender will not allow the connection. If you want a "glow color", use the Emission input on the Principled BSDF or an Emission shader.
- Leaving Mix Shader on its default factor. The default is 0.5, which gives an even blend. Set the factor deliberately.
- Using Add Shader for ordinary blends. It can produce surfaces brighter than the light they receive. Use Mix Shader for blending two surfaces.
- Expecting two Glossy BSDFs to look like a Principled BSDF. Without Fresnel weighting they will look flat and plastic-like at grazing angles.
Exercise
A colleague connects a Diffuse BSDF and a Glass BSDF to a Mix Shader with Fac set to 0.75. Which shader dominates, and why is Add Shader a poor choice for this blend?
Show answer
With Fac at 0.75, the result is 25 percent of the first shader and 75 percent of the second. The second shader dominates, so it depends on which BSDF is plugged into the second Shader input. Add Shader sums the light from both surfaces, so the total can exceed the light that arrived, which breaks energy conservation. Mix Shader keeps the weights adding up to 1.
Exercise
Why can a Shader socket not be connected to the Base Color input of a Principled BSDF?
Show answer
Base Color expects a color value. A Shader socket carries a complete scattering description, meaning how the surface treats light from every direction, and that cannot be treated as a color.