Skip to content

Fixed the usage of GUIEnable for volume components (case 1280018). #1996

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

Merged
merged 2 commits into from
Sep 29, 2020
Merged
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
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed save popup appearing twice due to HDRP wizard.
- Fixed error when changing planar probe resolution.
- Fixed the dependecy of FrameSettings (MSAA, ClearGBuffer, DepthPrepassWithDeferred) (case 1277620).
- Fixed the usage of GUIEnable for volume components (case 1280018).

### Changed
- Preparation pass for RTSSShadows to be supported by render graph.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public override void OnInspectorGUI()
{
PropertyField(m_LayerMask, EditorGUIUtility.TrTextContent("Layer Mask", "Layer mask used to include the objects for ambient occlusion."));
base.OnInspectorGUI(); // Quality Setting
GUI.enabled = useCustomValue;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
EditorGUI.indentLevel++;
PropertyField(m_RayLength, EditorGUIUtility.TrTextContent("Ray Length", "Controls the length of ambient occlusion rays."));
Expand All @@ -97,27 +97,28 @@ public override void OnInspectorGUI()
}
EditorGUI.indentLevel--;
}
GUI.enabled = true;
}
else
{

PropertyField(m_Radius, EditorGUIUtility.TrTextContent("Radius", "Sampling radius. Bigger the radius, wider AO will be achieved, risking to lose fine details and increasing cost of the effect due to increasing cache misses."));

base.OnInspectorGUI(); // Quality Setting
GUI.enabled = useCustomValue;
PropertyField(m_MaximumRadiusInPixels, EditorGUIUtility.TrTextContent("Maximum Radius In Pixels", "This poses a maximum radius in pixels that we consider. It is very important to keep this as tight as possible to preserve good performance. Note that this is the value used for 1080p when *not* running the effect at full resolution, it will be scaled accordingly for other resolutions."));
PropertyField(m_FullResolution, EditorGUIUtility.TrTextContent("Full Resolution", "The effect runs at full resolution. This increases quality, but also decreases performance significantly."));
PropertyField(m_StepCount, EditorGUIUtility.TrTextContent("Step Count", "Number of steps to take along one signed direction during horizon search (this is the number of steps in positive and negative direction)."));
GUI.enabled = true;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
PropertyField(m_MaximumRadiusInPixels, EditorGUIUtility.TrTextContent("Maximum Radius In Pixels", "This poses a maximum radius in pixels that we consider. It is very important to keep this as tight as possible to preserve good performance. Note that this is the value used for 1080p when *not* running the effect at full resolution, it will be scaled accordingly for other resolutions."));
PropertyField(m_FullResolution, EditorGUIUtility.TrTextContent("Full Resolution", "The effect runs at full resolution. This increases quality, but also decreases performance significantly."));
PropertyField(m_StepCount, EditorGUIUtility.TrTextContent("Step Count", "Number of steps to take along one signed direction during horizon search (this is the number of steps in positive and negative direction)."));
}

