From 7eac460062220bc36a1a84b321c544c3e51316a3 Mon Sep 17 00:00:00 2001 From: Ciprian Gavrilovici Date: Mon, 24 Apr 2023 23:16:46 +0300 Subject: [PATCH] added support for configuring soft shadow quality --- Runtime/Core/URP/HiddenURPFunctionality.cs | 9 ++++++++- Runtime/Core/URP/URPAssetConfiguring.cs | 8 +++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Runtime/Core/URP/HiddenURPFunctionality.cs b/Runtime/Core/URP/HiddenURPFunctionality.cs index a2fd606..6504124 100644 --- a/Runtime/Core/URP/HiddenURPFunctionality.cs +++ b/Runtime/Core/URP/HiddenURPFunctionality.cs @@ -30,7 +30,8 @@ internal static partial class URPFunctionality private static readonly FieldInfo m_Cascade3Split = getFieldInfo("m_Cascade3Split"); private static readonly FieldInfo m_Cascade4Split = getFieldInfo("m_Cascade4Split"); private static readonly FieldInfo m_SoftShadowsSupported = getFieldInfo("m_SoftShadowsSupported"); - private static readonly FieldInfo m_UseFastSRGBLinearConversion = getFieldInfo("m_UseFastSRGBLinearConversion"); + private static readonly FieldInfo m_SoftShadowQuality = getFieldInfo("m_SoftShadowQuality"); + private static readonly FieldInfo m_UseFastSRGBLinearConversion = getFieldInfo("m_UseFastSRGBLinearConversion"); private static readonly FieldInfo m_MixedLightingSupported = getFieldInfo("m_MixedLightingSupported"); private static FieldInfo getFieldInfo(string name) => pipelineAssetType.GetField(name, flags); @@ -157,6 +158,12 @@ internal static bool supportsSoftShadows(UniversalRenderPipelineAsset asset, boo return asset.supportsSoftShadows; } + internal static SoftShadowQuality softShadowQuality(UniversalRenderPipelineAsset asset, SoftShadowQuality quality) + { + m_SoftShadowQuality.SetValue(asset, quality); + return (SoftShadowQuality)m_SoftShadowQuality.GetValue(asset); + } + #endregion #region Post-processing diff --git a/Runtime/Core/URP/URPAssetConfiguring.cs b/Runtime/Core/URP/URPAssetConfiguring.cs index 7158172..9e87b0d 100644 --- a/Runtime/Core/URP/URPAssetConfiguring.cs +++ b/Runtime/Core/URP/URPAssetConfiguring.cs @@ -104,11 +104,13 @@ public int additionalLightsShadowResolutionTierHigh(int resolution) => public bool SoftShadows(bool state) => URPFunctionality.supportsSoftShadows(targetAsset, state); - #endregion + public SoftShadowQuality SoftShadowQuality(SoftShadowQuality quality) => URPFunctionality.softShadowQuality(targetAsset, quality); + + #endregion - #region Post-processing + #region Post-processing - public ColorGradingMode ColorGradingMode(ColorGradingMode mode) => + public ColorGradingMode ColorGradingMode(ColorGradingMode mode) => URPFunctionality.colorGradingMode(targetAsset, mode); public int ColorGradingLutSize(int size) =>