docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ShaderStrippingSetting

    This is a Graphics Settings container for settings related to shader stripping for all scriptable render pipelines.

    Inheritance
    object
    ShaderStrippingSetting
    Implements
    IRenderPipelineGraphicsSettings
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Rendering
    Assembly: Unity.RenderPipelines.Core.Runtime.dll
    Syntax
    [Serializable]
    [SupportedOnRenderPipeline(new Type[] { })]
    [CategoryInfo(Name = "Additional Shader Stripping Settings", Order = 40)]
    [ElementInfo(Order = 0)]
    public class ShaderStrippingSetting : IRenderPipelineGraphicsSettings
    Remarks

    To change those settings, go to Editor > Project Settings in the Graphics tab. Changing this through the API is only allowed in the Editor. In the Player, this raises an error.

    Examples

    Here is an example of how to check if your project strips variant shaders when building a Player using URP.

    using UnityEngine.Rendering;
    

    public static class ShaderStrippingHelper { public static bool exportLog { get { var gs = GraphicsSettings.GetRenderPipelineSettings<ShaderStrippingSetting>(); if (gs == null) //not in any SRP return false; return gs.exportShaderVariants; } } }

    Properties

    exportShaderVariants

    Controls whether to output shader variant information to a file.

    Declaration
    public bool exportShaderVariants { get; set; }
    Property Value
    Type Description
    bool
    See Also
    IRenderPipelineGraphicsSettings

    shaderVariantLogLevel

    Controls the level of logging of shader variant information outputted during the build process. Information appears in the Unity Console when the build finishes.

    Declaration
    public ShaderVariantLogLevel shaderVariantLogLevel { get; set; }
    Property Value
    Type Description
    ShaderVariantLogLevel
    See Also
    IRenderPipelineGraphicsSettings

    stripRuntimeDebugShaders

    When enabled, all debug display shader variants are removed when you build for the Unity Player. This decreases build time, but prevents the use of most Rendering Debugger features in Player builds.

    Declaration
    public bool stripRuntimeDebugShaders { get; set; }
    Property Value
    Type Description
    bool
    See Also
    IRenderPipelineGraphicsSettings

    version

    Current version of the settings container. Used only for project upgrades.

    Declaration
    public int version { get; }
    Property Value
    Type Description
    int
    See Also
    IRenderPipelineGraphicsSettings

    Implements

    IRenderPipelineGraphicsSettings

    Extension Methods

    ReflectionUtils.GetField(object, string)
    ReflectionUtils.GetFields(object)
    ReflectionUtils.Invoke(object, string, params object[])
    ReflectionUtils.SetField(object, string, object)
    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, T)

    See Also

    IRenderPipelineGraphicsSettings
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)