PropertyField(m_TemporalAccumulation, EditorGUIUtility.TrTextContent("Temporal Accumulation", "Whether the results are accumulated over time or not. This can get better results cheaper, but it can lead to temporal artifacts. Requires Motion Vectors to be enabled."));
EditorGUI.indentLevel++;
if(!m_TemporalAccumulation.value.boolValue)
{
GUI.enabled = useCustomValue;
PropertyField(m_DirectionCount, EditorGUIUtility.TrTextContent("Direction Count", "Number of directions searched for occlusion at each each pixel."));
GUI.enabled = true;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
PropertyField(m_DirectionCount, EditorGUIUtility.TrTextContent("Direction Count", "Number of directions searched for occlusion at each each pixel."));
}
if (m_DirectionCount.value.intValue > 3)
{
EditorGUILayout.HelpBox("Performance will be seriously impacted by high direction count.", MessageType.Warning, wide: true);
Expand All @@ -130,9 +131,10 @@ public override void OnInspectorGUI()
PropertyField(m_GhostingAdjustement, EditorGUIUtility.TrTextContent("Ghosting reduction", "Moving this factor closer to 0 will increase the amount of accepted samples during temporal accumulation, increasing the ghosting, but reducing the temporal noise."));
if (isInAdvancedMode && !m_FullResolution.value.boolValue)
{
GUI.enabled = useCustomValue;
PropertyField(m_BilateralUpsample, EditorGUIUtility.TrTextContent("Bilateral Upsample", "This upsample method preserves sharp edges better, however can result in visible aliasing and it is slightly more expensive."));
GUI.enabled = true;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
PropertyField(m_BilateralUpsample, EditorGUIUtility.TrTextContent("Bilateral Upsample", "This upsample method preserves sharp edges better, however can result in visible aliasing and it is slightly more expensive."));
}
}
}
EditorGUI.indentLevel--;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ public override void OnEnable()
public override void OnInspectorGUI()
{
PropertyField(m_IndirectDiffuseLightingMultiplier, EditorGUIUtility.TrTextContent("Indirect Diffuse Lighting Multiplier", "Sets the multiplier for indirect diffuse lighting.\nIt affect Ambient Probe, Light Probes, Lightmaps, Light Probe Volumes, Screen Space Global Illumination, Raytrace Global Illumination."));
GUI.enabled = HDUtils.hdrpSettings.supportLightLayers;
PropertyField(m_IndirectDiffuseLightingLayers, EditorGUIUtility.TrTextContent("Indirect Diffuse Lighting Layers", "Sets the light layer mask for indirect diffuse lighting. Only matching RenderingLayers on Mesh will get affected by the multiplier."));
GUI.enabled = true;
using (new EditorGUI.DisabledScope(!HDUtils.hdrpSettings.supportLightLayers))
{
PropertyField(m_IndirectDiffuseLightingLayers, EditorGUIUtility.TrTextContent("Indirect Diffuse Lighting Layers", "Sets the light layer mask for indirect diffuse lighting. Only matching RenderingLayers on Mesh will get affected by the multiplier."));
}

PropertyField(m_ReflectionLightingMultiplier, EditorGUIUtility.TrTextContent("Reflection Lighting Multiplier", "Sets the multiplier for reflected specular lighting.\nIt affect Sky Reflection, Reflection Probes, Planar Probes, Screen Space Reflection, Raytrace Reflection."));
GUI.enabled = HDUtils.hdrpSettings.supportLightLayers;
PropertyField(m_ReflectionLightingLayers, EditorGUIUtility.TrTextContent("Reflection Lighting Layers", "Sets the light layer mask for reflected specular lighting. Only matching RenderingLayers on Mesh will get affected by the multiplier."));
GUI.enabled = true;

using (new EditorGUI.DisabledScope(!HDUtils.hdrpSettings.supportLightLayers))
{
PropertyField(m_ReflectionLightingLayers, EditorGUIUtility.TrTextContent("Reflection Lighting Layers", "Sets the light layer mask for reflected specular lighting. Only matching RenderingLayers on Mesh will get affected by the multiplier."));
}
PropertyField(m_ReflectionProbeIntensityMultiplier, EditorGUIUtility.TrTextContent("Reflection/Planar Probe Intensity Multiplier", "Sets the intensity multiplier for Reflection/Planar Probes."));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void RayTracingQualityModeGUI()
void RayTracingPerformanceModeGUI()
{
base.OnInspectorGUI();
GUI.enabled = useCustomValue;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
EditorGUI.indentLevel++;
PropertyField(m_MinSmoothness, k_MinimumSmoothnessText);
Expand All @@ -129,7 +129,6 @@ void RayTracingPerformanceModeGUI()
}
EditorGUI.indentLevel--;
}
GUI.enabled = true;
}

