Class ShaderStrippingSetting
This is a Graphics Settings container for settings related to shader stripping for all scriptable render pipelines.
Implements
Inherited Members
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
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 |
---|---|
Shader |
See Also
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
version
Current version of the settings container. Used only for project upgrades.
Declaration
public int version { get; }
Property Value
Type | Description |
---|---|
int |