Explore the properties and settings you can use to customize the default Terrain Lit shader graph in the Universal Render Pipeline (URP).
Some properties might not work as expected, because the terrain system adds two additional shader passes when it generates a terrain shader. The passes are the following:
The default Vertex and Fragment Contexts contain the following Blocks. Which Blocks display might change depending on the graph settings.
The default values are the values from the mesh.
| Input | Type | Description |
|---|---|---|
| Position | Vector3 | Sets the vertex position in object space. Note: The vertex position has no effect on the Basemap Rendering pass. |
| Input | Type | Description |
|---|---|---|
| Base Color | Vector3 | Sets the base color of the material. The default is Color.grey. |
| Normal (Tangent Space) | Vector3 | Sets a custom normal map to simulate bumps and grooves on the surface of the sprite. For more information, refer to Add normal map and mask textures to a sprite. |
| Metallic | float | Sets how metallic the surface of your material is. The range is between 0 and 1. A higher value means the surface reflects the environment more, and its albedo color becomes less visible. A lower value means the albedo color is clearer, and reflections from the environment are visible on top of the surface color, rather than obscuring it. A value of 1 means the the surface color is entirely driven by reflections from the environment. |
| Emission | Vector3 | Sets the color the material emits as a light source. The default is black. For more information, refer to Add light emission to a material |
| Smoothness | float | Sets the smoothness of the material. Every light ray that hits a smooth surface bounces off at predictable and consistent angles. For a perfectly smooth surface that reflects light like a mirror, set this to a value of 1. Less smooth surfaces reflect light over a wider range of angles, so the reflections have less detail and spread across the surface in a more diffused pattern. |
| Ambient Occlusion | float | Sets how much ambient light reaches the surface, rather than being occluded. A value of 0 means the fragment is completely occluded and appears black. A value of 1 means the fragment is not occluded at all, and the ambient color does not change. |
| Alpha | Float | Sets the alpha of the material. The range is 0 to 1. The default is 1. |
| Alpha Clip Threshold | Float | Sets the minimum alpha value for a pixel to be visible. The range is 0 to 1. The default is 0.5. This property is only available if you enable Alpha Clipping in the graph settings. |
Explore the shader graph settings you can use to customize the Fragment and Vertex contexts.
For more details about graph settings that are common to all shader graph shaders, refer to Graph Settings tab.
| Setting | Description |
|---|---|
| Depth Write | Determines whether the shader writes depth information to the depth buffer. The options are:
|
| Depth Test | Sets the conditions under which geometry passes or fails depth testing. The GPU doesn’t draw pixels that fail a depth test. For more information, refer to Control material properties in the Inspector window. |
| Alpha Clipping | Discards pixels if their alpha value is lower than a threshold value. Enabling this setting adds the Alpha Clip Threshold Block to the Fragment context. To access the holes texture from the Terrain Texture Node, you must enable this property. |
| Cast Shadows | Enables the terrain casting shadows onto itself and other GameObjects. |
| Receive Shadows | Enables the terrain receiving shadows from other GameObjects. |
| Fragment Normal Space | Specifies the normal map space that this material uses. The options are:
|
| Custom Editor GUI | Renders a custom editor GUI in the Inspector window of the material. Enter the name of the GUI class in the field. |