Sub topic 10
Wiring Procedural Patterns into Principled BSDF Inputs
Prerequisites and the basic wiring model
This chapter assumes you can navigate Blender’s Shader Editor, add nodes, and understand that a material is a graph of connected nodes. You should also know the main inputs of the Principled BSDF shader and the difference between UV coordinates and 3D coordinates.
A procedural texture produces data. Noise and Voronoi nodes usually provide a factor, colour, or distance value. You connect that data to a material input to decide how the surface looks.
The Principled BSDF node accepts different kinds of data:
- Base Color expects a colour. It controls the visible colour of the surface.
- Roughness expects a value from 0 to 1. Low values look smooth and reflective. High values look matte.
- Metallic expects a value from 0 to 1. Use it carefully because most natural materials are not fully metallic.
- Normal expects a normal direction. A Bump node can convert a height pattern into this input.
- Displacement uses height to move surface geometry, when the render setup supports true displacement.
A single pattern can drive several inputs. For example, dark areas in a rock texture might also be rougher and slightly lower than light areas.
Matching outputs to inputs
A Noise Texture’s Fac output is a grayscale value. It is useful for Roughness, Metallic, Bump Height, and other numeric inputs. Its Color output contains a coloured version of the same pattern.
A Colour Ramp changes the range and meaning of a value. For Base Color, place dark brown at one stop and tan at another. For Roughness, use dark grey for smooth areas and light grey for rough areas. The ramp’s brightness becomes the roughness value.
You can also use a Math node to modify a factor before connecting it. Multiply a factor to increase its strength, or use Greater Than to create a sharp threshold. Keep masks separate from colours when possible. This makes the graph easier to adjust.
Building a layered material
Suppose you want a stone material:
- Connect Object coordinates to a Mapping node.
- Connect Mapping to a Noise Texture.
- Send Noise Fac into a Colour Ramp with dark and light stone colours.
- Connect the ramp’s Color output to Base Color.
- Use another ramp, or the same ramp with neutral grey colours, for Roughness.
- Send a grayscale pattern into a Bump node.
- Connect Bump Normal to the Principled BSDF Normal input.
The same visual pattern does not need identical settings for every input. Colour may use broad variation, while Bump needs smaller, sharper details. Combining a large Noise pattern with a finer Noise or Voronoi pattern usually produces a more believable result.
Creating the wiring with Python
The following script creates a material with Noise Texture, two Colour Ramp nodes, and a Bump node. It assigns the material to the active object.
import bpy
obj = bpy.context.object
if obj is None:
raise RuntimeError("Select an object before running this script.")
mat = bpy.data.materials.new("ProceduralStone")
mat.use_nodes = True
nodes = mat.node_tree.nodes
links = mat.node_tree.links
nodes.clear()
output = nodes.new("ShaderNodeOutputMaterial")
bsdf = nodes.new("ShaderNodeBsdfPrincipled")
coord = nodes.new("ShaderNodeTexCoord")
noise = nodes.new("ShaderNodeTexNoise")
color_ramp = nodes.new("ShaderNodeValToRGB")
rough_ramp = nodes.new("ShaderNodeValToRGB")
bump = nodes.new("ShaderNodeBump")
noise.inputs["Scale"].default_value = 5.0
noise.inputs["Detail"].default_value = 6.0
color_ramp.color_ramp.elements[0].color = (0.03, 0.015, 0.008, 1.0)
color_ramp.color_ramp.elements[1].color = (0.45, 0.28, 0.12, 1.0)
rough_ramp.color_ramp.elements[0].color = (0.25, 0.25, 0.25, 1.0)
rough_ramp.color_ramp.elements[1].color = (0.75, 0.75, 0.75, 1.0)
links.new(coord.outputs["Object"], noise.inputs["Vector"])
links.new(noise.outputs["Fac"], color_ramp.inputs["Fac"])
links.new(noise.outputs["Fac"], rough_ramp.inputs["Fac"])
links.new(color_ramp.outputs["Color"], bsdf.inputs["Base Color"])
links.new(rough_ramp.outputs["Color"], bsdf.inputs["Roughness"])
links.new(noise.outputs["Fac"], bump.inputs["Height"])
links.new(bump.outputs["Normal"], bsdf.inputs["Normal"])
links.new(bsdf.outputs["BSDF"], output.inputs["Surface"])
obj.data.materials.clear()
obj.data.materials.append(mat)Common wiring errors
If the material looks flat, check that the Bump output connects to Normal and that the bump strength is not zero. If the whole object is one colour, inspect the coordinate connection and Noise Scale. If the surface is too shiny, increase Roughness or verify that a dark value is not being sent into it. If colour changes look harsh, adjust the Colour Ramp interpolation or move its stops closer together.
Exercise
Which output should normally drive Roughness: Noise Texture Color or Fac?
Show answer
Use Fac for a direct grayscale pattern. Use Color only when you intentionally want Blender to convert a coloured pattern into a value, or when a Colour Ramp has shaped that pattern first.