void RayTracedReflectionGUI()
Expand Down Expand Up @@ -203,10 +202,13 @@ public override void OnInspectorGUI()
m_DepthBufferThickness.value.floatValue = Mathf.Clamp(m_DepthBufferThickness.value.floatValue, 0.001f, 1.0f);

base.OnInspectorGUI();
GUI.enabled = useCustomValue;
PropertyField(m_RayMaxIterations, k_RayMaxIterationsText);
m_RayMaxIterations.value.intValue = Mathf.Max(0, m_RayMaxIterations.value.intValue);
GUI.enabled = true;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
EditorGUI.indentLevel++;
PropertyField(m_RayMaxIterations, k_RayMaxIterationsText);
m_RayMaxIterations.value.intValue = Mathf.Max(0, m_RayMaxIterations.value.intValue);
EditorGUI.indentLevel--;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ ProbeSettingsOverride displayedFields
if ((displayedFields.probe & lighting) != 0)
{

GUI.enabled = hd.currentPlatformRenderPipelineSettings.supportLightLayers;
PropertyFieldWithoutToggle(ProbeSettingsFields.lightingLightLayer, serialized.lightingLightLayer, EditorGUIUtility.TrTextContent("Light Layer", "Specifies the Light Layer the Reflection Probe uses to capture its view of the Scene. The Probe only uses Lights on the Light Layer you specify."), displayedFields.probe,
(property, label) => EditorGUILayout.PropertyField(property, label)
);

GUI.enabled = true;
using (new EditorGUI.DisabledScope(!hd.currentPlatformRenderPipelineSettings.supportLightLayers))
{
PropertyFieldWithoutToggle(ProbeSettingsFields.lightingLightLayer, serialized.lightingLightLayer, EditorGUIUtility.TrTextContent("Light Layer", "Specifies the Light Layer the Reflection Probe uses to capture its view of the Scene. The Probe only uses Lights on the Light Layer you specify."), displayedFields.probe,
(property, label) => EditorGUILayout.PropertyField(property, label)
);
}
PropertyFieldWithoutToggle(ProbeSettingsFields.lightingMultiplier, serialized.lightingMultiplier, EditorGUIUtility.TrTextContent("Multiplier", "Sets the multiplier value that reflective Materials apply to the results from the Reflection Probe."), displayedFields.probe);
PropertyFieldWithoutToggle(ProbeSettingsFields.lightingWeight, serialized.lightingWeight, EditorGUIUtility.TrTextContent("Weight", "Sets the weight of this Reflection Probe. When multiple Probes both affect the same area of a reflective Material, the Material uses the Weight of each Probe to determine their contribution to the reflective effect."), displayedFields.probe);
PropertyFieldWithoutToggle(ProbeSettingsFields.lightingFadeDistance, serialized.lightingFadeDistance, EditorGUIUtility.TrTextContent("Fade Distance", "Specifies the distance at which reflections smoothly fadeout before HDRP cuts them completely."), displayedFields.probe);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ public override void OnInspectorGUI()
PropertyField(m_Thickness, EditorGUIUtility.TrTextContent("Thickness", "Controls the thickness of the objects found along the ray, essentially thickening the contact shadows."));

base.OnInspectorGUI();
GUI.enabled = useCustomValue;
PropertyField(m_SampleCount, EditorGUIUtility.TrTextContent("Sample Count", "Controls the number of samples HDRP uses for ray casting."));
GUI.enabled = true;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
PropertyField(m_SampleCount, EditorGUIUtility.TrTextContent("Sample Count", "Controls the number of samples HDRP uses for ray casting."));
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ public override void OnInspectorGUI()
if (isInAdvancedMode)
{
EditorGUILayout.LabelField("Advanced Tweaks", EditorStyles.miniLabel);

GUI.enabled = useCustomValue;
PropertyField(m_Resolution);
PropertyField(m_HighQualityFiltering);
GUI.enabled = true;

using (new EditorGUI.DisabledScope(!useCustomValue))
{
PropertyField(m_Resolution);
PropertyField(m_HighQualityFiltering);
}
PropertyField(m_Anamorphic);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ public override void OnInspectorGUI()

PropertyField(m_SpectralLUT);
PropertyField(m_Intensity);
GUI.enabled = useCustomValue;
PropertyField(m_MaxSamples);
GUI.enabled = true;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
PropertyField(m_MaxSamples);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,16 @@ public override void OnInspectorGUI()

if (advanced)
{
GUI.enabled = useCustomValue;
EditorGUILayout.LabelField("Near Blur", EditorStyles.miniLabel);
PropertyField(m_NearSampleCount, Styles.k_NearSampleCount);
PropertyField(m_NearMaxBlur, Styles.k_NearMaxBlur);

EditorGUILayout.LabelField("Far Blur", EditorStyles.miniLabel);
PropertyField(m_FarSampleCount, Styles.k_FarSampleCount);
PropertyField(m_FarMaxBlur, Styles.k_FarMaxBlur);
GUI.enabled = true;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
EditorGUILayout.LabelField("Near Blur", EditorStyles.miniLabel);
PropertyField(m_NearSampleCount, Styles.k_NearSampleCount);
PropertyField(m_NearMaxBlur, Styles.k_NearMaxBlur);

EditorGUILayout.LabelField("Far Blur", EditorStyles.miniLabel);
PropertyField(m_FarSampleCount, Styles.k_FarSampleCount);
PropertyField(m_FarMaxBlur, Styles.k_FarMaxBlur);
}
}
}
else if (mode == (int)DepthOfFieldMode.Manual)
Expand All @@ -112,10 +113,11 @@ public override void OnInspectorGUI()

