# Reduce shader variants The standard shaders in the High Definition Render Pipeline (HDRP) support a lot of different features, which can mean Unity compiles a lot of shader variants. To avoid your build growing too big, HDRP automatically excludes ('strips') shader variants for features you don't use in your build. You can change settings to make Unity strip more variants. This speeds up builds, and reduces memory usage and file sizes. If you want to examine the code that strips shaders in HDRP, see the following files: - `Editor/Material/Lit/LitShaderPreprocessor.cs` - `Editor/Material/BaseShaderPreprocessor.cs` - `Editor/BuildProcessors/HDRPPreprocessShaders.cs` The files use the [IPreprocessShaders](https://docs.unity3d.com/ScriptReference/Build.IPreprocessShaders.html) API. You can also do the following: - [Check how many shader variants you have](https://docs.unity3d.com/Manual/shader-how-many-variants.html). - See the [standard guidance about shader stripping](https://docs.unity3d.com/Manual/shader-variant-stripping.html), which applies to all render pipelines. ## Strip feature shader variants If you disable a feature, HDRP strips any shader variants where the feature is enabled. You must disable the feature in all the HDRP assets in your build. Unity includes in your build any HDRP asset you set as a **Render Pipeline Asset** in a [Quality Settings level](https://docs.unity3d.com/Manual/class-QualitySettings.html). | **Feature** | **How to disable the feature** | | :-- | :-- | | Built-in fog | In the [Graphics settings window](Default-Settings-Window.md), in the **Shader Stripping** section, set **Fog Modes** to **Custom**, then disable **Linear**, **Exponential**, **Exponential Squared**. This strips built-in fog shaders that HDRP doesn't use. | | Cameras generate additional [Arbitrary Output Variables (AOV)](AOVs.md) images | In the [HDRP asset](HDRP-Asset.md), in the **Rendering** section, disable **Runtime AOV API**. | | Cameras use both Deferred and Forward rendering | In the HDRP asset, in the **Rendering** section, set **Lit Shader Mode** to **Deferred**. This creates fewer variants than **Forward** or **Both**. | | Decals | In the HDRP asset, disable **Decals**. | | Distortion | In the HDRP asset, in the **Material** section, disable **Distortion**. | | GPU instancing variants you don't use | In the [Graphics settings window](Default-Settings-Window.md), in the **Shader Stripping** section, set **Instancing Variants** to **Strip Unused**. | | Holes in Terrain | In the HDRP asset, in the **Rendering** section, disable **Terrain Holes**. | | Lightmaps HDRP doesn't use | In the [Graphics settings window](Default-Settings-Window.md), in the **Shader Stripping** section, set **Lightmap Modes** to **Custom**, and enable only the **Baked Directional** mode. This strips lightmap shader variants that HDRP doesn't use. | | Material Quality in Shader Graph shaders | In the HDRP asset, in the **Material** section, disable any **Available Material Quality** levels you don't need. This only has an effect if you use the [Material Quality Node](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@15.0/manual/Scalability-Manual.html) in Shader Graph. | | Motion vectors | In the HDRP asset, in the **Rendering** section, disable **Motion Vectors**. You shouldn't disable this unless your Scenes are fully static with no deformation. | | Realtime raytracing | You can do one of the following in the HDRP asset, in the **Rendering** section: