Sub topic 1
Procedural Materials in Blender: What a Procedural Material Is and How the Node Graph Evaluates
Prerequisites
You should already be comfortable with:
- Moving around Blender and opening the Shader Editor.
- Treating a material as a graph of connected nodes.
- The Principled BSDF node and its main inputs.
- The difference between UV coordinates (2D, set by unwrapping) and 3D coordinates.
What a procedural material is
A procedural material is a surface defined by a formula instead of an image file. Nodes such as Noise Texture and Voronoi Texture compute values at every point on the surface. Because nothing is stored as pixels, the pattern stays sharp at any zoom level and you can change it with a single parameter.
Blender evaluates the graph backward. The renderer asks the Principled BSDF for a Base Color at a point, which asks the node linked to it for a value, which asks its own inputs for values, and so on up to the Texture Coordinate node. The graph runs once per shading point, so a long chain costs render time at every sample.
Choosing a coordinate space
The Texture Coordinate node decides where a pattern is sampled. Its outputs include:
- Generated: a 0 to 1 box fitted around the object's bounds. Good default for most objects.
- Object: coordinates in the object's local space. The pattern moves and scales with the object.
- UV: the unwrapped 2D layout. Use it when the pattern must follow the mesh's painted or unwrapped layout.
- Camera, Window, Reflection: view-dependent. Useful for effects, rarely for surfaces.
Controlling placement and scale with the Mapping node
The Mapping node transforms coordinates before they reach a texture. Its Location, Rotation, and Scale inputs shift, turn, and stretch the sample space. A Scale below 1.0 samples smaller coordinate values, so the pattern appears larger. A Scale above 1.0 shrinks the pattern.
The Noise Texture node
The Noise Texture node outputs a smooth, random value in two forms: Fac (a single grey value) and Color. Its main inputs are:
- Scale: the frequency of features. Higher values make finer detail.
- Detail: the number of noise octaves added together. More detail adds fine grain and costs time.
- Roughness: how strongly each added octave contributes. Higher values look rougher.
- Lacunarity: the frequency multiplier between octaves.
- Distortion: warps the noise and produces swirled patterns.
The following script builds a noise-driven Base Color:
import bpy
mat = bpy.data.materials.new("NoiseDemo")
mat.use_nodes = True
nodes = mat.node_tree.nodes
links = mat.node_tree.links
bsdf = nodes["Principled BSDF"]
coord = nodes.new("ShaderNodeTexCoord")
mapping = nodes.new("ShaderNodeMapping")
noise = nodes.new("ShaderNodeTexNoise")
noise.inputs["Scale"].default_value = 6.0
links.new(coord.outputs["Object"], mapping.inputs["Vector"])
links.new(mapping.outputs["Vector"], noise.inputs["Vector"])
links.new(noise.outputs["Fac"], bsdf.inputs["Base Color"])Exercise
The Mapping node Scale is changed from 1.0 to 0.5. Does the noise pattern get larger or smaller on the surface, and why?
Show answer
Larger. The Mapping Scale multiplies the coordinates, so 0.5 halves the values sampled from the noise. Halved coordinates stretch the pattern, making each feature cover more surface.