if (advanced)
{
GUI.enabled = useCustomValue;
PropertyField(m_NearSampleCount, Styles.k_NearSampleCount);
PropertyField(m_NearMaxBlur, Styles.k_NearMaxBlur);
GUI.enabled = true;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
PropertyField(m_NearSampleCount, Styles.k_NearSampleCount);
PropertyField(m_NearMaxBlur, Styles.k_NearMaxBlur);
}
}

EditorGUILayout.LabelField("Far Blur", EditorStyles.miniLabel);
Expand All @@ -124,23 +126,25 @@ public override void OnInspectorGUI()

if (advanced)
{
GUI.enabled = useCustomValue;
PropertyField(m_FarSampleCount, Styles.k_FarSampleCount);
PropertyField(m_FarMaxBlur, Styles.k_FarMaxBlur);
GUI.enabled = true;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
PropertyField(m_FarSampleCount, Styles.k_FarSampleCount);
PropertyField(m_FarMaxBlur, Styles.k_FarMaxBlur);
}
}
}

if (advanced)
{
GUI.enabled = useCustomValue;
EditorGUILayout.LabelField("Advanced Tweaks", EditorStyles.miniLabel);
PropertyField(m_Resolution);
PropertyField(m_HighQualityFiltering);
PropertyField(m_PhysicallyBased, Styles.k_PhysicallyBased);
if(m_PhysicallyBased.value.boolValue == true)
EditorGUILayout.HelpBox(Styles.InfoBox, MessageType.Info);
GUI.enabled = true;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
EditorGUILayout.LabelField("Advanced Tweaks", EditorStyles.miniLabel);
PropertyField(m_Resolution);
PropertyField(m_HighQualityFiltering);
PropertyField(m_PhysicallyBased, Styles.k_PhysicallyBased);
if(m_PhysicallyBased.value.boolValue == true)
EditorGUILayout.HelpBox(Styles.InfoBox, MessageType.Info);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ public override void OnInspectorGUI()

base.OnInspectorGUI();

GUI.enabled = useCustomValue;
PropertyField(m_SampleCount);
GUI.enabled = true;
using (new EditorGUI.DisabledScope(!useCustomValue))
{
PropertyField(m_SampleCount);
}

PropertyField(m_MaxVelocityInPixels);
PropertyField(m_MinVelInPixels);
Expand Down
Loading