Sub topic 11
Adding Surface Relief with the Bump Node and Displacement
This chapter assumes you can already build a pattern from a Noise or Voronoi Texture, shape it with a Colour Ramp, and connect results to the Principled BSDF. It also assumes you know how coordinates and the Mapping node set pattern scale. Here you will turn a grey procedural pattern into surface relief. You will learn what the Bump node does, what true displacement does, and when to combine them.
Height is a grey value
Both techniques read the same kind of input, a height field. A height field is a single number at each point on the surface. White means high, black means low. Any procedural output that gives a single value can supply one: the Noise Fac, the Voronoi Distance, or a Colour Ramp result.
This is why the earlier chapters on ramps as masks matter here. The ramp that isolates thin cracks for Roughness can also describe the cracks as grooves. One pattern can drive Base Color, Roughness, and relief together, which keeps the maps aligned with each other.
What the Bump node does
The Bump node fakes relief. It does not move any geometry. It looks at how the height changes across the surface near the shading point and tilts the surface normal to match. The renderer then lights the surface as if it had that relief.
The node has these inputs:
- Height: the grey value to read.
- Strength: a blend from 0 to 1 between the original normal and the fully bumped one.
- Distance: how far, in scene units, a full white-to-black change is treated as rising. Larger values give deeper-looking relief.
- Normal: an optional incoming normal, so bump nodes can be chained.
- Invert: a checkbox that flips high and low.
Its output is Normal, which connects to the Normal input of the Principled BSDF. Do not connect a texture colour directly to the BSDF Normal input. A colour is not a normal vector, and the result looks wrong.
The Bump node has limits. The silhouette of the object stays smooth, and nothing casts a real shadow into the grooves. At grazing angles the flat edge of a bumped plane gives it away. Because the effect is only a normal change, it is cheap and works in every render engine.
Strength and Distance
The two settings overlap, and it helps to treat them separately. Distance sets the physical scale of the relief. Strength blends the result toward flat. Pick a Distance that suits the object's size, then use Strength as a final slider. If you raise Strength to 1 and the surface still looks flat, the height pattern probably has too little contrast, not too little Strength. Check it with a Colour Ramp.
What displacement does
The Displacement node produces an actual offset along the surface normal. Its inputs are:
- Height: the grey value.
- Midlevel: the height value that causes no movement. The default is 0.5.
- Scale: the distance moved for a height change of 1.
- Normal: an optional normal to displace along.
The offset at each point is (Height - Midlevel) * Scale. With Midlevel 0.5, white pushes the surface out, black pushes it in, and mid-grey leaves it alone. With Midlevel 1.0, white leaves the surface in place and everything darker cuts inward. That setting suits cracks and engraved detail. The node's Displacement output goes to the Displacement socket of the Material Output node, not to the BSDF.
The Scale value uses scene units, so a Scale of 1.0 on a one-metre object is a very large offset. A new displacement setup often looks broken because of this. Start near 0.01 to 0.1 and adjust.
Why displacement needs geometry
A surface can only move at its vertices. A plain plane with four corners will move as a single flat sheet. For visible relief you need dense geometry, in one of two ways:
- Add a Subdivision Surface modifier. Set it to Simple if you do not want smoothing. Raise the render level until the grooves resolve cleanly.
- In Cycles, use adaptive subdivision. It splits geometry according to its size on screen. Availability and the settings it needs (such as the Experimental feature set) differ between Blender versions, so check the manual for your version.
The material also has to allow displacement. In the Material Properties panel, under Settings, the Displacement option has three values:
| Setting | What happens | Good for |
|---|---|---|
| Bump Only | The Displacement socket is used only as a bump. Geometry does not move. | Fast previews, distant objects |
| Displacement Only | Geometry moves. No extra bump is computed. | Large forms with enough geometry |
| Displacement and Bump | Geometry moves, and fine detail below the mesh resolution is added as bump. | Close-up rock, cracked earth, bark |
Bump Only is a common default, and it explains why a connected Displacement node seems to do nothing. If the silhouette stays flat, check this setting first. The property lives on the material, and its Python name differs between versions (see below).
Combining both
The best results usually use both. Displacement carries the large forms, such as big cracks and lumps. The Bump node adds the small grain that the mesh cannot resolve. A practical approach:
- Use a low-detail height (for example a Noise with few octaves) for displacement.
- Use a higher-detail height for the Bump node, with Distance kept small.
- Set the material to Displacement and Bump.
You can feed both from related patterns. A Voronoi crack mask can drive Displacement, while a high-scale Noise multiplied into it drives the fine Bump.
Building it with Python
The following script builds cracked earth. A Voronoi Distance to Edge pattern is thresholded by a ramp so it is black along the crack lines and white elsewhere. The ramp drives Roughness, Bump, and Displacement. Midlevel is 1.0, so the white plateaus stay in place and only the cracks sink.
import bpy
mat = bpy.data.materials.new("CrackedEarth")
mat.use_nodes = True
nodes = mat.node_tree.nodes
links = mat.node_tree.links
bsdf = nodes["Principled BSDF"]
out = nodes["Material Output"]
coord = nodes.new("ShaderNodeTexCoord")
voronoi = nodes.new("ShaderNodeTexVoronoi")
voronoi.feature = 'DISTANCE_TO_EDGE'
voronoi.inputs["Scale"].default_value = 4.0
ramp = nodes.new("ShaderNodeValToRGB")
cr = ramp.color_ramp
cr.elements[0].position = 0.0
cr.elements[0].color = (0.0, 0.0, 0.0, 1.0)
cr.elements[1].position = 0.05
cr.elements[1].color = (1.0, 1.0, 1.0, 1.0)
bump = nodes.new("ShaderNodeBump")
bump.inputs["Strength"].default_value = 0.8
bump.inputs["Distance"].default_value = 0.02
disp = nodes.new("ShaderNodeDisplacement")
disp.inputs["Midlevel"].default_value = 1.0
disp.inputs["Scale"].default_value = 0.05
links.new(coord.outputs["Object"], voronoi.inputs["Vector"])
links.new(voronoi.outputs["Distance"], ramp.inputs["Fac"])
links.new(ramp.outputs["Color"], bump.inputs["Height"])
links.new(ramp.outputs["Color"], disp.inputs["Height"])
links.new(ramp.outputs["Color"], bsdf.inputs["Roughness"])
links.new(bump.outputs["Normal"], bsdf.inputs["Normal"])
links.new(disp.outputs["Displacement"], out.inputs["Displacement"])
# The property moved from mat.cycles to mat in newer versions.
if hasattr(mat, "displacement_method"):
mat.displacement_method = 'BOTH'
else:
mat.cycles.displacement_method = 'BOTH'Assign the material to a subdivided plane and render with Cycles. The grooves appear in the silhouette only if the mesh has enough subdivisions.
Common problems
- Nothing moves. The material is set to Bump Only, the Displacement node is wired to the BSDF instead of the Material Output, or the mesh has too few vertices.
- Everything shifts or swells. Midlevel does not match the range of your height. A ramp that runs 0 to 1 with Midlevel 0.5 moves the whole surface outward on average. Set Midlevel to the value you want to stay fixed.
- Relief looks too weak or too strong. Check Distance and Scale against the object's real size before touching Strength.
- Stair-stepping or faceting. A harsh ramp with a very narrow gap between stops creates near-vertical edges in the height field, and the mesh cannot follow them. Widen the gap or raise subdivision.
- Relief appears inverted. Tick Invert on the Bump node, or swap the ramp stops. For Displacement, swap the stops or change Midlevel.
- Relief is stretched. The pattern uses stretched coordinates. Revisit the coordinate space and Mapping scale. Bump and displacement show distortion more clearly than colour does.
- Slow renders. High subdivision plus several chained Bump nodes costs memory and time. Prefer one displacement for large forms and one Bump for detail.
Exercise
A cracked-earth material has a Displacement node (Midlevel 0.5, Scale 0.1) connected to the Material Output. The ramp is black on the cracks and white on the plates. In the render, the whole plane looks raised, and the plates have moved up by 0.05 units. How do you keep the plates at their original level and cut only the cracks inward?
Show answer
The offset is (Height - Midlevel) Scale, so white plates at height 1.0 move by (1.0 - 0.5) 0.1 = 0.05. Set Midlevel to 1.0. The plates then have an offset of 0, and the black cracks move by (0 - 1.0) * 0.1 = -0.1 units, which cuts them inward.
Exercise
You connect a Displacement node to the Material Output of a plane with four vertices and render in Cycles. The surface stays perfectly flat. Name two likely causes and a fix for each.
Show answer
First, the material's Displacement setting may be Bump Only, so geometry is never moved. Change it to Displacement Only or Displacement and Bump. Second, the plane has too few vertices to carry any detail. Add a Subdivision Surface modifier (or use adaptive subdivision in Cycles) so there is geometry to move.