Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for configuring soft shadow quality #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Runtime/Core/URP/HiddenURPFunctionality.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions Runtime/Core/URP/URPAssetConfiguring.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down