Version: Unity 6.3 LTS (6000.3)
Language : English
Terrain Settings reference
Using Terrain at runtime

Render Terrain with Shader Graph

Terrain uses a default shaderA program that runs on the GPU. More info
See in Glossary
for its material, but you can create your own material with Shader Graph to fit specific goals and improve performance.

Possibilities include high quality tile repetition break-up solutions, detail mapping, smooth blending with the distant material, parallax mapping, auto materials, tri-planar projection, and more.

Create and assign a Terrain material from Shader Graph

To create a new TerrainThe landscape in your scene. A Terrain GameObject adds a large flat plane to your scene and you can use the Terrain’s Inspector window to create a detailed landscape. More info
See in Glossary
material with Shader Graph:

  1. In the Project window, right-click and select Create > Shader Graph > URP or HDRP > Terrain Lit Shader Graph.

    Unity creates a Shader Graph asset. This asset is configured to use the default Terrain Lit material type, and the graph is empty, apart from the Master Stack.

    Note: If you want to start from the Terrain Simple template instead of an empty graph, refer to Create a shader graph from a template.

  2. Use the Shader Graph window to build a graph according to your needs with the available nodes, and save the Shader Graph asset.

  3. In your project, right click on the Shader Graph asset and select Create > Material.

    Unity creates a material based on your shader graph. From now, this material automatically updates if you modify and save your shader graph again.

  4. Open your Terrain GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
    See in Glossary
    in the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
    See in Glossary
    window.

  5. Go to Terrain Settings > Basic Terrain.

  6. Replace the default material with the material created from your shader graph.

Use render options in Shader Graph to improve Terrain

Use Shader Graph to improve Terrain performance and visual fidelity.

Improve performance

To improve the performance of Terrain rendering, you need to sample the textures less. The default Terrain shader does three samples per layer, and another sample of the control map. To reduce sampling, do one of the following:

  • Pack the Terrain materials into fewer textures. For example, use tangent-space reconstruction to store normals in fewer channels.
  • Pack the Terrain material into texture arrays, and sample only one entry for the array, based on the data in the control map.
  • Don’t sample at all. Instead, construct the Terrain materials procedurally in the shader.

Improve visual fidelity

To improve visual fidelity, do one of the following:

  • Break up the Terrain grid with UV sampling.
  • Remove Terrain stretching on steep surfaces with triplanar mapping.
  • Add depth to the Terrain with parallax mapping.
  • Use height based blending for Terrain materials.

Note: Many of these techniques increase the number of texture samples, which can reduce performance.

Additional resources

To get started with Shader Graph Terrain rendering, refer to the Shader Graph Terrain Samples documentation.

For more information on specific pipeline support, refer to:

Terrain Settings reference
Using Terrain at runtime