Height blending
Blending two materials by comparing their height maps as well as the blend mask, so sand fills the gaps between stones before it covers their tops; the maths in plain words, contrast, and landscape layers.
Height blending mixes two materials using their height maps as well as a blend mask. Instead of fading one material evenly into the other, the material that is "higher" at each pixel shows first. Sand settles into the cracks between cobbles while the cobble tops stay clean; moss grows in the low spots of a stone wall first.
Brian Lesiangi sums it up in one line: "It blends 2 textures (or more) using their height information" (ArtStation blog: Real-time materials).
#Why it matters
A plain linear blend multiplies each texture by its weight and adds them together. Andrey Mishkinis points out that this looks wrong on terrain: the stones "look evenly soiled by sand", which does not happen in the real world (Game Developer: Advanced Terrain Texture Splatting). Height blending makes transitions follow the shapes in the textures, so a blend painted with a soft brush still produces crisp, believable borders.
It is commonly added to vertex paint materials and landscape layers.
#The maths in plain words
Take two materials, A and B, each with a height map from 0 (low) to 1 (high), and a blend mask that says how much of B you want (from vertex colour, a painted layer, or a texture).
- Add the weight to each height. A's score is its height plus its weight (1 − mask). B's score is its height plus its weight (mask).
- Find the winner. Whichever score is higher is on top at that pixel.
- Soften the edge. Picking only the winner gives jagged pixel edges. So keep every material whose score is within a small depth of the highest score, and blend those by how far above the cut-off they are.
Mishkinis' version uses a depth of 0.2; in his words, "we will take several pixels in depth instead of one and blend them" (Game Developer: Advanced Terrain Texture Splatting):
float3 blend(float4 texture1, float a1, float4 texture2, float a2)
{
float depth = 0.2;
float ma = max(texture1.a + a1, texture2.a + a2) - depth;
float b1 = max(texture1.a + a1 - ma, 0);
float b2 = max(texture2.a + a2 - ma, 0);
return (texture1.rgb * b1 + texture2.rgb * b2) / (b1 + b2);
}
Here the height map lives in each texture's alpha channel, and a1 and a2 are the blend weights (Game Developer: Advanced Terrain Texture Splatting).
#Worked example
At one pixel the mask is 0.5. A stone top has height 0.9; the sand there has height 0.3. Stone scores 0.9 + 0.5 = 1.4, sand 0.3 + 0.5 = 0.8. Stone wins clearly.
In the gap between two stones, the stone height is 0.1. Stone now scores 0.6 and sand 0.8, so sand wins. The mask value is the same, but the result differs because the heights differ.
#Sharpness and contrast
The depth value (or "contrast", depending on the tool) controls how hard the transition is. A small depth gives sharp, almost cut-out edges; a large depth fades back towards a linear blend.
Unreal's HeightLerp material function exposes this as inputs (Unreal Engine documentation: Texturing Material Functions in Unreal Engine):
- Height Texture: "The heightmap used for the lerp operation."
- Transition Phase: "The value which defines the region of the heightmap where transition takes place." Feed your vertex colour or painted mask here.
- Contrast: "Applies a contrast boost to the heightmap using the CheapContrast function."
Its outputs include the alpha with and without contrast, so you can reuse the same mask for colour, roughness and normals (Unreal Engine documentation: Texturing Material Functions in Unreal Engine).
#Landscape layers
Terrain is where height blending is used most. In Unreal's Landscape Layer Blend node, LB Height Blend "is the same as LB Weight Blend, but also adds detail to the transition between layers based on a height map" (Unreal Engine documentation: Landscape Materials in Unreal Engine).
Epic describes one problem. Where several height-blended layers overlap, a spot can end up with no layer contributing, so "black spots can appear", and normal map blending makes it worse (Unreal Engine documentation: Landscape Materials in Unreal Engine). Their fix is to switch one layer, such as soil, to LB Alpha Blend, or repaint the area with a layer that has a non-zero weight (Unreal Engine documentation: Landscape Materials in Unreal Engine).
#Common mistakes
- Flat or noisy height maps. The blend can only follow shapes the height map has. A height map with no clear high and low points gives a linear-looking blend.
- Heights on different scales. If one material's heights sit around 0.8 and the other's around 0.2, the first will win almost everywhere. Level them first.
- Too much contrast. Very sharp transitions alias and shimmer at a distance.
- Only blending base colour. Use the same alpha for roughness and normals, or the borders will look painted on.
- Black spots on landscapes from overlapping height-blended layers (Unreal Engine documentation: Landscape Materials in Unreal Engine).
#Related terms
vertex painting and blending · height and displacement maps · terrain and landscapes · tileable materials · detail maps and macro variation · master materials and instances
#Further reading and watching
References
- · Real-time materials · ArtStation blog, 2021 · article · accessed 2026-10-21
- · Advanced Terrain Texture Splatting · Game Developer, 2013 · article · accessed 2026-10-21
- · Texturing Material Functions in Unreal Engine · Unreal Engine documentation · docs · accessed 2026-10-21
- · Landscape Materials in Unreal Engine · Unreal Engine documentation · docs · accessed 2026-10-21
- · UE4 Height Blended Materials 3-Part Series · Epic Developer Community, 2022 · video · accessed 2026-10-21
Also consulted
- · UE4 Height Blended Materials - Part 2 · YouTube · video · accessed 2026-10-21
- · Detailed Texture Blending with Height Lerp & Vertex Painting | Unreal Engine Materials · YouTube · video · accessed 2026-10-21
Pages that link here
- Vertex colours Key term
- Sculpting rocks and cliffs Guide
- Sculpting damage and wear Guide
- Colour space: sRGB and linear Key term
- Height and displacement maps Key term
- Parallax occlusion mapping Key term
- Decals Topic
- Vertex painting and blending Topic
- Breaking up tiling Topic
- Normal map blending Key term
- Shaders for artists Topic
- Master materials and instances Topic
- Material layers and Substrate Topic
- Terrain and landscapes Topic
- Terrain layers and splat maps Key term
- Game art breakdowns: a curated library Reference
Last updated 2026-10-22