Class URPShaderStrippingSetting
A Graphics Settings container for settings related to shader stripping for Universal
Implements
Inherited Members
Namespace: UnityEngine .Rendering.Universal
Assembly: Unity.RenderPipelines.Universal.Runtime.dll
Syntax
[Serializable]
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
[CategoryInfo(Name = "Additional Shader Stripping Settings", Order = 40)]
[ElementInfo(Order = 10)]
public class URPShaderStrippingSetting : IRenderPipelineGraphicsSettings
Remarks
To change those settings, go to Editor > Project Settings in the Graphics tab (URP). Changing this through the API is only allowed in the Editor. In the Player, this raises an error.
This container is removed from all build Players.
Examples
Here is an example of how to determine if your project strips shader variants when building a Player with URP.
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public static class URPShaderStrippingHelper
{
public static bool enabled
{
get
{
var gs = GraphicsSettings.GetRenderPipelineSettings<URPShaderStrippingSetting>();
if (gs == null) //not in URP or in a Player
return false;
return gs.stripUnusedVariants;
}
}
}
Properties
stripScreenCoordOverrideVariants
Controls whether Screen Coordinates Override shader variants are automatically stripped.
Declaration
public bool stripScreenCoordOverrideVariants { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
stripUnusedPostProcessingVariants
Controls whether to automatically strip post processing shader variants based on Unity
Declaration
public bool stripUnusedPostProcessingVariants { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
stripUnusedVariants
Controls whether to strip variants if the feature is disabled.
Declaration
public bool stripUnusedVariants { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
version
Indicates the current version of this settings container. Used exclusively for project upgrades.
Declaration
public int version { get; }
Property Value
Type | Description |
---|---|
int |