diff --git a/com.unity.render-pipelines.universal/Documentation~/universalrp-asset.md b/com.unity.render-pipelines.universal/Documentation~/universalrp-asset.md
index 8ba4abcfa27..1a9ed3b2779 100644
--- a/com.unity.render-pipelines.universal/Documentation~/universalrp-asset.md
+++ b/com.unity.render-pipelines.universal/Documentation~/universalrp-asset.md
@@ -119,7 +119,6 @@ This section allows you to fine-tune global post-processing settings.
| __Grading Mode__ | Select the [color grading](https://docs.unity3d.com/Manual/PostProcessing-ColorGrading.html) mode to use for the Project.
• __High Dynamic Range__: This mode works best for high precision grading similar to movie production workflows. Unity applies color grading before tonemapping.
• __Low Dynamic Range__: This mode follows a more classic workflow. Unity applies a limited range of color grading after tonemapping. |
| __LUT Size__ | Set the size of the internal and external [look-up textures (LUTs)](https://docs.unity3d.com/Manual/PostProcessing-ColorGrading.html) that the Universal Render Pipeline uses for color grading. Higher sizes provide more precision, but have a potential cost of performance and memory use. You cannot mix and match LUT sizes, so decide on a size before you start the color grading process.
The default value, **32**, provides a good balance of speed and quality. |
| __Fast sRGB/Liner Conversions__ | Select this option to use faster, but less accurate approximation functions when converting between the sRGB and Linear color spaces.|
-| __Screen Coordinates Override__ | Select this option to allow cameras to use Screen Coordinates Override.|
| __Volume Update Mode__ | Select how Unity updates Volumes: every frame or when triggered via scripting. In the Editor, Unity updates Volumes every frame when not in the Play mode.|
diff --git a/com.unity.render-pipelines.universal/Documentation~/urp-global-settings.md b/com.unity.render-pipelines.universal/Documentation~/urp-global-settings.md
index d87ce69fc5d..8011c67055d 100644
--- a/com.unity.render-pipelines.universal/Documentation~/urp-global-settings.md
+++ b/com.unity.render-pipelines.universal/Documentation~/urp-global-settings.md
@@ -22,3 +22,4 @@ The check boxes in this section define which shader variants Unity strips when y
| Strip Debug Variants | When enabled, Unity strips all debug view shader variants when you build the Player. This decreases build time, but prevents the use of Rendering Debugger in Player builds. |
| Strip Unused Post Processing Variants | When enabled, Unity assumes that the Player does not create new [Volume Profiles](VolumeProfile.md) at runtime. With this assumption, Unity only keeps the shader variants that the existing [Volume Profiles](VolumeProfile.md) use, and strips all the other variants. Unity keeps shader variants used in Volume Profiles even if the Scenes in the project do not use the Profiles. |
| Strip Unused Variants | When enabled, Unity performs shader stripping in a more efficient way. This option reduces the amount of shader variants in the Player by a factor of 2 if the project uses the following URP features:
- Light Layers
- Native Render Pass
- Reflection Probe Blending
- Reflection Probe Box Projection
- SSAO Renderer Feature
- Decal Renderer Feature
- Certain post-processing effects
Disable this option only if you see issues in the Player. |
+| Strip Screen Coord Override Variants | When enabled, Unity strips Screen Coordinates Override shader variants in Player builds. |
diff --git a/com.unity.render-pipelines.universal/Editor/GlobalSettings/SerializedUniversalRenderPipelineGlobalSettings.cs b/com.unity.render-pipelines.universal/Editor/GlobalSettings/SerializedUniversalRenderPipelineGlobalSettings.cs
index 1b15d41bfc4..b448728491b 100644
--- a/com.unity.render-pipelines.universal/Editor/GlobalSettings/SerializedUniversalRenderPipelineGlobalSettings.cs
+++ b/com.unity.render-pipelines.universal/Editor/GlobalSettings/SerializedUniversalRenderPipelineGlobalSettings.cs
@@ -25,6 +25,7 @@ class SerializedUniversalRenderPipelineGlobalSettings : ISerializedRenderPipelin
public SerializedProperty stripDebugVariants;
public SerializedProperty stripUnusedPostProcessingVariants;
public SerializedProperty stripUnusedVariants;
+ public SerializedProperty stripScreenCoordOverrideVariants;
public SerializedUniversalRenderPipelineGlobalSettings(SerializedObject serializedObject)
{
@@ -52,6 +53,7 @@ public SerializedUniversalRenderPipelineGlobalSettings(SerializedObject serializ
stripDebugVariants = serializedObject.FindProperty("m_StripDebugVariants");
stripUnusedPostProcessingVariants = serializedObject.FindProperty("m_StripUnusedPostProcessingVariants");
stripUnusedVariants = serializedObject.FindProperty("m_StripUnusedVariants");
+ stripScreenCoordOverrideVariants = serializedObject.FindProperty("m_StripScreenCoordOverrideVariants");
shaderVariantLogLevel = serializedObject.FindProperty("m_ShaderVariantLogLevel");
exportShaderVariants = serializedObject.FindProperty("m_ExportShaderVariants");
}
diff --git a/com.unity.render-pipelines.universal/Editor/GlobalSettings/UniversalRenderPipelineGlobalSettingsUI.Drawers.cs b/com.unity.render-pipelines.universal/Editor/GlobalSettings/UniversalRenderPipelineGlobalSettingsUI.Drawers.cs
index eeaff687c6f..74cc79910fb 100644
--- a/com.unity.render-pipelines.universal/Editor/GlobalSettings/UniversalRenderPipelineGlobalSettingsUI.Drawers.cs
+++ b/com.unity.render-pipelines.universal/Editor/GlobalSettings/UniversalRenderPipelineGlobalSettingsUI.Drawers.cs
@@ -68,6 +68,7 @@ static void OnContextClickLightLayerNames(Vector2 position, SerializedUniversalR
EditorGUILayout.PropertyField(universalRenderPipelineGlobalSettings.stripDebugVariants, Styles.stripDebugVariantsLabel);
EditorGUILayout.PropertyField(universalRenderPipelineGlobalSettings.stripUnusedPostProcessingVariants, Styles.stripUnusedPostProcessingVariantsLabel);
EditorGUILayout.PropertyField(universalRenderPipelineGlobalSettings.stripUnusedVariants, Styles.stripUnusedVariantsLabel);
+ EditorGUILayout.PropertyField(universalRenderPipelineGlobalSettings.stripScreenCoordOverrideVariants, Styles.stripScreenCoordOverrideVariants);
}
}))),
CED.Group((serialized, owner) => EditorGUILayout.Space())
diff --git a/com.unity.render-pipelines.universal/Editor/GlobalSettings/UniversalRenderPipelineGlobalSettingsUI.Skin.cs b/com.unity.render-pipelines.universal/Editor/GlobalSettings/UniversalRenderPipelineGlobalSettingsUI.Skin.cs
index e44f6027c78..5158908aabc 100644
--- a/com.unity.render-pipelines.universal/Editor/GlobalSettings/UniversalRenderPipelineGlobalSettingsUI.Skin.cs
+++ b/com.unity.render-pipelines.universal/Editor/GlobalSettings/UniversalRenderPipelineGlobalSettingsUI.Skin.cs
@@ -19,6 +19,7 @@ internal class Styles
public static readonly GUIContent stripDebugVariantsLabel = EditorGUIUtility.TrTextContent("Strip Debug Variants", "When disabled, all debug display shader variants are removed when you build for the Unity Player. This decreases build time, but prevents the use of Rendering Debugger in Player builds.");
public static readonly GUIContent stripUnusedPostProcessingVariantsLabel = EditorGUIUtility.TrTextContent("Strip Unused Post Processing Variants", "Controls whether strips automatically post processing shader variants based on VolumeProfile components. It strips based on VolumeProfiles in project and not scenes that actually uses it.");
public static readonly GUIContent stripUnusedVariantsLabel = EditorGUIUtility.TrTextContent("Strip Unused Variants", "Controls whether strip disabled keyword variants if the feature is enabled.");
+ public static readonly GUIContent stripScreenCoordOverrideVariants = EditorGUIUtility.TrTextContent("Strip Screen Coord Override Variants", "Controls whether Screen Coordinates Override shader variants are stripped.");
}
}
}
diff --git a/com.unity.render-pipelines.universal/Editor/ShaderPreprocessor.cs b/com.unity.render-pipelines.universal/Editor/ShaderPreprocessor.cs
index 59949f7a951..bd4cabc8ac7 100644
--- a/com.unity.render-pipelines.universal/Editor/ShaderPreprocessor.cs
+++ b/com.unity.render-pipelines.universal/Editor/ShaderPreprocessor.cs
@@ -50,7 +50,6 @@ enum ShaderFeatures
ScreenSpaceOcclusionAfterOpaque = (1 << 28),
AdditionalLightsKeepOffVariants = (1 << 29),
ShadowsKeepOffVariants = (1 << 30),
- ScreenCoordOverride = (1 << 31),
}
[Flags]
@@ -359,6 +358,11 @@ bool StripUnusedFeatures(ShaderFeatures features, Shader shader, ShaderSnippetDa
return true;
}
+ if (globalSettings != null && globalSettings.stripScreenCoordOverrideVariants && compilerData.shaderKeywordSet.IsEnabled(m_ScreenCoordOverride))
+ {
+ return true;
+ }
+
var stripUnusedVariants = UniversalRenderPipelineGlobalSettings.instance?.stripUnusedVariants == true;
var stripTool = new StripTool(features, shader, snippetData, compilerData.shaderKeywordSet, stripUnusedVariants);
@@ -506,9 +510,6 @@ bool StripUnusedFeatures(ShaderFeatures features, Shader shader, ShaderSnippetDa
m_DecalNormalBlendHigh, ShaderFeatures.DecalNormalBlendHigh))
return true;
- if (stripTool.StripMultiCompile(m_ScreenCoordOverride, ShaderFeatures.ScreenCoordOverride))
- return true;
-
return false;
}
@@ -932,9 +933,6 @@ private static ShaderFeatures GetSupportedShaderFeatures(UniversalRenderPipeline
if (pipelineAsset.useFastSRGBLinearConversion)
shaderFeatures |= ShaderFeatures.UseFastSRGBLinearConversion;
- if (pipelineAsset.useScreenCoordOverride)
- shaderFeatures |= ShaderFeatures.ScreenCoordOverride;
-
if (pipelineAsset.supportsLightLayers)
shaderFeatures |= ShaderFeatures.LightLayers;
diff --git a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/SerializedUniversalRenderPipelineAsset.cs b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/SerializedUniversalRenderPipelineAsset.cs
index 80afc8f25cf..404cbb6b517 100644
--- a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/SerializedUniversalRenderPipelineAsset.cs
+++ b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/SerializedUniversalRenderPipelineAsset.cs
@@ -63,8 +63,6 @@ internal class SerializedUniversalRenderPipelineAsset
public SerializedProperty colorGradingLutSize { get; }
public SerializedProperty useFastSRGBLinearConversion { get; }
- public SerializedProperty useScreenCoordOverride { get; }
-
#if ADAPTIVE_PERFORMANCE_2_0_0_OR_NEWER
public SerializedProperty useAdaptivePerformance { get; }
#endif
@@ -136,8 +134,6 @@ public SerializedUniversalRenderPipelineAsset(SerializedObject serializedObject)
useFastSRGBLinearConversion = serializedObject.FindProperty("m_UseFastSRGBLinearConversion");
- useScreenCoordOverride = serializedObject.FindProperty("m_UseScreenCoordOverride");
-
#if ADAPTIVE_PERFORMANCE_2_0_0_OR_NEWER
useAdaptivePerformance = serializedObject.FindProperty("m_UseAdaptivePerformance");
#endif
diff --git a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Drawers.cs b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Drawers.cs
index b1e1ec2f726..789f9f15577 100644
--- a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Drawers.cs
+++ b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Drawers.cs
@@ -476,8 +476,6 @@ static void DrawPostProcessing(SerializedUniversalRenderPipelineAsset serialized
EditorGUILayout.HelpBox(Styles.colorGradingLutSizeWarning, MessageType.Warning);
EditorGUILayout.PropertyField(serialized.useFastSRGBLinearConversion, Styles.useFastSRGBLinearConversion);
-
- EditorGUILayout.PropertyField(serialized.useScreenCoordOverride, Styles.useScreenCoordOverride);
}
static void DrawPostProcessingAdditional(SerializedUniversalRenderPipelineAsset serialized, Editor ownerEditor)
diff --git a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs
index 4420258f2fb..961298205cc 100644
--- a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs
+++ b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs
@@ -87,8 +87,6 @@ internal static class Styles
public static string colorGradingLutSizeWarning = "The minimal recommended LUT size for the high dynamic range color grading mode is 32. Using lower values will potentially result in color banding and posterization effects.";
public static GUIContent volumeFrameworkUpdateMode = EditorGUIUtility.TrTextContent("Volume Update Mode", "Select how Unity updates Volumes: every frame or when triggered via scripting. In the Editor, Unity updates Volumes every frame when not in the Play mode.");
- public static GUIContent useScreenCoordOverride = EditorGUIUtility.TrTextContent("Screen Coordinates Override", "Allow cameras to use Screen Coordinates Override.");
-
// Adaptive performance settings
public static GUIContent useAdaptivePerformance = EditorGUIUtility.TrTextContent("Use adaptive performance", "Allows Adaptive Performance to adjust rendering quality during runtime");
diff --git a/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAsset.cs b/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAsset.cs
index 3f90d0520d7..39d12f85aff 100644
--- a/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAsset.cs
+++ b/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAsset.cs
@@ -394,7 +394,6 @@ public partial class UniversalRenderPipelineAsset : RenderPipelineAsset, ISerial
[SerializeField] ColorGradingMode m_ColorGradingMode = ColorGradingMode.LowDynamicRange;
[SerializeField] int m_ColorGradingLutSize = 32;
[SerializeField] bool m_UseFastSRGBLinearConversion = false;
- [SerializeField] bool m_UseScreenCoordOverride = false;
// Deprecated settings
[SerializeField] ShadowQuality m_ShadowType = ShadowQuality.HardShadows;
@@ -1130,14 +1129,6 @@ public bool useFastSRGBLinearConversion
get { return m_UseFastSRGBLinearConversion; }
}
- ///
- /// Returns true if cameras may use Screen Coordinates Override.
- ///
- public bool useScreenCoordOverride
- {
- get { return m_UseScreenCoordOverride; }
- }
-
///
/// Set to true to allow Adaptive performance to modify graphics quality settings during runtime.
/// Only applicable when Adaptive performance package is available.
diff --git a/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineGlobalSettings.cs b/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineGlobalSettings.cs
index 2353fb6e078..1e84b7c5eb4 100644
--- a/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineGlobalSettings.cs
+++ b/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineGlobalSettings.cs
@@ -322,6 +322,8 @@ internal void ResetRenderingLayerNames()
[SerializeField] bool m_StripUnusedVariants = true;
+ [SerializeField] bool m_StripScreenCoordOverrideVariants = true;
+
///
/// Controls whether debug display shaders for Rendering Debugger are available in Player builds.
///
@@ -344,6 +346,11 @@ internal void ResetRenderingLayerNames()
///
public bool stripUnusedVariants { get => m_StripUnusedVariants; set { m_StripUnusedVariants = value; } }
+ ///
+ /// Controls whether Screen Coordinates Override shader variants are automatically stripped.
+ ///
+ public bool stripScreenCoordOverrideVariants { get => m_StripScreenCoordOverrideVariants; set => m_StripScreenCoordOverrideVariants = value; }
+
#endregion
}
}