From f047909b850372b4e55506832e54b01fdfed4cc1 Mon Sep 17 00:00:00 2001 From: Remi Chapelain Date: Wed, 28 Apr 2021 17:53:45 +0200 Subject: [PATCH 1/2] Add support for lighting full screen debug mode for tests --- .../Runtime/Debug/DebugDisplay.cs | 5 +++++ com.unity.testing.hdrp/Scripts/DebugViewController.cs | 4 +++- .../Scripts/Editor/DebugViewController_Editor.cs | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index 0318f58869a..09ba34e03bb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -302,6 +302,11 @@ internal void ResetExclusiveEnumIndices() /// List of Full Screen Rendering Debug mode values. public static int[] renderingFullScreenDebugValues => s_RenderingFullScreenDebugValues; + /// List of Full Screen Lighting Debug mode names. + public static GUIContent[] lightingFullScreenDebugStrings => s_LightingFullScreenDebugStrings; + /// List of Full Screen Lighting Debug mode values. + public static int[] lightingFullScreenDebugValues => s_LightingFullScreenDebugValues; + internal DebugDisplaySettings() { FillFullScreenDebugEnum(ref s_LightingFullScreenDebugStrings, ref s_LightingFullScreenDebugValues, FullScreenDebugMode.MinLightingFullScreenDebug, FullScreenDebugMode.MaxLightingFullScreenDebug); diff --git a/com.unity.testing.hdrp/Scripts/DebugViewController.cs b/com.unity.testing.hdrp/Scripts/DebugViewController.cs index e0b37e93110..4b0e687a555 100644 --- a/com.unity.testing.hdrp/Scripts/DebugViewController.cs +++ b/com.unity.testing.hdrp/Scripts/DebugViewController.cs @@ -19,6 +19,7 @@ public enum SettingType { Material, Lighting, Rendering } [Header("Lighting")] [SerializeField] bool lightlayers = false; + [SerializeField] int lightingFullScreenDebugMode = 0; [ContextMenu("Set Debug View")] public void SetDebugView() @@ -33,7 +34,8 @@ public void SetDebugView() case SettingType.Lighting: hdPipeline.debugDisplaySettings.SetDebugLightLayersMode(lightlayers); hdPipeline.debugDisplaySettings.data.lightingDebugSettings.debugLightLayersFilterMask = (DebugLightLayersMask)0b10111101; - break; + hdPipeline.debugDisplaySettings.SetFullScreenDebugMode((FullScreenDebugMode) lightingFullScreenDebugMode); + break; case SettingType.Rendering: hdPipeline.debugDisplaySettings.SetFullScreenDebugMode((FullScreenDebugMode) fullScreenDebugMode); break; diff --git a/com.unity.testing.hdrp/Scripts/Editor/DebugViewController_Editor.cs b/com.unity.testing.hdrp/Scripts/Editor/DebugViewController_Editor.cs index 65b7e9822eb..a0c8dccdec5 100644 --- a/com.unity.testing.hdrp/Scripts/Editor/DebugViewController_Editor.cs +++ b/com.unity.testing.hdrp/Scripts/Editor/DebugViewController_Editor.cs @@ -12,6 +12,7 @@ public class DebugViewController_Editor : Editor SerializedProperty s_gBuffer; SerializedProperty s_fullScreenDebugMode; + SerializedProperty s_lightingFullScreenDebugMode; SerializedProperty s_lightlayers; @@ -21,6 +22,7 @@ public void OnEnable() s_gBuffer = serializedObject.FindProperty("gBuffer"); s_fullScreenDebugMode = serializedObject.FindProperty("fullScreenDebugMode"); + s_lightingFullScreenDebugMode = serializedObject.FindProperty("lightingFullScreenDebugMode"); s_lightlayers = serializedObject.FindProperty("lightlayers"); } @@ -45,7 +47,8 @@ public override void OnInspectorGUI() case DebugViewController.SettingType.Lighting: s_lightlayers.boolValue = GUILayout.Toggle(s_lightlayers.boolValue, "Light Layers Visualization"); - break; + s_lightingFullScreenDebugMode.intValue = EditorGUILayout.IntPopup(new GUIContent("Fullscreen Debug Mode"), s_lightingFullScreenDebugMode.intValue, DebugDisplaySettings.lightingFullScreenDebugStrings, DebugDisplaySettings.lightingFullScreenDebugValues); + break; case DebugViewController.SettingType.Rendering: s_fullScreenDebugMode.intValue = EditorGUILayout.IntPopup(new GUIContent("Fullscreen Debug Mode"), s_fullScreenDebugMode.intValue, DebugDisplaySettings.renderingFullScreenDebugStrings, DebugDisplaySettings.renderingFullScreenDebugValues); From 2be139720b8e356721188906e76c143327c26ffb Mon Sep 17 00:00:00 2001 From: Remi Chapelain Date: Wed, 28 Apr 2021 18:05:58 +0200 Subject: [PATCH 2/2] changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 27fd3843f22..9c0fed13267 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added support for alpha channel in FXAA (case 1323941). - Added Speed Tree 8 shader graph as default Speed Tree 8 shader for HDRP. - Added the multicompile for dynamic lightmaps to support enlighten in ray tracing (case 1318927). +- Added support for lighting full screen debug mode in automated tests. ### Fixed - Fixed Intensity Multiplier not affecting realtime global illumination.