Quick answer: Ensure all terrain layer textures use the same resolution and compression format, increase the Control Texture Resolution in Terrain Settings to at least 1024, and verify that your terrain layers aren’t exceeding the 4-layer-per-pass limit for your render pipeline.
You paint a few terrain layers — grass, dirt, rock — and everything looks fine in the editor. Then you zoom out, move the camera, or build the project, and suddenly the terrain is covered in blocky transitions, black patches, or harsh seams between textures. Terrain blending artifacts in Unity are frustrating because they can appear inconsistently and have several different root causes.
Understanding How Unity Terrain Blending Works
Unity’s terrain system uses a splat map (also called a control texture or alpha map) to determine how much of each texture layer appears at every point on the terrain surface. This is a low-resolution texture where each RGBA channel stores the weight for one terrain layer. Four layers per splat map, with additional splat maps generated automatically when you add more layers.
The blending happens in the terrain shader, which samples the splat map and mixes the corresponding textures based on their weights. When you see artifacts, it’s usually because one of these components is misconfigured: the splat map resolution is too low, the textures can’t be packed into a valid array, or the shader is hitting pass limits.
The default Control Texture Resolution is 512×512. For a terrain that’s 1000 meters across, that means each splat map pixel covers roughly 2 square meters. At that density, transitions between textures will look noticeably blocky, especially when the camera is close to the ground.
Fixing Texture Format Mismatches
The most common cause of black patches or completely broken terrain rendering is texture format mismatch. Unity packs all terrain layer textures into texture arrays at build time. For this to work, every texture in the array must have the same resolution, format, and compression settings.
Check each Terrain Layer asset and its referenced textures:
// Editor script to validate terrain layer consistency
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
public static class TerrainLayerValidator
{
[MenuItem("Tools/Validate Terrain Layers")]
static void Validate()
{
var terrain = Terrain.activeTerrain;
if (terrain == null) { Debug.LogError("No active terrain"); return; }
var layers = terrain.terrainData.terrainLayers;
if (layers.Length == 0) return;
var refTex = layers[0].diffuseTexture;
var refSize = new Vector2Int(refTex.width, refTex.height);
var refFormat = refTex.format;
for (int i = 1; i < layers.Length; i++)
{
var tex = layers[i].diffuseTexture;
if (tex == null)
{
Debug.LogError($"Layer {i} ({layers[i].name}) has no diffuse texture");
continue;
}
if (tex.width != refSize.x || tex.height != refSize.y)
Debug.LogError($"Layer {i} size {tex.width}x{tex.height} != expected {refSize}");
if (tex.format != refFormat)
Debug.LogError($"Layer {i} format {tex.format} != expected {refFormat}");
}
Debug.Log($"Checked {layers.Length} layers against {refSize} / {refFormat}");
}
}
#endif
If you find mismatches, select the offending textures in the Project window and adjust their import settings. Set all diffuse textures to the same Max Size (e.g., 1024 or 2048) and the same Compression (e.g., DXT5 for diffuse with alpha, DXT1 for without). Normal maps should also match across all layers.
Increasing Splat Map Resolution
Select your terrain, open the Terrain Settings (gear icon), and find Control Texture Resolution. Increase it from 512 to 1024 or 2048. This directly controls how many pixels the splat map has to represent blending across the terrain surface.
Higher resolutions give you sharper, more detailed blending transitions. The tradeoff is memory: a 2048×2048 RGBA splat map is 16 MB uncompressed, and you get one per four layers. For a terrain with 8 layers, that’s 32 MB just for splat maps. On desktop platforms this is usually fine; on mobile, stick with 1024 and limit your layer count.
After changing the resolution, you’ll need to repaint the affected areas. The existing splat map data gets resampled, but it won’t magically add detail that wasn’t there. Use the Paint Texture tool with a smaller brush to refine transitions at the higher resolution.
Layer Count and Rendering Passes
Each group of four terrain layers requires a separate rendering pass. With the Built-in Render Pipeline, this means:
- 1–4 layers: 1 pass (base pass)
- 5–8 layers: 2 passes (base + add pass)
- 9–12 layers: 3 passes
- 13–16 layers: 4 passes
With URP, the terrain shader handles layers differently and may show artifacts beyond 8 layers depending on your URP version. If you see sudden black areas appear when adding a fifth or ninth layer, the render pipeline may be failing to compile the additional pass. Check the console for shader compilation errors.
A practical approach: keep your primary layer count under 8, and use vertex painting or detail meshes for additional visual variety instead of adding more terrain texture layers.
Advanced: Height-Based Blending
Unity’s default terrain blending is purely weight-based — it linearly interpolates between textures based on splat map values. This produces smooth but unrealistic transitions. Real terrain doesn’t blend linearly; rock shows through dirt in cracks and high points.
If the default blending looks too smooth or artificial, you can use a custom terrain shader with height-based blending. This uses a height map packed into the alpha channel of each diffuse texture to determine which texture “wins” at boundary regions:
// Snippet from a custom terrain shader (HLSL)
float4 HeightBlend(float4 texA, float heightA, float4 texB, float heightB, float blend)
{
float ha = heightA + (1.0 - blend);
float hb = heightB + blend;
float maxH = max(ha, hb);
float b1 = max(ha - maxH + _BlendSharpness, 0);
float b2 = max(hb - maxH + _BlendSharpness, 0);
float bTotal = b1 + b2;
return (texA * b1 + texB * b2) / bTotal;
}
This technique eliminates the “airbrushed” look of default blending and produces much more natural terrain transitions, especially between hard materials like rock and soft materials like grass or sand.
Matching texture formats across terrain layers is one of those things that seems tedious until you realize it saves you days of debugging black patches in builds.