Lit Shader
The Lit Shader lets you easily create realistic materials in the High Definition Render Pipeline (HDRP). It includes options for effects like subsurface scattering, iridescence, vertex or pixel displacement, and decal compatibility. For more information about Materials, Shaders, and Textures, see the Unity User Manual.
Creating a Lit Material
To create a new Lit Material, navigate to your Project's Asset window, right-click in the window and select Create > Material. This adds a new Material to your Unity Project’s Asset folder. When you create new Materials in HDRP, they use the Lit Shader by default.
Properties
Surface Options
Surface Options control the overall look of your Material's surface and how Unity renders the Material on screen.
[!include[](surface-type.md)] [!include[](rendering-pass.md)] [!include[](blending-mode.md)] [!include[](preserve-specular-lighting.md)] [!include[](sorting-priority.md)] [!include[](receive-fog.md)] [!include[](back-then-front-rendering.md)] [!include[](transparent-depth-prepass.md)] [!include[](transparent-depth-postpass.md)] [!include[](transparent-writes-motion-vectors.md)] [!include[](depth-write.md)] [!include[](depth-test.md)] [!include[](cull-mode.md)] [!include[](alpha-clipping.md)] [!include[](alpha-clipping-threshold.md)] [!include[](use-shadow-threshold.md)] [!include[](shadow-threshold.md)] [!include[](alpha-to-mask.md)] [!include[](prepass-threshold.md)] [!include[](postpass-threshold.md)] [!include[](double-sided.md)] [!include[](normal-mode.md)] [!include[](double-sided-GI.md)] [!include[](material-type.md)] [!include[](transmission.md)] [!include[](receive-decals.md)] [!include[](receive-ssr.md)] [!include[](receive-ssr-transparent.md)] [!include[](geometric-specular-aa.md)] [!include[](screen-space-variance.md)] [!include[](gsaa-threshold.md)] [!include[](displacement-mode.md)] [!include[](lock-with-object-scale.md)] [!include[](lock-with-height-map-tiling-rate.md)] [!include[](displacement-minimum-steps.md)] [!include[](displacement-maximum-steps.md)] [!include[](displacement-fading-mip-start.md)] [!include[](displacement-primitive-length.md)] [!include[](displacement-primitive-width.md)] [!include[](displacement-depth-offset.md)]Property | Description |
---|
Vertex Animation
Property | Description |
---|---|
Motion Vectors For Vertex Animation | Enable the checkbox to make HDRP write motion vectors for GameObjects that use vertex animation. This removes the ghosting that vertex animation can cause. |
Surface Inputs
Property | Description |
---|---|
Base Map | Assign a Texture that controls both the color and opacity of your Material. To assign a Texture to this field, click the radio button and select your Texture in the Select Texture window. Use the color picker to select the color of the Material. If you do not assign a Texture, this is the absolute color of the Material. If you do assign a Texture, the final color of the Material is a combination of the Texture you assign and the color you select. The alpha value of the color controls the transparency level for the Material if you select Transparent from the Surface Type drop-down. |
Metallic | Use this slider to adjust how "metal-like" the surface of your Material is (between 0 and 1). When a surface is more metallic, it reflects the environment more and its albedo color becomes less visible. At full metallic level, the surface color is entirely driven by reflections from the environment. When a surface is less metallic, its albedo color is clearer and any surface reflections are visible on top of the surface color, rather than obscuring it. This property only appears when you unassign the Texture in the Mask Map. |
Smoothness | Use the slider to adjust the smoothness of your 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 (because the light hits the bumps in the microsurface), so the reflections have less detail and spread across the surface in a more diffused pattern. This property only appears when you unassign the Texture in the Mask Map. |
Alpha Remapping | Use this min-max slider to remap the alpha values from the Base Map to the range you specify. Rather than clamping values to the new range, Unity condenses the original range down to the new range uniformly. This property only appears when you assign a Base Map. |
Metallic Remapping | Use this min-max slider to remap the metallic values from the Mask Map to the range you specify. Rather than clamping values to the new range, Unity condenses the original range down to the new range uniformly. This property only appears when you assign a Mask Map. |
Smoothness Remapping | Use this min-max slider to remap the smoothness values from the Mask Map to the range you specify. Rather than clamping values to the new range, Unity condenses the original range down to the new range uniformly. This property only appears when you assign a Mask Map. |
Ambient Occlusion Remapping | Use this min-max slider to remap the ambient occlusion values from the Mask Map to the range you specify. Rather than clamping values to the new range, Unity condenses the original range down to the new range uniformly. This property only appears when you assign a Mask Map. |
Mask Map | Assign a channel-packed Texture with the following Material maps in its RGBA channels. • Red: Stores the metallic map. • Green: Stores the ambient occlusion map. • Blue: Stores the detail mask map. • Alpha: Stores the smoothness map. For more information on channel-packed Textures and the mask map, see mask map. |
Normal Map Space | Use this drop-down to select the type of Normal Map space that this Material uses. • TangentSpace: Defines the normal map in tangent space. use this to tile a Texture on a Mesh. The normal map Texture must be BC7, BC5, or DXT5nm format. • ObjectSpace: Defines the normal maps in object space. Use this for planar-mapping GameObjects like the terrain. The normal map must be an RGB Texture . |
Normal Map | Assign a Texture that defines the normal map for this Material in tangent space. Use the slider to modulate the normal intensity between 0 and 8. This property only appears when you select TangentSpace from the Normal Map Space drop-down. |
Normal Map OS | Assign a Texture that defines the object space normal map for this Material. Use the handle to modulate the normal intensity between 0 and 8. This property only appears when you select ObjectSpace from the Normal Map Space drop-down. |
Bent Normal Map | Assign a Texture that defines the bent normal map for this Material in tangent space. HDRP uses bent normal maps to simulate more accurate ambient occlusion. Note: Bent normal maps only work with diffuse lighting. This property only appears when you select TangentSpace from the Normal Map Space drop-down.. |
Bent Normal Map OS | Assign a Texture that defines the bent normal map for this Material in object space. HDRP uses bent normal maps to simulate more accurate ambient occlusion. Note: Bent normal maps only work with diffuse lighting. This property only appears when you select ObjectSpace from the Normal Map Space drop-down. |
Coat Mask | Assign a Texture that defines the coat mask for this Material. HDRP uses this mask to simulate a clear coat effect on the Material to mimic Materials like car paint or plastics. The Coat Mask value is 0 by default, but you can use the handle to modulate the clear Coat Mask effect using a value between 0 and 1. |
Base UV Mapping | Use the drop-down to select the type of UV mapping that HDRP uses to map Textures to this Material’s surface. • Unity manages four UV channels for a vertex: UV0, UV1, UV2, and UV3. • Planar: A planar projection from top to bottom. • Triplanar: A planar projection in three directions: X-axis: Left to right Y-axis: Top to bottom Z-axis: Front to back Unity blends these three projections together to produce the final result. |
Tiling | Set an X and Y UV tile rate for all of the Textures in the Surface Inputs section. HDRP uses the X and Y values to tile these Textures across the Material’s surface, in object space. |
Offset | Set an X and Y UV offset for all of the Textures in the Surface Inputs section. HDRP uses the X and Y values to offset these Textures across the Material’s surface, in object. |
Detail Inputs
Property | Description |
---|---|
Detail Map | Specifies a channel-packed Texture that HDRP uses to add micro details into the Material. The Detail Map uses the following channel settings: • Red: Stores the grey scale as albedo. • Green: Stores the green channel of the detail normal map. • Blue: Stores the detail smoothness. • Alpha: Stores the red channel of the detail normal map. For more information on channel-packed Textures and the detail map, see detail map. |
Detail UV Mapping | Specifies the type of UV map to use for the Detail Map. If the Material’s Base UV mapping property is set to Planar or Triplanar, the Detail UV Mapping is also set to Planar or Triplanar. The Detail Map Texture modifies the appearance of the Material so, by default, HDRP applies the Tiling and Offset of the Base UV Map to the Detail Map to synchronize the Detail Map and the rest of the Material Textures. HDRP then applies the Detail Map Tiling and Offset properties on top of the Base Map Tiling and Offset. For example, on a plane, if the Tiling for Base UV Mapping is 2, and this value is also 2, then the Detail Map Texture tiles by 4 on the plane. This workflow allows you to change the Tiling of the Texture on the Material, without having to set the Tiling of the Detail UV too. To separate the Detail UV Map from the Base UV Map to set it independently, disable the Lock to Base Tiling/Offset checkbox. |
- Lock to Base Tiling/Offset | Indicates whether the Base UV Map’s Tiling and Offset properties affect the Detail Map. When enabled, HDRP multiplies these properties by the Detail UV Map’s Tiling and Offset properties respectively. To separate the Detail UV Map from the Base UV Map to set it independently, disable this checkbox. |
Tiling | The per-axis tile rate for the Detail Map UV. HDRP uses the X and Y values to tile the Texture assigned to the Detail Map across the Material’s surface, in object space. |
Offset | The per-axis offset for the Detail Map UV. HDRP uses the X and Y values to offset the Texture assigned to the Detail Map across the Material’s surface, in object space. |
Detail Albedo Scale | Modules the albedo of the detail map (red channel) between 0 and 2. This is an overlay effect. The default value is 1 and applies no scale. |
Detail Normal Scale | Modulates the intensity of the detail normal map (green and alpha channel), between 0 and 2. The default value is 1 and applies no scale. |
Detail Smoothness Scale | Modulate the intensity of the detail smoothness map (blue channel) between 0 and 2. This is an overlay effect. The default value is 1 and applies no scale. |
Transparency Inputs
Unity exposes this section if you select Transparent from the Surface Type drop-down. For information on the properties in this section, see the Surface Type documentation.
Be aware that when you enable Refraction, make sure to set Blend Mode to Alpha, otherwise the effect does not work as expected. If you enable Refraction and use a Blend Mode other than Alpha, a warning displays in the material Inspector.
Also, be aware that HDRP does not support Refraction in the Pre-Refraction render pass. If you enable Refraction and use the Pre-Refraction render pass, a warning displays in the material and Shader Graph Inspector.
Emission inputs
Property | Description |
---|---|
Use Emission Intensity | Enable the checkbox to use a separate LDR color and intensity value to set the emission color for this Material. Disable this checkbox to only use an HDR color to handle the color and emission color intensity. When enabled, this exposes the Emission Intensity property. |
Emission Map | Assign a Texture that this Material uses for emission. You can also use the color picker to select a color that HDRP multiplies by the Texture. If you do not set an emission texture then HDRP only uses the HDR color to calculate the final emissive color of the Material. You can set the intensity of the HDR color within the HDR color picker. |
Emission UV Mapping | Use the drop-down to select the type of UV mapping that HDRP uses for the Emission Map. • Unity manages four UV channels for a vertex: UV0, UV1, UV2, and UV3. • Planar: A planar projection from top to bottom. • Triplanar: A planar projection in three directions: X-axis: Left to right Y-axis: Top to bottom Z-axis: Front to back Unity blends these three projections together to produce the final result. • Same as Base: Unity will use the Base UV Mapping selected in the Surface Inputs. If the Surface has Pixel displacement enabled, this option will apply displacement on the emissive map too. |
- Tiling | Set an X and Y tile rate for the Emission Map UV. HDRP uses the X and Y values to tile the Texture assigned to the Emission Map across the Material’s surface, in object space. |
- Offset | Set an X and Y offset for the Emission Map UV. HDRP uses the X and Y values to offset the Texture assigned to the Emission Map across the Material’s surface, in object space. |
Emission Intensity | Set the overall strength of the emission effect for this Material. Use the drop-down to select one of the following physical light units to use for intensity: • Nits • EV100 |
Exposure Weight | Use the slider to set how much effect the exposure has on the emission power. For example, if you create a neon tube, you would want to apply the emissive glow effect at every exposure. |
Emission Multiply with Base | Enable the checkbox to make HDRP use the base color of the Material when it calculates the final color of the emission. When enabled, HDRP multiplies the emission color by the base color to calculate the final emission color. |
Emission | Toggles whether emission affects global illumination. |
- Global Illumination | The mode HDRP uses to determine how color emission interacts with global illumination. • Realtime: Select this option to make emission affect the result of real-time global illumination. • Baked: Select this option to make emission only affect global illumination during the baking process. • None: Select this option to make emission not affect global illumination. |
Advanced options
[!include[](snippets/shader-properties/advanced-options/enable-gpu-instancing.md)] [!include[](snippets/shader-properties/advanced-options/specular-occlusion-mode.md)] [!include[](snippets/shader-properties/advanced-options/add-precomputed-velocity.md)]Property | Description |
---|