From 0a6ab779f2e4d6e48a0e7558b1d811f248c0ba21 Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Thu, 22 Oct 2020 16:35:33 +0200 Subject: [PATCH 01/10] Fixing exceptions in the console when putting the SSGI in low quality mode (render graph). (#2323) --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../ScreenSpaceGlobalIllumination.RenderGraph.cs | 8 ++++---- .../ScreenSpaceLighting/ScreenSpaceGlobalIllumination.cs | 5 ++--- .../RenderPipeline/HDRenderPipeline.RenderGraph.cs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ef0c8b4be0d..0149f6d0fc7 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -24,6 +24,7 @@ The version number for this package has increased due to a version update of a r - Fixed upside down XR occlusion mesh. - Fixed precision issue with the atmospheric fog. - Claryfied doc for the LayeredLit material. +- Fixing exceptions in the console when putting the SSGI in low quality mode (render graph). ### Changed - Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.RenderGraph.cs index 0d1106cb5df..bd45ce4ea2b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.RenderGraph.cs @@ -75,13 +75,13 @@ class UpscaleSSGIPassData public TextureHandle outputBuffer; } - TextureHandle UpscaleSSGI(RenderGraph renderGraph, HDCamera hdCamera, GlobalIllumination giSettings, TextureHandle depthPyramid, TextureHandle inputBuffer) + TextureHandle UpscaleSSGI(RenderGraph renderGraph, HDCamera hdCamera, GlobalIllumination giSettings, HDUtils.PackedMipChainInfo info, TextureHandle depthPyramid, TextureHandle inputBuffer) { using (var builder = renderGraph.AddRenderPass("Upscale SSGI", out var passData, ProfilingSampler.Get(HDProfileId.SSGIUpscale))) { builder.EnableAsyncCompute(false); - passData.parameters = PrepareSSGIUpscaleParameters(hdCamera, giSettings); ; + passData.parameters = PrepareSSGIUpscaleParameters(hdCamera, giSettings, info); passData.depthTexture = builder.ReadTexture(depthPyramid); passData.inputBuffer = builder.ReadTexture(inputBuffer); passData.outputBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) @@ -137,7 +137,7 @@ TextureHandle ConvertSSGI(RenderGraph renderGraph, HDCamera hdCamera, bool halfR } } - TextureHandle RenderSSGI(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthPyramid, TextureHandle normalBuffer, TextureHandle motionVectorsBuffer, ShaderVariablesRaytracing shaderVariablesRayTracingCB) + TextureHandle RenderSSGI(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthPyramid, TextureHandle normalBuffer, TextureHandle motionVectorsBuffer, ShaderVariablesRaytracing shaderVariablesRayTracingCB, HDUtils.PackedMipChainInfo info) { // Grab the global illumination volume component GlobalIllumination giSettings = hdCamera.volumeStack.GetComponent(); @@ -160,7 +160,7 @@ TextureHandle RenderSSGI(RenderGraph renderGraph, HDCamera hdCamera, TextureHand // Upscale it if required // If this was a half resolution effect, we still have to upscale it if (!giSettings.fullResolutionSS) - colorBuffer = UpscaleSSGI(renderGraph, hdCamera, giSettings, depthPyramid, colorBuffer); + colorBuffer = UpscaleSSGI(renderGraph, hdCamera, giSettings, info, depthPyramid, colorBuffer); return colorBuffer; } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.cs index 174c86780e0..59d629a7a68 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.cs @@ -325,7 +325,7 @@ struct SSGIUpscaleParameters public int upscaleKernel; } - SSGIUpscaleParameters PrepareSSGIUpscaleParameters(HDCamera hdCamera, GlobalIllumination settings) + SSGIUpscaleParameters PrepareSSGIUpscaleParameters(HDCamera hdCamera, GlobalIllumination settings, HDUtils.PackedMipChainInfo info) { SSGIUpscaleParameters parameters = new SSGIUpscaleParameters(); @@ -336,7 +336,6 @@ SSGIUpscaleParameters PrepareSSGIUpscaleParameters(HDCamera hdCamera, GlobalIllu parameters.halfScreenSize.Set(parameters.texWidth / 2, parameters.texHeight / 2, 1.0f / (parameters.texWidth * 0.5f), 1.0f / (parameters.texHeight * 0.5f)); // Set the generation parameters - var info = m_SharedRTManager.GetDepthBufferMipChainInfo(); parameters.firstMipOffset.Set(HDShadowUtils.Asfloat((uint)info.mipLevelOffsets[1].x), HDShadowUtils.Asfloat((uint)info.mipLevelOffsets[1].y)); // Grab the right kernel @@ -467,7 +466,7 @@ void RenderSSGI(HDCamera hdCamera, CommandBuffer cmd, ScriptableRenderContext re { ComputeShader bilateralUpsampleCS = m_Asset.renderPipelineResources.shaders.bilateralUpsampleCS; - SSGIUpscaleParameters parameters = PrepareSSGIUpscaleParameters(hdCamera, giSettings); + SSGIUpscaleParameters parameters = PrepareSSGIUpscaleParameters(hdCamera, giSettings, m_SharedRTManager.GetDepthBufferMipChainInfo()); SSGIUpscaleResources resources = PrepareSSGIUpscaleResources(hdCamera, buffer00, buffer10); ExecuteSSGIUpscale(cmd, parameters, resources); } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs index 7c2965549db..c9997ae6475 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs @@ -119,7 +119,7 @@ void ExecuteWithRenderGraph( RenderRequest renderRequest, switch (GetIndirectDiffuseMode(hdCamera)) { case IndirectDiffuseMode.ScreenSpace: - lightingBuffers.ssgiLightingBuffer = RenderSSGI(m_RenderGraph, hdCamera, prepassOutput.depthPyramidTexture, prepassOutput.normalBuffer, prepassOutput.resolvedMotionVectorsBuffer, m_ShaderVariablesRayTracingCB); + lightingBuffers.ssgiLightingBuffer = RenderSSGI(m_RenderGraph, hdCamera, prepassOutput.depthPyramidTexture, prepassOutput.normalBuffer, prepassOutput.resolvedMotionVectorsBuffer, m_ShaderVariablesRayTracingCB, GetDepthBufferMipChainInfo()); break; case IndirectDiffuseMode.Raytrace: From 41d1f0f5a8721a69310bd8ed8e071cd74e434aff Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Fri, 23 Oct 2020 11:16:52 +0200 Subject: [PATCH 02/10] Add VT frame settings (#2286) * Add frame setting * changelog * Grey setting out and make it always available. * Reverts tuff meant for antoher branch Co-authored-by: JulienIgnace-Unity --- .../CHANGELOG.md | 1 + .../Settings/FrameSettingsUI.Drawers.cs | 3 + .../Runtime/Material/VTBufferManager.cs | 59 +++++++++++-------- .../RenderPipeline/HDRenderPipeline.cs | 13 ++-- .../RenderPipeline/Settings/FrameSettings.cs | 6 ++ 5 files changed, 52 insertions(+), 30 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 0149f6d0fc7..46517162261 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -65,6 +65,7 @@ The version number for this package has increased due to a version update of a r - Adding missing marker for ray tracing profiling (RaytracingDeferredLighting) - Added the support of eye shader for ray tracing. - Exposed Refraction Model to the material UI when using a Lit ShaderGraph. +- Added frame setting for Virtual Texturing. ### Fixed - Fixed several issues with physically-based DoF (TAA ghosting of the CoC buffer, smooth layer transitions, etc) diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs index bbfd8692eec..ee00c90cfd8 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs @@ -236,6 +236,9 @@ static void Drawer_SectionRenderingSettings(SerializedFrameSettings serialized, }); area.AmmendInfo(FrameSettingsField.RayTracing, overrideable: () => hdrpSettings.supportRayTracing); +#if !ENABLE_VIRTUALTEXTURES + area.AmmendInfo(FrameSettingsField.VirtualTexturing, overrideable: () => false); +#endif area.AmmendInfo(FrameSettingsField.MotionVectors, overrideable: () => hdrpSettings.supportMotionVectors); area.AmmendInfo(FrameSettingsField.ObjectMotionVectors, overrideable: () => hdrpSettings.supportMotionVectors); area.AmmendInfo(FrameSettingsField.TransparentsWriteMotionVector, overrideable: () => hdrpSettings.supportMotionVectors); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/VTBufferManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/VTBufferManager.cs index e2c907533d3..d5fec43b3a3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/VTBufferManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/VTBufferManager.cs @@ -79,23 +79,29 @@ public void Cleanup() public void BeginRender(HDCamera hdCamera) { - int width = hdCamera.actualWidth; - int height = hdCamera.actualHeight; - bool msaa = hdCamera.frameSettings.IsEnabled(FrameSettingsField.MSAA); - GetResolveDimensions(ref width, ref height); - if (msaa) - m_ResolverMsaa.UpdateSize(width, height); - else - m_Resolver.UpdateSize(width, height); + if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.VirtualTexturing)) + { + int width = hdCamera.actualWidth; + int height = hdCamera.actualHeight; + bool msaa = hdCamera.frameSettings.IsEnabled(FrameSettingsField.MSAA); + GetResolveDimensions(ref width, ref height); + if (msaa) + m_ResolverMsaa.UpdateSize(width, height); + else + m_Resolver.UpdateSize(width, height); + } } public void Resolve(CommandBuffer cmd, RTHandle rt, HDCamera hdCamera) { - var parameters = PrepareResolveVTParameters(hdCamera); - var msaaEnabled = hdCamera.frameSettings.IsEnabled(FrameSettingsField.MSAA); - RTHandle input = msaaEnabled ? FeedbackBufferMsaa : (rt != null ? rt : FeedbackBuffer); + if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.VirtualTexturing)) + { + var parameters = PrepareResolveVTParameters(hdCamera); + var msaaEnabled = hdCamera.frameSettings.IsEnabled(FrameSettingsField.MSAA); + RTHandle input = msaaEnabled ? FeedbackBufferMsaa : (rt != null ? rt : FeedbackBuffer); - ResolveVTDispatch(parameters, cmd, input, m_LowresResolver); + ResolveVTDispatch(parameters, cmd, input, m_LowresResolver); + } } class ResolveVTData @@ -107,21 +113,24 @@ class ResolveVTData public void Resolve(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle input) { - using (var builder = renderGraph.AddRenderPass("Resolve VT", out var passData)) + if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.VirtualTexturing)) { - // The output is never read outside the pass but is still useful for the VT system so we can't cull this pass. - builder.AllowPassCulling(false); - - passData.parameters = PrepareResolveVTParameters(hdCamera); - passData.input = builder.ReadTexture(input); - passData.lowres = builder.WriteTexture(renderGraph.ImportTexture(m_LowresResolver)); - - builder.SetRenderFunc( - (ResolveVTData data, RenderGraphContext ctx) => + using (var builder = renderGraph.AddRenderPass("Resolve VT", out var passData)) { - ResolveVTDispatch(data.parameters, ctx.cmd, data.input, data.lowres); - VirtualTexturing.System.Update(); - }); + // The output is never read outside the pass but is still useful for the VT system so we can't cull this pass. + builder.AllowPassCulling(false); + + passData.parameters = PrepareResolveVTParameters(hdCamera); + passData.input = builder.ReadTexture(input); + passData.lowres = builder.WriteTexture(renderGraph.ImportTexture(m_LowresResolver)); + + builder.SetRenderFunc( + (ResolveVTData data, RenderGraphContext ctx) => + { + ResolveVTDispatch(data.parameters, ctx.cmd, data.input, data.lowres); + VirtualTexturing.System.Update(); + }); + } } } 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 9662772b254..fa9eddadf5c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -2992,12 +2992,15 @@ void Callback(CommandBuffer c, HDCamera cam) } #if ENABLE_VIRTUALTEXTURES - m_VtBufferManager.Resolve(cmd, m_GbufferManager.GetVTFeedbackBuffer(), hdCamera); - VirtualTexturing.System.Update(); - - if(m_VTDebugBlit != null) + if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.VirtualTexturing)) { - PushFullScreenVTFeedbackDebugTexture(cmd, GetVTFeedbackBufferForForward(hdCamera), hdCamera.frameSettings.IsEnabled(FrameSettingsField.MSAA)); + m_VtBufferManager.Resolve(cmd, m_GbufferManager.GetVTFeedbackBuffer(), hdCamera); + VirtualTexturing.System.Update(); + + if (m_VTDebugBlit != null) + { + PushFullScreenVTFeedbackDebugTexture(cmd, GetVTFeedbackBufferForForward(hdCamera), hdCamera.frameSettings.IsEnabled(FrameSettingsField.MSAA)); + } } #endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs index 67c67dd793c..02a37ee6c7a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs @@ -132,6 +132,9 @@ public enum FrameSettingsField /// When enabled, HDRP renders custom passes contained in CustomPassVolume components. [FrameSettingsField(0, autoName: CustomPass, customOrderInGroup: 11, tooltip: "When enabled, HDRP renders custom passes contained in CustomPassVolume components.")] CustomPass = 6, + /// When enabled, HDRP can use virtual texturing. + [FrameSettingsField(0, autoName: VirtualTexturing, customOrderInGroup: 105, tooltip: "When enabled, HDRP can use virtual texturing.")] + VirtualTexturing = 67, /// When enabled, HDRP processes a motion vector pass for Cameras using these Frame Settings. [FrameSettingsField(0, autoName: MotionVectors, customOrderInGroup: 12, tooltip: "When enabled, HDRP processes a motion vector pass for Cameras using these Frame Settings (Depends on \"Motion Vectors\" in current HDRP Asset).")] @@ -393,6 +396,7 @@ partial struct FrameSettings (uint)FrameSettingsField.TransparentPrepass, (uint)FrameSettingsField.TransparentPostpass, (uint)FrameSettingsField.CustomPass, + (uint)FrameSettingsField.VirtualTexturing, (uint)FrameSettingsField.MotionVectors, // Enable/disable whole motion vectors pass (Camera + Object). (uint)FrameSettingsField.ObjectMotionVectors, (uint)FrameSettingsField.Decals, @@ -468,6 +472,7 @@ partial struct FrameSettings (uint)FrameSettingsField.TransparentPrepass, (uint)FrameSettingsField.TransparentPostpass, (uint)FrameSettingsField.CustomPass, + (uint)FrameSettingsField.VirtualTexturing, (uint)FrameSettingsField.MotionVectors, // Enable/disable whole motion vectors pass (Camera + Object). (uint)FrameSettingsField.ObjectMotionVectors, (uint)FrameSettingsField.Decals, @@ -524,6 +529,7 @@ partial struct FrameSettings (uint)FrameSettingsField.TransparentPrepass, (uint)FrameSettingsField.TransparentPostpass, (uint)FrameSettingsField.CustomPass, + (uint)FrameSettingsField.VirtualTexturing, //(uint)FrameSettingsField.MotionVectors, // Enable/disable whole motion vectors pass (Camera + Object). //(uint)FrameSettingsField.ObjectMotionVectors, (uint)FrameSettingsField.Decals, From bdcb8bacceabeac9c0237dfa07b105bd2ef56110 Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Fri, 23 Oct 2020 11:21:29 +0200 Subject: [PATCH 03/10] Fix undo/redo compositor (#2300) * Rename function * Undoable "enable compositor" * Undo/Redo Enable/Disable compositor Co-authored-by: JulienIgnace-Unity --- .../CHANGELOG.md | 1 + .../Editor/Compositor/CompositorWindow.cs | 9 ++++++--- .../Runtime/Compositor/CompositionLayer.cs | 19 +++++++++++++++---- .../Runtime/Compositor/CompositionManager.cs | 4 ++-- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 46517162261..f83cb9c25d6 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -194,6 +194,7 @@ The version number for this package has increased due to a version update of a r - Fixed issue that caused non-static object to not render at times in OnEnable reflection probes. - Baked reflection probes now correctly use static sky for ambient lighting. - Use draggable fields for float scalable settings +- Fixed undo after enabling compositor. ### Changed - Preparation pass for RTSSShadows to be supported by render graph. diff --git a/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositorWindow.cs b/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositorWindow.cs index 7b1b12e8ea5..6db97847a12 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositorWindow.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositorWindow.cs @@ -71,7 +71,6 @@ void Update() } } - } void OnGUI() @@ -108,10 +107,14 @@ void OnGUI() compositor.SetupCompositionMaterial(); CompositionUtils.SetDefaultCamera(compositor); CompositionUtils.SetDefaultLayers(compositor); - } - if (compositor) + Undo.RegisterCreatedObjectUndo(compositor.outputCamera.gameObject, "Create Compositor"); + Undo.RegisterCreatedObjectUndo(go, "Create Compositor"); + } + else if (compositor) { + string message = enableCompositor ? "Enable Compositor" : "Disable Compositor"; + Undo.RecordObject(compositor, message); compositor.enabled = enableCompositor; } else diff --git a/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionLayer.cs b/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionLayer.cs index 804f76453f9..747da77bff9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionLayer.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionLayer.cs @@ -151,7 +151,7 @@ public static CompositorLayer CreateStackLayer(LayerType type = CompositorLayer. var newLayer = new CompositorLayer(); newLayer.m_LayerName = layerName; newLayer.m_Type = type; - newLayer.m_Camera = CompositionManager.GetSceceCamera(); + newLayer.m_Camera = CompositionManager.GetSceneCamera(); newLayer.m_CullingMask = newLayer.m_Camera? newLayer.m_Camera.cullingMask : 0; //LayerMask.GetMask("None"); newLayer.m_OutputTarget = CompositorLayer.OutputTarget.CameraStack; newLayer.m_ClearDepth = true; @@ -187,6 +187,15 @@ static float EnumToScale(ResolutionScale scale) return 1.0f / (int)scale; } + static T AddComponent(GameObject go) where T : Component + { + #if UNITY_EDITOR + return UnityEditor.Undo.AddComponent(go); + #else + return go.AddComponent(); + #endif + } + public int pixelWidth { get @@ -222,7 +231,7 @@ public void Init(string layerID = "") // Note: Movie & image layers are rendered at the output resolution (and not the movie/image resolution). This is required to have post-processing effects like film grain at full res. if (m_Camera == null) { - m_Camera = CompositionManager.GetSceceCamera(); + m_Camera = CompositionManager.GetSceneCamera(); } var compositor = CompositionManager.GetInstance(); @@ -340,13 +349,15 @@ public void Init(string layerID = "") if (m_LayerCamera) { m_LayerCamera.enabled = m_Show; - var cameraData = m_LayerCamera.GetComponent(); + var cameraData = m_LayerCamera.GetComponent() + ?? AddComponent(m_LayerCamera.gameObject); + var layerData = m_LayerCamera.GetComponent(); { // create the component if it is required and does not exist if (layerData == null) { - layerData = m_LayerCamera.gameObject.AddComponent(); + layerData = AddComponent(m_LayerCamera.gameObject); layerData.hideFlags = HideFlags.HideAndDontSave | HideFlags.HideInInspector; } // Reset the layer params (in case we cloned a camera which already had AdditionalCompositorData) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs index c2f9fcde07a..d1269b3188d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs @@ -826,7 +826,7 @@ internal bool IsThisCameraShared(Camera camera) return count > 1; } - static public Camera GetSceceCamera() + static public Camera GetSceneCamera() { if (Camera.main != null) { @@ -834,7 +834,7 @@ static public Camera GetSceceCamera() } foreach (var camera in Camera.allCameras) { - if (camera.name != "MainCompositorCamera") + if (camera != CompositionManager.GetInstance().outputCamera) { return camera; } From bc54701791ea1142d2693b10a75fec126ce510fc Mon Sep 17 00:00:00 2001 From: JulienIgnace-Unity Date: Fri, 23 Oct 2020 11:22:28 +0200 Subject: [PATCH 04/10] Restored purge of unused resources in render graph (#2306) --- .../Runtime/RenderGraph/RenderGraph.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs index cab8e7b1d68..78a842b88da 100644 --- a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs +++ b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs @@ -271,7 +271,7 @@ public void Cleanup() /// public void EndFrame() { - //m_Resources.PurgeUnusedResources(); + m_Resources.PurgeUnusedResources(); m_DebugParameters.logFrameInformation = false; m_DebugParameters.logResources = false; } From 4b8ed51f477b115fb529aa135c7980842e80d413 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 23 Oct 2020 11:24:35 +0200 Subject: [PATCH 05/10] Improve punctual shadow resolution rescale algorithm (#2309) * Improved the punctual shadow algorithm (it's less agressive now) * Updated changelog --- .../CHANGELOG.md | 3 ++ .../Lighting/Light/HDAdditionalLightData.cs | 28 +++++++++++++------ .../Runtime/Lighting/LightLoop/LightLoop.cs | 2 +- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index f83cb9c25d6..ff19f4c965c 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. Version Updated The version number for this package has increased due to a version update of a related graphics package. +### Changed +- Improved the punctual light shadow rescale algorithm. + ## [10.2.0] - 2020-10-19 ### Added diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs index ca7c4930573..0b3b88320da 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs @@ -1944,7 +1944,7 @@ internal int GetResolutionFromSettings(ShadowMapType shadowMapType, HDShadowInit } } - internal void ReserveShadowMap(Camera camera, HDShadowManager shadowManager, HDShadowSettings shadowSettings, HDShadowInitParameters initParameters, Rect screenRect, HDLightType lightType) + internal void ReserveShadowMap(Camera camera, HDShadowManager shadowManager, HDShadowSettings shadowSettings, HDShadowInitParameters initParameters, VisibleLight visibleLight, HDLightType lightType) { if (!m_WillRenderShadowMap) return; @@ -1978,14 +1978,26 @@ internal void ReserveShadowMap(Camera camera, HDShadowManager shadowManager, HDS if (viewPortRescaling && !shadowIsInCacheSystem) { - // resize viewport size by the normalized size of the light on screen - float screenArea = screenRect.width * screenRect.height; - viewportSize *= Mathf.Lerp(64f / viewportSize.x, 1f, screenArea); - viewportSize = Vector2.Max(new Vector2(64f, 64f) / viewportSize, viewportSize); + // Formulas: https://www.desmos.com/calculator/tdodbuysut f(x) is the distance between 0 and 1, g(x) is the screen ratio (oscillating to simulate different light sizes) + // The idea is to have a lot of resolution when the camera is close to the light OR the screen area is high. + + // linear normalized distance between the light and camera with max shadow distance + float distance01 = Mathf.Clamp01(Vector3.Distance(camera.transform.position, visibleLight.GetPosition()) / shadowSettings.maxShadowDistance.value); + // ease out and invert the curve, give more importance to closer distances + distance01 = 1.0f - Mathf.Pow(distance01, 2); + + // normalized ratio between light range and distance + float range01 = Mathf.Clamp01(visibleLight.range / Vector3.Distance(camera.transform.position, visibleLight.GetPosition())); - // Prevent flickering caused by the floating size of the viewport - viewportSize.x = Mathf.Round(viewportSize.x); - viewportSize.y = Mathf.Round(viewportSize.y); + float scaleFactor01 = Mathf.Max(distance01, range01); + + // We allow a maximum of 64 rescale between the highest and lowest shadow resolution + // It prevent having too many resolution changes when the player is moving. + const float maxRescaleSteps = 64; + scaleFactor01 = Mathf.RoundToInt(scaleFactor01 * maxRescaleSteps) / maxRescaleSteps; + + // resize viewport size by the normalized size of the light on screen + viewportSize = Vector2.Lerp(HDShadowManager.k_MinShadowMapResolution * Vector2.one, viewportSize, scaleFactor01); } viewportSize = Vector2.Max(viewportSize, new Vector2(HDShadowManager.k_MinShadowMapResolution, HDShadowManager.k_MinShadowMapResolution)); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs index 098bde0f962..a1f28c7516d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs @@ -2355,7 +2355,7 @@ int PreprocessVisibleLights(HDCamera hdCamera, CullingResults cullResults, Debug // Reserve shadow map resolutions and check if light needs to render shadows if (additionalData.WillRenderShadowMap()) { - additionalData.ReserveShadowMap(hdCamera.camera, m_ShadowManager, hdShadowSettings, m_ShadowInitParameters, light.screenRect, lightType); + additionalData.ReserveShadowMap(hdCamera.camera, m_ShadowManager, hdShadowSettings, m_ShadowInitParameters, light, lightType); } // Reserve the cookie resolution in the 2D atlas From 60cb43cee0c3e2d04d3f91336e691e3f322ccba9 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Fri, 23 Oct 2020 11:33:52 +0200 Subject: [PATCH 06/10] Remove unused references of the HDRP asset in decal code (#2326) * Remove perChannelMask * changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/Material/Decal/DecalSystem.cs | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ff19f4c965c..7b0c603c4a4 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -28,6 +28,7 @@ The version number for this package has increased due to a version update of a r - Fixed precision issue with the atmospheric fog. - Claryfied doc for the LayeredLit material. - Fixing exceptions in the console when putting the SSGI in low quality mode (render graph). +- Fixed NullRef Exception when decals are in the scene, no asset is set and HDRP wizard is run. ### Changed - Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs index 0c941042b8b..3e63e05e06e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs @@ -380,8 +380,6 @@ public void InitializeMaterialValues() if (m_Material == null) return; - bool perChannelMask = HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.decalSettings.perChannelMask; - // TODO: this test is ambiguous, it should say, I am decal or not. // We should have 2 function: I am decal or not and I am a SG or not... m_IsHDRenderPipelineDecal = IsHDRenderPipelineDecal(m_Material); @@ -694,7 +692,6 @@ public void CreateDrawData() Vector3 cameraPos = instance.CurrentCamera.transform.position; var camera = instance.CurrentCamera; Matrix4x4 worldToView = HDRenderPipeline.WorldToCamera(camera); - bool perChannelMask = instance.perChannelMask; int cullingMask = camera.cullingMask; ulong sceneCullingMask = HDUtils.GetSceneCullingMaskFromCamera(camera); From a03e874a2b5ea1030ef38b15f84bf4a32a3976af Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 23 Oct 2020 11:36:43 +0200 Subject: [PATCH 07/10] Fix diffusion profile dependency (#2327) * Fixed a nullref when a diffusion profile was created * Updated changelog * Trying to fix diffusion profile asset dependency * Fixed export as package * Updated changelog Co-authored-by: JulienIgnace-Unity --- .../CHANGELOG.md | 4 ++++ .../ShaderGraph/Nodes/DiffusionProfileNode.cs | 12 +++++++++++- .../Slots/DiffusionProfileInputMaterialSlot.cs | 2 +- .../DiffusionProfile/DiffusionProfileSettings.cs | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 7b0c603c4a4..cff49d0e4d4 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. Version Updated The version number for this package has increased due to a version update of a related graphics package. +### Fixed +- Fixed a null reference exception when creating a diffusion profile asset. +- Fixed the diffusion profile not being registered as a dependency of the ShaderGraph. + ### Changed - Improved the punctual light shadow rescale algorithm. diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/DiffusionProfileNode.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/DiffusionProfileNode.cs index 3d6dc0cdc67..81c3b65bfc9 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/DiffusionProfileNode.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/DiffusionProfileNode.cs @@ -15,7 +15,8 @@ namespace UnityEditor.Rendering.HighDefinition [Title("Input", "High Definition Render Pipeline", "Diffusion Profile")] [FormerName("UnityEditor.Experimental.Rendering.HDPipeline.DiffusionProfileNode")] [FormerName("UnityEditor.ShaderGraph.DiffusionProfileNode")] - class DiffusionProfileNode : AbstractMaterialNode, IGeneratesBodyCode, IPropertyFromNode + [HasDependencies(typeof(DiffusionProfileNode))] + class DiffusionProfileNode : AbstractMaterialNode, IGeneratesBodyCode, IPropertyFromNode, IHasDependencies { public DiffusionProfileNode() { @@ -121,5 +122,14 @@ public AbstractShaderProperty AsShaderProperty() } public int outputSlotId => kOutputSlotId; + + public void GetSourceAssetDependencies(AssetCollection assetCollection) + { + if ((diffusionProfile != null) && AssetDatabase.TryGetGUIDAndLocalFileIdentifier(diffusionProfile, out string guid, out long localId)) + { + // diffusion profile is a ScriptableObject, so this is an artifact dependency + assetCollection.AddAssetDependency(new GUID(guid), AssetCollection.Flags.ArtifactDependency | AssetCollection.Flags.IncludeInExportPackage); + } + } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs index 6f471914a1b..acdd2a86cc5 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs @@ -162,7 +162,7 @@ public void GetSourceAssetDependencies(AssetCollection assetCollection) if ((diffusionProfile != null) && AssetDatabase.TryGetGUIDAndLocalFileIdentifier(diffusionProfile, out string guid, out long localId)) { // diffusion profile is a ScriptableObject, so this is an artifact dependency - assetCollection.AddAssetDependency(new GUID(guid), AssetCollection.Flags.ArtifactDependency); + assetCollection.AddAssetDependency(new GUID(guid), AssetCollection.Flags.ArtifactDependency | AssetCollection.Flags.IncludeInExportPackage); } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/DiffusionProfile/DiffusionProfileSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/DiffusionProfile/DiffusionProfileSettings.cs index a4583e5a608..73d76786719 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/DiffusionProfile/DiffusionProfileSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/DiffusionProfile/DiffusionProfileSettings.cs @@ -232,7 +232,7 @@ void OnEnable() #if UNITY_EDITOR internal void Reset() { - if (profile.hash == 0) + if (profile != null && profile.hash == 0) { profile.ResetToDefault(); profile.hash = DiffusionProfileHashTable.GenerateUniqueHash(this); From 58152f0d68d7a83096fc38cb4e81525c9759ecb3 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Fri, 23 Oct 2020 11:42:11 +0200 Subject: [PATCH 08/10] Standardize naming for Transparent receive SSR (#2329) * Renaming * Changelog * Fix typos --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Material/ShaderGraph/SurfaceOptionPropertyBlock.cs | 2 +- .../Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs | 3 +-- .../Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs | 2 +- .../Editor/Wizard/HDWizard.Window.cs | 8 ++++---- .../Runtime/RenderPipeline/Settings/FrameSettings.cs | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index cff49d0e4d4..59f19ba22bd 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -36,6 +36,7 @@ The version number for this package has increased due to a version update of a r ### Changed - Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass. +- Standardized naming for the option regarding Transparent objects being able to receive Screen Space Reflections. ## [10.1.0] - 2020-10-12 diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceOptionPropertyBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceOptionPropertyBlock.cs index dc3290a3f0e..f36b289675c 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceOptionPropertyBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceOptionPropertyBlock.cs @@ -104,7 +104,7 @@ protected override void CreatePropertyGUI() AddProperty(supportDecalsText, () => lightingData.receiveDecals, (newValue) => lightingData.receiveDecals = newValue); if (systemData.surfaceType == SurfaceType.Transparent) - AddProperty(receivesSSRTransparentText, () => lightingData.receiveSSRTransparent, (newValue) => lightingData.receiveSSRTransparent = newValue); + AddProperty(receivesSSRText, () => lightingData.receiveSSRTransparent, (newValue) => lightingData.receiveSSRTransparent = newValue); else AddProperty(receivesSSRText, () => lightingData.receiveSSR, (newValue) => lightingData.receiveSSR = newValue); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs index 39ea7e6284f..a0f617d5485 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs @@ -106,7 +106,6 @@ internal static class Styles // SSR public static GUIContent receivesSSRText = new GUIContent("Receive SSR", "When enabled, this Material can receive screen space reflections."); - public static GUIContent receivesSSRTransparentText = new GUIContent("Receive SSR Transparent", "When enabled, this Material can receive screen space reflections."); public static GUIContent opaqueCullModeText = new GUIContent("Cull Mode", "For opaque objects, change the cull mode of the object."); @@ -763,7 +762,7 @@ void DrawLitSurfaceOptions() { // Based on the surface type, display the right recieveSSR option if (surfaceTypeValue == SurfaceType.Transparent) - materialEditor.ShaderProperty(receivesSSRTransparent, Styles.receivesSSRTransparentText); + materialEditor.ShaderProperty(receivesSSRTransparent, Styles.receivesSSRText); else materialEditor.ShaderProperty(receivesSSR, Styles.receivesSSRText); } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs index be814317d7d..c7d413efef9 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs @@ -85,7 +85,7 @@ public class GeneralSection public static readonly GUIContent supportShadowMaskContent = EditorGUIUtility.TrTextContent("Shadowmask", "When enabled, HDRP allocates Shader variants and memory for processing shadow masks. This allows you to use shadow masks in your Unity Project."); public static readonly GUIContent supportSSRContent = EditorGUIUtility.TrTextContent("Screen Space Reflection", "When enabled, HDRP allocates memory for processing screen space reflection (SSR). This allows you to use SSR in your Unity Project."); public static readonly GUIContent planarResolutionTitle = EditorGUIUtility.TrTextContent("Planar Resolution Tiers"); - public static readonly GUIContent supportSSRTransparentContent = EditorGUIUtility.TrTextContent("Transparent Screen Space Reflection", "When enabled, HDRP executes additional steps to achieve screen space reflection (SSR) on transparent objects."); + public static readonly GUIContent supportSSRTransparentContent = EditorGUIUtility.TrTextContent("Transparents receive SSR", "When enabled, HDRP executes additional steps to achieve screen space reflection (SSR) on transparent objects."); public static readonly GUIContent supportSSAOContent = EditorGUIUtility.TrTextContent("Screen Space Ambient Occlusion", "When enabled, HDRP allocates memory for processing screen space ambient occlusion (SSAO). This allows you to use SSAO in your Unity Project."); public static readonly GUIContent supportSSGIContent = EditorGUIUtility.TrTextContent("Screen Space Global Illumination", "When enabled, HDRP allocates memory for processing screen space global illumination (SSGI). This allows you to use SSGI in your Unity Project."); public static readonly GUIContent supportedSSSContent = EditorGUIUtility.TrTextContent("Subsurface Scattering", "When enabled, HDRP allocates memory for processing subsurface scattering (SSS). This allows you to use SSS in your Unity Project."); diff --git a/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Window.cs b/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Window.cs index ab43e5fc1f5..55f897962c0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Window.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Window.cs @@ -141,13 +141,13 @@ public ConfigStyle(string label, string error, string button = resolve, MessageT error: "Screen Space Shadows are disabled in the current HDRP asset. You will not be able to toggle ray traced shadows on the lights in your scene. You can enable the feature in the HDRP asset under Lighting -> Shadows -> Screen Space Shadows", messageType: MessageType.Info); public static readonly ConfigStyle dxrReflections = new ConfigStyle( label: "Reflections", - error: "Screen Space Reflections are disabled in the current HDRP asset. You will not be able to toggle ray traced reflections though your volume components. You can enable the feature in the HDRP asset under Lighting -> Reflections -> Screen Space Reflections", messageType: MessageType.Info); + error: "Screen Space Reflections are disabled in the current HDRP asset. You will not be able to toggle ray traced reflections through your volume components. You can enable the feature in the HDRP asset under Lighting -> Reflections -> Screen Space Reflections", messageType: MessageType.Info); public static readonly ConfigStyle dxrTransparentReflections = new ConfigStyle( - label: "Transparent Reflections", - error: "Transparent Screen Space Reflections are disabled in the current HDRP asset. You will not be able to toggle ray traced reflections on transparent objects though your volume components. You can enable the feature in the HDRP asset under Lighting -> Reflections -> Transparent Screen Space Reflections", messageType: MessageType.Info); + label: "Transparents receive SSR", + error: "The Transparents receive SSR option is disabled in the current HDRP asset. You will not be able to toggle ray traced reflections on transparent objects through your volume components. You can enable the feature in the HDRP asset under Lighting -> Reflections -> Transparent receive SSR ", messageType: MessageType.Info); public static readonly ConfigStyle dxrGI = new ConfigStyle( label: "Global Illumination", - error: "Screen Space Global Illumination is disabled in the current HDRP asset. You will not be able to toggle ray global illumination though your volume components. You can enable the feature in the HDRP asset under Lighting -> Screen Space Global Illumination", messageType: MessageType.Info); + error: "Screen Space Global Illumination is disabled in the current HDRP asset. You will not be able to toggle ray global illumination through your volume components. You can enable the feature in the HDRP asset under Lighting -> Screen Space Global Illumination", messageType: MessageType.Info); public static readonly ConfigStyle dxr64bits = new ConfigStyle( label: "Architecture 64 bits", error: "To build your Project to a Unity Player, ray tracing requires that the build uses 64 bit architecture."); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs index 02a37ee6c7a..9994e65e288 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs @@ -250,8 +250,8 @@ public enum FrameSettingsField /// When enabled, Cameras using these Frame Settings calculate Screen Space Reflections. [FrameSettingsField(1, displayedName: "Screen Space Reflection", tooltip: "When enabled, Cameras using these Frame Settings calculate Screen Space Reflections (Depends on \"Screen Space Reflection\" in current HDRP Asset).")] SSR = 23, - /// When enabled, Cameras using these Frame Settings calculate Transparent Screen Space Reflections. - [FrameSettingsField(1, displayedName: "On Transparent", customOrderInGroup: 25, positiveDependencies: new[] { SSR }, tooltip: "When enabled, Cameras using these Frame Settings calculate Screen Space Reflections on transparent objects.")] + /// When enabled, Cameras using these Frame Settings calculate Screen Space Reflections on transparent objects. + [FrameSettingsField(1, displayedName: "Transparents receive SSR", customOrderInGroup: 25, positiveDependencies: new[] { SSR }, tooltip: "When enabled, Cameras using these Frame Settings calculate Screen Space Reflections on transparent objects.")] TransparentSSR = 94, /// When enabled, Cameras using these Frame Settings calculate Screen Space Ambient Occlusion. [FrameSettingsField(1, displayedName: "Screen Space Ambient Occlusion", tooltip: "When enabled, Cameras using these Frame Settings calculate Screen Space Ambient Occlusion (Depends on \"Screen Space Ambient Occlusion\" in current HDRP Asset).")] From b1becb185fb9802b524ddd99669f67231a7083b8 Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Fri, 23 Oct 2020 11:58:38 +0200 Subject: [PATCH 09/10] Fix volument component creation via script --- .../Runtime/Volume/VolumeProfile.cs | 4 ++++ .../CHANGELOG.md | 17 ++--------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs index a687a86fb4d..4e97e2f1f92 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs @@ -75,6 +75,10 @@ public VolumeComponent Add(Type type, bool overrides = false) throw new InvalidOperationException("Component already exists in the volume"); var component = (VolumeComponent)CreateInstance(type); +#if UNITY_EDITOR + component.hideFlags = HideFlags.HideInInspector | HideFlags.HideInHierarchy; + component.name = type.Name; +#endif component.SetAllOverridesTo(overrides); components.Add(component); isDirty = true; diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index bc6b2b5da4e..632018ea15f 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -9,19 +9,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. Version Updated The version number for this package has increased due to a version update of a related graphics package. -### Fixed -- Fixed a null reference exception when creating a diffusion profile asset. -- Fixed the diffusion profile not being registered as a dependency of the ShaderGraph. - -### Changed -- Improved the punctual light shadow rescale algorithm. - ## [10.2.0] - 2020-10-19 ### Added - Added a rough distortion frame setting and and info box on distortion materials. - Adding support of 4 channel tex coords for ray tracing (case 1265309). -- Added a help button on the volume component toolbar for documentation. +- Fix volument component creation via script. ### Fixed - Fixed an issue where the Exposure Shader Graph node had clipped text. (case 1265057) @@ -32,15 +25,10 @@ The version number for this package has increased due to a version update of a r - Fixed upside down XR occlusion mesh. - Fixed precision issue with the atmospheric fog. - Fixed issue with TAA and no motion vectors. -- Fixed the stripping not working the terrain alphatest feature required for terrain holes (case 1205902). -- Fixing exceptions in the console when putting the SSGI in low quality mode (render graph). -- Fixed NullRef Exception when decals are in the scene, no asset is set and HDRP wizard is run. ### Changed - Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass. - Claryfied doc for the LayeredLit material. -- Various improvements for the Volumetric Fog. -- Standardized naming for the option regarding Transparent objects being able to receive Screen Space Reflections. ## [10.1.0] - 2020-10-12 @@ -78,7 +66,6 @@ The version number for this package has increased due to a version update of a r - Adding missing marker for ray tracing profiling (RaytracingDeferredLighting) - Added the support of eye shader for ray tracing. - Exposed Refraction Model to the material UI when using a Lit ShaderGraph. -- Added frame setting for Virtual Texturing. ### Fixed - Fixed several issues with physically-based DoF (TAA ghosting of the CoC buffer, smooth layer transitions, etc) @@ -207,7 +194,7 @@ The version number for this package has increased due to a version update of a r - Fixed issue that caused non-static object to not render at times in OnEnable reflection probes. - Baked reflection probes now correctly use static sky for ambient lighting. - Use draggable fields for float scalable settings -- Fixed undo after enabling compositor. +- Fixed scene picking passes. ### Changed - Preparation pass for RTSSShadows to be supported by render graph. From 890765b0157e1671960d42d6fd7a74f7ab0c9d9a Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Fri, 23 Oct 2020 12:02:41 +0200 Subject: [PATCH 10/10] changelog --- .../CHANGELOG.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 632018ea15f..96820fd966e 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -9,11 +9,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. Version Updated The version number for this package has increased due to a version update of a related graphics package. +### Fixed +- Fixed a null reference exception when creating a diffusion profile asset. +- Fixed the diffusion profile not being registered as a dependency of the ShaderGraph. + +### Changed +- Improved the punctual light shadow rescale algorithm. + ## [10.2.0] - 2020-10-19 ### Added - Added a rough distortion frame setting and and info box on distortion materials. - Adding support of 4 channel tex coords for ray tracing (case 1265309). +- Added a help button on the volume component toolbar for documentation. - Fix volument component creation via script. ### Fixed @@ -25,10 +33,15 @@ The version number for this package has increased due to a version update of a r - Fixed upside down XR occlusion mesh. - Fixed precision issue with the atmospheric fog. - Fixed issue with TAA and no motion vectors. +- Fixed the stripping not working the terrain alphatest feature required for terrain holes (case 1205902). +- Fixing exceptions in the console when putting the SSGI in low quality mode (render graph). +- Fixed NullRef Exception when decals are in the scene, no asset is set and HDRP wizard is run. ### Changed - Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass. - Claryfied doc for the LayeredLit material. +- Various improvements for the Volumetric Fog. +- Standardized naming for the option regarding Transparent objects being able to receive Screen Space Reflections. ## [10.1.0] - 2020-10-12 @@ -66,6 +79,7 @@ The version number for this package has increased due to a version update of a r - Adding missing marker for ray tracing profiling (RaytracingDeferredLighting) - Added the support of eye shader for ray tracing. - Exposed Refraction Model to the material UI when using a Lit ShaderGraph. +- Added frame setting for Virtual Texturing. ### Fixed - Fixed several issues with physically-based DoF (TAA ghosting of the CoC buffer, smooth layer transitions, etc) @@ -194,7 +208,7 @@ The version number for this package has increased due to a version update of a r - Fixed issue that caused non-static object to not render at times in OnEnable reflection probes. - Baked reflection probes now correctly use static sky for ambient lighting. - Use draggable fields for float scalable settings -- Fixed scene picking passes. +- Fixed undo after enabling compositor. ### Changed - Preparation pass for RTSSShadows to be supported by render graph.