Browse Source

Allow CACAO shadow multiplier to be modified at run-time through the project settings

master
Nico de Poel 2 years ago
parent
commit
c1643054a6
  1. 4
      com.unity.render-pipelines.high-definition/Editor/Lighting/ScreenSpaceAmbientOcclusionEditor.cs
  2. 1
      com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/HDRenderPipeline.AmbientOcclusion.cs
  3. 2
      com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceAmbientOcclusion.cs

4
com.unity.render-pipelines.high-definition/Editor/Lighting/ScreenSpaceAmbientOcclusionEditor.cs

@ -17,6 +17,7 @@ namespace UnityEditor.Rendering.HighDefinition
SerializedDataParameter m_Radius;
SerializedDataParameter m_FullResolution;
SerializedDataParameter m_MaximumRadiusInPixels;
SerializedDataParameter m_ShadowMultiplier;
SerializedDataParameter m_DirectLightingStrength;
SerializedDataParameter m_SpatialBilateralAggressiveness;
@ -54,6 +55,7 @@ namespace UnityEditor.Rendering.HighDefinition
m_Radius = Unpack(o.Find(x => x.radius));
m_FullResolution = Unpack(o.Find("m_FullResolution"));
m_MaximumRadiusInPixels = Unpack(o.Find("m_MaximumRadiusInPixels"));
m_ShadowMultiplier = Unpack(o.Find(x => x.shadowMultiplier));
m_TemporalAccumulation = Unpack(o.Find(x => x.temporalAccumulation));
m_DirectionCount = Unpack(o.Find("m_DirectionCount"));
@ -84,6 +86,7 @@ namespace UnityEditor.Rendering.HighDefinition
public static readonly GUIContent useCacao = EditorGUIUtility.TrTextContent("Use FidelityFX CACAO", "Enable FidelityFX CACAO ambient occlusion technique.");
public static readonly GUIContent intesity = EditorGUIUtility.TrTextContent("Intensity", "Controls the strength of the ambient occlusion effect. Increase this value to produce darker areas.");
public static readonly GUIContent directLightingStrenght = EditorGUIUtility.TrTextContent("Direct Lighting Strength", "Controls how much the ambient light affects occlusion.");
public static readonly GUIContent shadowMultiplier = EditorGUIUtility.TrTextContent("Shadow Multiplier", "Controls the multiplier for the shadow values.");
public static readonly GUIContent layerMask = EditorGUIUtility.TrTextContent("Layer Mask", "Layer mask used to include the objects for ambient occlusion.");
static public readonly GUIContent specularOcclusion = EditorGUIUtility.TrTextContent("Specular Occlusion", "Controls the influence of the ambient occlusion on the specular occlusion. Increase this value to reduce the amount of specular leaking in occluded areas.");
public static readonly GUIContent maxRayLength = EditorGUIUtility.TrTextContent("Max Ray Length", "Controls the maximal length of ambient occlusion rays. The higher this value is, the more expensive ray traced ambient occlusion is.");
@ -164,6 +167,7 @@ namespace UnityEditor.Rendering.HighDefinition
else // TODO: add separate settings for CACAO
{
PropertyField(m_Radius, Styles.radius);
PropertyField(m_ShadowMultiplier, Styles.shadowMultiplier);
base.OnInspectorGUI(); // Quality Setting

1
com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/HDRenderPipeline.AmbientOcclusion.cs

@ -167,6 +167,7 @@ namespace UnityEngine.Rendering.HighDefinition
};
cacaoParameters.settings.radius = settings.radius.value;
cacaoParameters.settings.shadowMultiplier = settings.shadowMultiplier.value;
cacaoParameters.settings.shadowPower = settings.intensity.value;
result = RenderCacao(renderGraph, cacaoParameters, depthBuffer, normalBuffer);

2
com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceAmbientOcclusion.cs

@ -36,6 +36,8 @@ namespace UnityEngine.Rendering.HighDefinition
/// </summary>
public ClampedFloatParameter radius = new ClampedFloatParameter(2.0f, 0.25f, 5.0f);
public ClampedFloatParameter shadowMultiplier = new ClampedFloatParameter(1.0f, 0.0f, 5.0f);
/// <summary>
/// Moving this factor closer to 0 will increase the amount of accepted samples during temporal accumulation, increasing the ghosting, but reducing the temporal noise.
/// </summary>

Loading…
Cancel
Save