I don’t understand how to get Height-based Blend to work with the Universal Render Pipeline/Terrain/Lit material.
No matter what I do, the terrain only shows the lowest layer (grass):
The documentation on terrain Lit shader says:
Enable Height-based Blend
Enable to have Unity take the height values from the blue channel of the Mask Map Texture.
If you do not enable this property, Unity blends the Terrain Layers based on the weights painted in the splatmap Textures. When you disable this property and the Terrain Lit Shader Material is assigned to a Terrain, URP adds an additional option Opacity as Density Blend for each Terrain Layer that is added to that Terrain in the Paint Texture Tool Inspector.
Note: Unity ignores this option when more than four Terrain Layers are on the Terrain.
The documentation on Terrain Layers says:
For the HDRP and URP TerrainLit Shader, the RGBA channels of the Mask Map Texture correspond to:
B: Height
Channel Remapping: If you assign a Mask Map Texture, a new heading called Channel Remapping appears in the Terrain Layer settings. Click the triangle next to that heading to display the fields for minimum and maximum RGBA values. Unity uses these ranges to remap values in each channel of the Mask Map Texture.
My setup:
- Terrain width 10000, length 10000, height 10000
- Created a mountain 3000 high
- Created 4 layers (grass, dirt, rock, snow; see below)
- Created a material from Universal Render Pipeline/Terrain/Lit
- Turned “Enable Height-based Blend” on
- Assigned the material to the terrain
Layers:
- Grass: diffuse: green texture, mask map: #000000 texture
- Dirt: diffuse: brown texture, mask map: #000033 texture
- Rock: diffuse: gray texture, mask map: #000038 texture
- Snow: diffuse: white texture, mask map: #0000AA texture
Why these hex values? My assumption was that the blue channel (0 - 265) maps to the height of the terrain (0 - 10000). Hex 35 = 53 decimal; 53/265 = 0.2; 0.2 * 10000 = 2000.
Channel remapping on all 4 layers:
- Red: min 0, max 0
- Green: min 0, max 0
- Blue: min 0, max 1
- Alpha: min 0: max 0 (this removed the glossiness)
My project:
- Unity 2022.3.28f1
- Universal RP 14.0.11
I do not have more than four Terrain layers on the Terrain.
I’m assuming I am doing something wrong with the mask map, but I can’t figure out what “take the height values from the blue channel” might mean.
How am I supposed to do this?