Terrain Lit Shader
The High Definition Render Pipeline (HDRP) uses the Terrain Lit Shader for Unity Terrain. This Shader is a simpler version of the Lit Shader. A Terrain can use a Terrain Lit Material with up to eight Terrain Layers.
Creating a Terrain Lit Material
To create a new Terrain Lit Shader Material:
- Go to your Project window and right-click in the Assets folder
- Select Create > Material. This adds a new Material to your Unity Project’s Asset folder.
- Click on the Material to view it in the Inspector.
- Click on the Shader drop-down and select HDRP > TerrainLit.
Using a Terrain Lit Material
To use a Terrain Lit Material, you must assign it to a Terrain:
- View the Terrain in the Inspector and click on the cog button to go to the Terrain Settings section.
- Either drag and drop or use the radio button to assign your Terrain Lit Material to the Material property.
Material properties
Surface Options
Property | Description |
---|---|
Receive Decals | Enable the checkbox to allow HDRP to draw decals on this Material’s surface. |
Terrain
Property | Description |
---|---|
Enable Height-based Blend | Specifies whether HDRP should only render the Terrain Layer with the greatest height value for a particular pixel. When enabled, HDRP takes the height values from the blue channel of the Mask Map Texture. When disabled, HDRP blends the Terrain Layers based on the weights painted in the control map Textures. |
- Height Transition | Controls how much HDRP blends the terrain if multiple Terrain Layers are approximately the same height. |
Enable Per-pixel Normal | Specifies whether HDRP should sample the normal map Texture on a per-pixel level. When enabled, Unity preserves more geometry details for distant terrain parts. Unity generates a geometry normal map at runtime from the heightmap, rather than the Mesh geometry. This means you can have high-resolution Mesh normals, even if your Mesh is low resolution. It only works if you enable Draw Instanced on the terrain. |
Specular Occlusion Mode | Sets the mode that HDRP uses to calculate specular occlusion. • Off: Disables specular occlusion. • From Ambient Occlusion: Calculates specular occlusion from the ambient occlusion map and the Camera's view direction. |
Advanced Options
Property | Description |
---|---|
Enable GPU Instancing | Enable this checkbox to tell HDRP to render meshes with the same geometry and Material/Shader in one batch when possible. This makes rendering faster. HDRP can not render Meshes in one batch if they have different Materials, or if the hardware does not support GPU instancing. |