From 5d3678441d4c4e00c7968bee761942012c5ee29a Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Tue, 14 Apr 2020 18:30:39 +0200 Subject: [PATCH 1/6] Update HDRenderPipeline.cs --- .../Runtime/RenderPipeline/HDRenderPipeline.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 01125b2863d..57a46d20704 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -669,7 +669,7 @@ void SetRenderingFeatures() { reflectionProbeModes = SupportedRenderingFeatures.ReflectionProbeModes.Rotation, defaultMixedLightingModes = SupportedRenderingFeatures.LightmapMixedBakeModes.IndirectOnly, - mixedLightingModes = SupportedRenderingFeatures.LightmapMixedBakeModes.IndirectOnly | SupportedRenderingFeatures.LightmapMixedBakeModes.Shadowmask, + mixedLightingModes = SupportedRenderingFeatures.LightmapMixedBakeModes.IndirectOnly | (m_Asset.currentPlatformRenderPipelineSettings.supportShadowMask ? SupportedRenderingFeatures.LightmapMixedBakeModes.Shadowmask : 0), lightmapBakeTypes = LightmapBakeType.Baked | LightmapBakeType.Mixed | LightmapBakeType.Realtime, lightmapsModes = LightmapsMode.NonDirectional | LightmapsMode.CombinedDirectional, lightProbeProxyVolumes = true, @@ -685,6 +685,8 @@ void SetRenderingFeatures() , overridesLODBias = true , overridesMaximumLODLevel = true , terrainDetailUnsupported = true + , overridesShadowMask = true // Don't display the shadow mask UI in Quality Settings + , overridesRealtimeReflectionProbes = true // Don't display the real time reflection probes checkbox UI in Quality Settings }; Lightmapping.SetDelegate(GlobalIlluminationUtils.hdLightsDelegate); From 7ab325c617846d0aa7c22cccc5d7b5db96d7aa9d Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Tue, 14 Apr 2020 18:46:10 +0200 Subject: [PATCH 2/6] Update HDRenderPipeline.cs --- .../RenderPipeline/HDRenderPipeline.cs | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 57a46d20704..835ab5c7d4a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -103,6 +103,12 @@ internal static Volume GetOrCreateDefaultVolume() readonly PostProcessSystem m_PostProcessSystem; readonly XRSystem m_XRSystem; + // Keep track of previous Graphic and QualitySettings value to reset when switching to another pipeline + bool m_previousLightsUseLinearIntensity; + bool m_previoulightsUseColorTemperature; + bool m_previousSRPBatcher; + ShadowmaskMode m_previousShadowMaskMode; + bool m_FrameSettingsHistoryEnabled = false; /// @@ -660,11 +666,17 @@ void SetRenderingFeatures() Shader.globalRenderPipeline = "HDRenderPipeline"; // HD use specific GraphicsSettings + m_previousLightsUseLinearIntensity = GraphicsSettings.lightsUseLinearIntensity; GraphicsSettings.lightsUseLinearIntensity = true; + m_previoulightsUseColorTemperature = GraphicsSettings.lightsUseColorTemperature; GraphicsSettings.lightsUseColorTemperature = true; - + m_previousSRPBatcher = GraphicsSettings.useScriptableRenderPipelineBatching; GraphicsSettings.useScriptableRenderPipelineBatching = m_Asset.enableSRPBatcher; + // In case shadowmask mode isn't setup correctly, force it to correct usage (as there is no UI to fix it) + m_previousShadowMaskMode = QualitySettings.shadowmaskMode; + QualitySettings.shadowmaskMode = ShadowmaskMode.DistanceShadowmask; + SupportedRenderingFeatures.active = new SupportedRenderingFeatures() { reflectionProbeModes = SupportedRenderingFeatures.ReflectionProbeModes.Rotation, @@ -776,10 +788,12 @@ void UnsetRenderingFeatures() { Shader.globalRenderPipeline = ""; - SupportedRenderingFeatures.active = new SupportedRenderingFeatures(); + GraphicsSettings.lightsUseLinearIntensity = m_previousLightsUseLinearIntensity; + GraphicsSettings.lightsUseColorTemperature = m_previoulightsUseColorTemperature; + GraphicsSettings.useScriptableRenderPipelineBatching = m_previousSRPBatcher; + QualitySettings.shadowmaskMode = m_previousShadowMaskMode; - // Reset srp batcher state just in case - GraphicsSettings.useScriptableRenderPipelineBatching = false; + SupportedRenderingFeatures.active = new SupportedRenderingFeatures(); Lightmapping.ResetDelegate(); } From a43d8d6175cb20de3375a15b535fc36a5884a505 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Tue, 14 Apr 2020 20:24:51 +0200 Subject: [PATCH 3/6] Update HDRenderPipeline.cs --- .../Runtime/RenderPipeline/HDRenderPipeline.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 835ab5c7d4a..15bb0c05b84 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -697,8 +697,6 @@ void SetRenderingFeatures() , overridesLODBias = true , overridesMaximumLODLevel = true , terrainDetailUnsupported = true - , overridesShadowMask = true // Don't display the shadow mask UI in Quality Settings - , overridesRealtimeReflectionProbes = true // Don't display the real time reflection probes checkbox UI in Quality Settings }; Lightmapping.SetDelegate(GlobalIlluminationUtils.hdLightsDelegate); From ebe27dfd6fbd07128aaf806a08170c27801217d4 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Tue, 14 Apr 2020 20:25:19 +0200 Subject: [PATCH 4/6] Update CHANGELOG.md --- 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 931c4151dd4..d9fc14a91dc 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue where changing the default volume profile from another inspector would not update the default volume editor. - Fix for range compression factor for probes going negative (now clamped to positive values). - Fixed path validation when creating new volume profile (case 1229933) +- Fixed shadowmask UI now correctly showing shadowmask disable ### Changed - Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. From c7d673d82b1834b0357621cdd65d193cd16e591c Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Wed, 15 Apr 2020 11:19:35 +0200 Subject: [PATCH 5/6] fix typo --- .../RenderPipeline/HDRenderPipeline.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 15bb0c05b84..f72e7478680 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -104,10 +104,10 @@ internal static Volume GetOrCreateDefaultVolume() readonly XRSystem m_XRSystem; // Keep track of previous Graphic and QualitySettings value to reset when switching to another pipeline - bool m_previousLightsUseLinearIntensity; - bool m_previoulightsUseColorTemperature; - bool m_previousSRPBatcher; - ShadowmaskMode m_previousShadowMaskMode; + bool m_PreviousLightsUseLinearIntensity; + bool m_PreviouslightsUseColorTemperature; + bool m_PreviousSRPBatcher; + ShadowmaskMode m_PreviousShadowMaskMode; bool m_FrameSettingsHistoryEnabled = false; @@ -666,15 +666,15 @@ void SetRenderingFeatures() Shader.globalRenderPipeline = "HDRenderPipeline"; // HD use specific GraphicsSettings - m_previousLightsUseLinearIntensity = GraphicsSettings.lightsUseLinearIntensity; + m_PreviousLightsUseLinearIntensity = GraphicsSettings.lightsUseLinearIntensity; GraphicsSettings.lightsUseLinearIntensity = true; - m_previoulightsUseColorTemperature = GraphicsSettings.lightsUseColorTemperature; + m_PreviouslightsUseColorTemperature = GraphicsSettings.lightsUseColorTemperature; GraphicsSettings.lightsUseColorTemperature = true; - m_previousSRPBatcher = GraphicsSettings.useScriptableRenderPipelineBatching; + m_PreviousSRPBatcher = GraphicsSettings.useScriptableRenderPipelineBatching; GraphicsSettings.useScriptableRenderPipelineBatching = m_Asset.enableSRPBatcher; // In case shadowmask mode isn't setup correctly, force it to correct usage (as there is no UI to fix it) - m_previousShadowMaskMode = QualitySettings.shadowmaskMode; + m_PreviousShadowMaskMode = QualitySettings.shadowmaskMode; QualitySettings.shadowmaskMode = ShadowmaskMode.DistanceShadowmask; SupportedRenderingFeatures.active = new SupportedRenderingFeatures() @@ -786,10 +786,10 @@ void UnsetRenderingFeatures() { Shader.globalRenderPipeline = ""; - GraphicsSettings.lightsUseLinearIntensity = m_previousLightsUseLinearIntensity; - GraphicsSettings.lightsUseColorTemperature = m_previoulightsUseColorTemperature; - GraphicsSettings.useScriptableRenderPipelineBatching = m_previousSRPBatcher; - QualitySettings.shadowmaskMode = m_previousShadowMaskMode; + GraphicsSettings.lightsUseLinearIntensity = m_PreviousLightsUseLinearIntensity; + GraphicsSettings.lightsUseColorTemperature = m_PreviouslightsUseColorTemperature; + GraphicsSettings.useScriptableRenderPipelineBatching = m_PreviousSRPBatcher; + QualitySettings.shadowmaskMode = m_PreviousShadowMaskMode; SupportedRenderingFeatures.active = new SupportedRenderingFeatures(); From 799e5de2ff81397aa93564fdb1182621239c098f Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Wed, 15 Apr 2020 11:24:24 +0200 Subject: [PATCH 6/6] fix typo 2 --- .../Runtime/RenderPipeline/HDRenderPipeline.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index f72e7478680..9a1a8f107b4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -105,7 +105,7 @@ internal static Volume GetOrCreateDefaultVolume() // Keep track of previous Graphic and QualitySettings value to reset when switching to another pipeline bool m_PreviousLightsUseLinearIntensity; - bool m_PreviouslightsUseColorTemperature; + bool m_PreviousLightsUseColorTemperature; bool m_PreviousSRPBatcher; ShadowmaskMode m_PreviousShadowMaskMode; @@ -668,7 +668,7 @@ void SetRenderingFeatures() // HD use specific GraphicsSettings m_PreviousLightsUseLinearIntensity = GraphicsSettings.lightsUseLinearIntensity; GraphicsSettings.lightsUseLinearIntensity = true; - m_PreviouslightsUseColorTemperature = GraphicsSettings.lightsUseColorTemperature; + m_PreviousLightsUseColorTemperature = GraphicsSettings.lightsUseColorTemperature; GraphicsSettings.lightsUseColorTemperature = true; m_PreviousSRPBatcher = GraphicsSettings.useScriptableRenderPipelineBatching; GraphicsSettings.useScriptableRenderPipelineBatching = m_Asset.enableSRPBatcher; @@ -787,7 +787,7 @@ void UnsetRenderingFeatures() Shader.globalRenderPipeline = ""; GraphicsSettings.lightsUseLinearIntensity = m_PreviousLightsUseLinearIntensity; - GraphicsSettings.lightsUseColorTemperature = m_PreviouslightsUseColorTemperature; + GraphicsSettings.lightsUseColorTemperature = m_PreviousLightsUseColorTemperature; GraphicsSettings.useScriptableRenderPipelineBatching = m_PreviousSRPBatcher; QualitySettings.shadowmaskMode = m_PreviousShadowMaskMode;