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/41] 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/41] 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/41] 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/41] 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/41] 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/41] 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/41] 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/41] 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 ac15c4349ca09c335526a825e63fb4926277e1b1 Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Fri, 23 Oct 2020 11:52:24 +0200 Subject: [PATCH 09/41] Revert "Standardize naming for Transparent receive SSR (#2329)" This reverts commit 58152f0d68d7a83096fc38cb4e81525c9759ecb3. # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md --- 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 bc6b2b5da4e..cfb5002d1e9 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -40,7 +40,6 @@ The version number for this package has increased due to a version update of a r - 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 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 f36b289675c..dc3290a3f0e 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(receivesSSRText, () => lightingData.receiveSSRTransparent, (newValue) => lightingData.receiveSSRTransparent = newValue); + AddProperty(receivesSSRTransparentText, () => 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 a0f617d5485..39ea7e6284f 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,6 +106,7 @@ 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."); @@ -762,7 +763,7 @@ void DrawLitSurfaceOptions() { // Based on the surface type, display the right recieveSSR option if (surfaceTypeValue == SurfaceType.Transparent) - materialEditor.ShaderProperty(receivesSSRTransparent, Styles.receivesSSRText); + materialEditor.ShaderProperty(receivesSSRTransparent, Styles.receivesSSRTransparentText); 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 c7d413efef9..be814317d7d 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("Transparents receive SSR", "When enabled, HDRP executes additional steps to achieve screen space reflection (SSR) on transparent objects."); + 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 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 55f897962c0..ab43e5fc1f5 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 through 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 though 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: "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); + 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); 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 through 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 though 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 9994e65e288..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 @@ -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 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.")] + /// 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.")] 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 43339d1830d350d47acfdab34ebfe9e7ed478fbc Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Fri, 23 Oct 2020 11:56:04 +0200 Subject: [PATCH 10/41] Improvements to the DXR Wizard (#2295) * - Now the DXR wizard displays the name of the target asset that needs to be changed. - The DXR wizard displays asset changes as warnings and default frame settings as infos. - Added the status check of default camera frame settings in the DXR wizard. * review corrections Co-authored-by: JulienIgnace-Unity --- .../ProjectSettings/ProjectSettings.asset | 98 +++++++++---------- .../CHANGELOG.md | 2 + .../Editor/USS/Wizard.uss | 4 +- .../Editor/Wizard/HDWizard.Configuration.cs | 70 +++++++++++-- .../Editor/Wizard/HDWizard.Window.cs | 44 +++++++-- 5 files changed, 145 insertions(+), 73 deletions(-) diff --git a/TestProjects/HDRP_DXR_Tests/ProjectSettings/ProjectSettings.asset b/TestProjects/HDRP_DXR_Tests/ProjectSettings/ProjectSettings.asset index 9155c13664f..104d47fd624 100644 --- a/TestProjects/HDRP_DXR_Tests/ProjectSettings/ProjectSettings.asset +++ b/TestProjects/HDRP_DXR_Tests/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,7 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 20 + serializedVersion: 21 productGUID: 504231709d29f6341950ddd13dd16f85 AndroidProfiler: 0 AndroidFilterTouchesWhenObscured: 0 @@ -113,8 +113,14 @@ PlayerSettings: switchNVNShaderPoolsGranularity: 33554432 switchNVNDefaultPoolsGranularity: 16777216 switchNVNOtherPoolsGranularity: 16777216 + switchNVNMaxPublicTextureIDCount: 0 + switchNVNMaxPublicSamplerIDCount: 0 + stadiaPresentMode: 0 + stadiaTargetFramerate: 0 vulkanNumSwapchainBuffers: 3 vulkanEnableSetSRGBWrite: 0 + vulkanEnablePreTransform: 0 + vulkanEnableLateAcquireNextImage: 0 m_SupportedAspectRatios: 4:3: 1 5:4: 1 @@ -129,31 +135,6 @@ PlayerSettings: xboxOneDisableKinectGpuReservation: 0 xboxOneEnable7thCore: 0 vrSettings: - cardboard: - depthFormat: 0 - enableTransitionView: 0 - daydream: - depthFormat: 0 - useSustainedPerformanceMode: 0 - enableVideoLayer: 0 - useProtectedVideoMemory: 0 - minimumSupportedHeadTracking: 0 - maximumSupportedHeadTracking: 1 - hololens: - depthFormat: 1 - depthBufferSharingEnabled: 0 - lumin: - depthFormat: 0 - frameTiming: 2 - enableGLCache: 0 - glCacheMaxBlobSize: 524288 - glCacheMaxFileSize: 8388608 - oculus: - sharedDepthBuffer: 1 - dashSupport: 1 - lowOverheadMode: 0 - protectedContext: 0 - v2Signing: 1 enable360StereoCapture: 0 isWsaHolographicRemotingEnabled: 0 enableFrameTimingStats: 0 @@ -164,8 +145,13 @@ PlayerSettings: resolutionScalingMode: 0 androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 - applicationIdentifier: {} - buildNumber: {} + applicationIdentifier: + Standalone: com.DefaultCompany.HDRPDXRTests + buildNumber: + Standalone: 0 + iPhone: 0 + tvOS: 0 + overrideDefaultApplicationIdentifier: 0 AndroidBundleVersionCode: 1 AndroidMinSdkVersion: 19 AndroidTargetSdkVersion: 0 @@ -192,22 +178,6 @@ PlayerSettings: uIStatusBarHidden: 1 uIExitOnSuspend: 0 uIStatusBarStyle: 0 - iPhoneSplashScreen: {fileID: 0} - iPhoneHighResSplashScreen: {fileID: 0} - iPhoneTallHighResSplashScreen: {fileID: 0} - iPhone47inSplashScreen: {fileID: 0} - iPhone55inPortraitSplashScreen: {fileID: 0} - iPhone55inLandscapeSplashScreen: {fileID: 0} - iPhone58inPortraitSplashScreen: {fileID: 0} - iPhone58inLandscapeSplashScreen: {fileID: 0} - iPadPortraitSplashScreen: {fileID: 0} - iPadHighResPortraitSplashScreen: {fileID: 0} - iPadLandscapeSplashScreen: {fileID: 0} - iPadHighResLandscapeSplashScreen: {fileID: 0} - iPhone65inPortraitSplashScreen: {fileID: 0} - iPhone65inLandscapeSplashScreen: {fileID: 0} - iPhone61inPortraitSplashScreen: {fileID: 0} - iPhone61inLandscapeSplashScreen: {fileID: 0} appleTVSplashScreen: {fileID: 0} appleTVSplashScreen2x: {fileID: 0} tvOSSmallIconLayers: [] @@ -235,8 +205,8 @@ PlayerSettings: iOSLaunchScreeniPadFillPct: 100 iOSLaunchScreeniPadSize: 100 iOSLaunchScreeniPadCustomXibPath: - iOSUseLaunchScreenStoryboard: 0 iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: iOSDeviceRequirements: [] iOSURLSchemes: [] iOSBackgroundModes: 0 @@ -244,6 +214,7 @@ PlayerSettings: metalEditorSupport: 1 metalAPIValidation: 1 iOSRenderExtraFrameOnPause: 0 + iosCopyPluginsCodeInsteadOfSymlink: 0 appleDeveloperTeamID: iOSManualSigningProvisioningProfileID: tvOSManualSigningProvisioningProfileID: @@ -253,9 +224,17 @@ PlayerSettings: iOSRequireARKit: 0 iOSAutomaticallyDetectAndAddCapabilities: 1 appleEnableProMotion: 0 + shaderPrecisionModel: 0 clonedFromGUID: 7aaaa0dc1bd27d24f84a19b5893c8bae templatePackageId: com.unity.template.hd@3.5.0-preview templateDefaultScene: Assets/Scenes/SampleScene.unity + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomProguardFile: 0 AndroidTargetArchitectures: 1 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} @@ -273,13 +252,16 @@ PlayerSettings: height: 180 banner: {fileID: 0} androidGamepadSupportLevel: 0 + AndroidMinifyWithR8: 0 + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 AndroidValidateAppBundleSize: 1 AndroidAppBundleSizeToValidate: 100 m_BuildTargetIcons: [] m_BuildTargetPlatformIcons: [] m_BuildTargetBatching: - m_BuildTarget: Standalone - m_StaticBatching: 1 + m_StaticBatching: 0 m_DynamicBatching: 0 - m_BuildTarget: tvOS m_StaticBatching: 1 @@ -334,7 +316,7 @@ PlayerSettings: m_Automatic: 1 - m_BuildTarget: AppleTVSupport m_APIs: 10000000 - m_Automatic: 0 + m_Automatic: 1 - m_BuildTarget: WebGLSupport m_APIs: 0b000000 m_Automatic: 1 @@ -368,6 +350,7 @@ PlayerSettings: - m_BuildTarget: Windows Store Apps m_EncodingQuality: 2 m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetNormalMapEncoding: [] playModeTestRunnerEnabled: 0 runPlayModeTestAsEditModeTest: 0 actionOnDotNetUnhandledException: 1 @@ -509,6 +492,7 @@ PlayerSettings: switchSocketInitializeEnabled: 1 switchNetworkInterfaceManagerInitializeEnabled: 1 switchPlayerConnectionEnabled: 1 + switchUseNewStyleFilepaths: 0 ps4NPAgeRating: 12 ps4NPTitleSecret: ps4NPTrophyPackPath: @@ -535,6 +519,7 @@ PlayerSettings: ps4ShareFilePath: ps4ShareOverlayImagePath: ps4PrivacyGuardImagePath: + ps4ExtraSceSysFile: ps4NPtitleDatPath: ps4RemotePlayKeyAssignment: -1 ps4RemotePlayKeyMappingDir: @@ -560,6 +545,7 @@ PlayerSettings: ps4UseResolutionFallback: 0 ps4ReprojectionSupport: 0 ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 ps4SocialScreenEnabled: 0 ps4ScriptOptimizationLevel: 0 ps4Audio3dVirtualSpeakerCount: 14 @@ -576,6 +562,8 @@ PlayerSettings: ps4disableAutoHideSplash: 0 ps4videoRecordingFeaturesUsed: 0 ps4contentSearchFeaturesUsed: 0 + ps4CompatibilityPS5: 0 + ps4GPU800MHz: 1 ps4attribEyeToEyeDistanceSettingVR: 0 ps4IncludedModules: - libc.prx @@ -606,17 +594,23 @@ PlayerSettings: webGLAnalyzeBuildSize: 0 webGLUseEmbeddedResources: 0 webGLCompressionFormat: 1 + webGLWasmArithmeticExceptions: 0 webGLLinkerTarget: 1 webGLThreadsSupport: 0 webGLDecompressionFallback: 0 scriptingDefineSymbols: 1: UNITY_HDRP_DXR_TESTS_DEFINE;ENABLE_RAYTRACING + additionalCompilerArguments: {} platformArchitecture: {} scriptingBackend: {} il2cppCompilerConfiguration: {} managedStrippingLevel: {} incrementalIl2cppBuild: {} + suppressCommonWarnings: 1 allowUnsafeCode: 0 + useDeterministicCompilation: 1 + useReferenceAssemblies: 1 + enableRoslynAnalyzers: 1 additionalIl2CppArgs: scriptingRuntimeVersion: 1 gcIncremental: 0 @@ -676,10 +670,8 @@ PlayerSettings: XboxOnePersistentLocalStorageSize: 0 XboxOneXTitleMemory: 8 XboxOneOverrideIdentityName: - vrEditorSettings: - daydream: - daydreamIconForeground: {fileID: 0} - daydreamIconBackground: {fileID: 0} + XboxOneOverrideIdentityPublisher: + vrEditorSettings: {} cloudServicesEnabled: UNet: 1 luminIcon: @@ -694,12 +686,12 @@ PlayerSettings: m_VersionCode: 1 m_VersionName: apiCompatibilityLevel: 6 + activeInputHandler: 0 cloudProjectId: framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] projectName: organizationId: cloudEnabled: 0 - enableNativePlatformBackendsForNewInputSystem: 0 - disableOldInputManagerSupport: 0 legacyClampBlendShapeWeights: 0 virtualTexturingSupportEnabled: 0 diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index cfb5002d1e9..fa03fa7fb84 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -22,6 +22,7 @@ The version number for this package has increased due to a version update of a r - 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. +- Added the status check of default camera frame settings in the DXR wizard. ### Fixed - Fixed an issue where the Exposure Shader Graph node had clipped text. (case 1265057) @@ -40,6 +41,7 @@ The version number for this package has increased due to a version update of a r - 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. +- Now the DXR wizard displays the name of the target asset that needs to be changed. ## [10.1.0] - 2020-10-12 diff --git a/com.unity.render-pipelines.high-definition/Editor/USS/Wizard.uss b/com.unity.render-pipelines.high-definition/Editor/USS/Wizard.uss index 1b285aa03b5..de39bea3f84 100644 --- a/com.unity.render-pipelines.high-definition/Editor/USS/Wizard.uss +++ b/com.unity.render-pipelines.high-definition/Editor/USS/Wizard.uss @@ -3,7 +3,7 @@ width: 12px; height: 12px; position: absolute; - left: 180px; + left: 325px; } #DefaultResourceFolder > Label, #NewScene > Label, #NewDXRScene > Label @@ -13,7 +13,7 @@ #TestLabel { - width: 180px; + width: 325px; } #Resolver diff --git a/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs b/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs index 04181ba6c87..5f77883e485 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs @@ -126,15 +126,18 @@ struct Entry public readonly int indent; public readonly bool forceDisplayCheck; public readonly bool skipErrorIcon; - public Entry(InclusiveScope scope, Style.ConfigStyle configStyle, Checker check, Fixer fix, bool forceDisplayCheck = false, bool skipErrorIcon = false) + public readonly bool displayAssetName; + + public Entry(InclusiveScope scope, Style.ConfigStyle configStyle, Checker check, Fixer fix, bool forceDisplayCheck = false, bool skipErrorIcon = false, bool displayAssetName = false) { this.scope = scope; this.configStyle = configStyle; this.check = check; this.fix = fix; this.forceDisplayCheck = forceDisplayCheck; - indent = scope == InclusiveScope.HDRPAsset || scope == InclusiveScope.XRManagement || scope == InclusiveScope.DXROptional ? 1 : 0; + indent = scope == InclusiveScope.HDRPAsset || scope == InclusiveScope.XRManagement ? 1 : 0; this.skipErrorIcon = skipErrorIcon; + this.displayAssetName = displayAssetName; } } @@ -177,11 +180,14 @@ Entry[] entries new Entry(InclusiveScope.DXR, Style.dxrResources, IsDXRAssetCorrect, FixDXRAsset), // Optional checks - new Entry(InclusiveScope.DXROptional, Style.dxrScreenSpaceShadow, IsDXRScreenSpaceShadowCorrect, null, forceDisplayCheck: true, skipErrorIcon: true), - new Entry(InclusiveScope.DXROptional, Style.dxrReflections, IsDXRReflectionsCorrect, null, forceDisplayCheck: true, skipErrorIcon: true), - new Entry(InclusiveScope.DXROptional, Style.dxrTransparentReflections, IsDXRTransparentReflectionsCorrect, null, forceDisplayCheck: true, skipErrorIcon: true), - new Entry(InclusiveScope.DXROptional, Style.dxrGI, IsDXRGICorrect, null, forceDisplayCheck: true, skipErrorIcon: true), - + new Entry(InclusiveScope.DXROptional, Style.dxrScreenSpaceShadow, IsDXRScreenSpaceShadowCorrect, null, forceDisplayCheck: true, skipErrorIcon: true, displayAssetName: true), + new Entry(InclusiveScope.DXROptional, Style.dxrScreenSpaceShadowFS, IsDXRScreenSpaceShadowFSCorrect, null, forceDisplayCheck: true, skipErrorIcon: true, displayAssetName: true), + new Entry(InclusiveScope.DXROptional, Style.dxrReflections, IsDXRReflectionsCorrect, null, forceDisplayCheck: true, skipErrorIcon: true, displayAssetName: true), + new Entry(InclusiveScope.DXROptional, Style.dxrReflectionsFS, IsDXRReflectionsFSCorrect, null, forceDisplayCheck: true, skipErrorIcon: true, displayAssetName: true), + new Entry(InclusiveScope.DXROptional, Style.dxrTransparentReflections, IsDXRTransparentReflectionsCorrect, null, forceDisplayCheck: true, skipErrorIcon: true, displayAssetName: true), + new Entry(InclusiveScope.DXROptional, Style.dxrTransparentReflectionsFS, IsDXRTransparentReflectionsFSCorrect, null, forceDisplayCheck: true, skipErrorIcon: true, displayAssetName: true), + new Entry(InclusiveScope.DXROptional, Style.dxrGI, IsDXRGICorrect, null, forceDisplayCheck: true, skipErrorIcon: true, displayAssetName: true), + new Entry(InclusiveScope.DXROptional, Style.dxrGIFS, IsDXRGIFSCorrect, null, forceDisplayCheck: true, skipErrorIcon: true, displayAssetName: true), }; return m_Entries; } @@ -652,19 +658,67 @@ bool IsDXRScreenSpaceShadowCorrect() => HDRenderPipeline.currentAsset != null && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.hdShadowInitParams.supportScreenSpaceShadows; + bool IsDXRScreenSpaceShadowFSCorrect() + { + HDRenderPipelineAsset hdrpAsset = HDRenderPipeline.currentAsset; + if (hdrpAsset != null) + { + FrameSettings defaultCameraFS = hdrpAsset.GetDefaultFrameSettings(FrameSettingsRenderType.Camera); + return defaultCameraFS.IsEnabled(FrameSettingsField.ScreenSpaceShadows); + } + else + return false; + } + bool IsDXRReflectionsCorrect() => HDRenderPipeline.currentAsset != null && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportSSR; + bool IsDXRReflectionsFSCorrect() + { + HDRenderPipelineAsset hdrpAsset = HDRenderPipeline.currentAsset; + if (hdrpAsset != null) + { + FrameSettings defaultCameraFS = hdrpAsset.GetDefaultFrameSettings(FrameSettingsRenderType.Camera); + return defaultCameraFS.IsEnabled(FrameSettingsField.SSR); + } + else + return false; + } + bool IsDXRTransparentReflectionsCorrect() => HDRenderPipeline.currentAsset != null && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportSSRTransparent; + bool IsDXRTransparentReflectionsFSCorrect() + { + HDRenderPipelineAsset hdrpAsset = HDRenderPipeline.currentAsset; + if (hdrpAsset != null) + { + FrameSettings defaultCameraFS = hdrpAsset.GetDefaultFrameSettings(FrameSettingsRenderType.Camera); + return defaultCameraFS.IsEnabled(FrameSettingsField.TransparentSSR); + } + else + return false; + } + bool IsDXRGICorrect() => HDRenderPipeline.currentAsset != null && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportSSGI; - bool IsArchitecture64Bits() + bool IsDXRGIFSCorrect() + { + HDRenderPipelineAsset hdrpAsset = HDRenderPipeline.currentAsset; + if (hdrpAsset != null) + { + FrameSettings defaultCameraFS = hdrpAsset.GetDefaultFrameSettings(FrameSettingsRenderType.Camera); + return defaultCameraFS.IsEnabled(FrameSettingsField.SSGI); + } + else + return false; + } + + bool IsArchitecture64Bits() => EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows64; void FixArchitecture64Bits(bool fromAsyncUnused) { 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..dfa8ab52429 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 @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Rendering.HighDefinition; using System.Runtime.InteropServices; using UnityEngine.UIElements; using UnityEditor.UIElements; @@ -137,18 +138,30 @@ public ConfigStyle(string label, string error, string button = resolve, MessageT label: "Direct3D 12", error: "Direct3D 12 is needed! (Editor restart is required)"); public static readonly ConfigStyle dxrScreenSpaceShadow = new ConfigStyle( - label: "Screen Space Shadow", - 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); + label: "Screen Space Shadows (Asset)", + error: "Screen Space Shadows are disabled in the current HDRP Asset which means you cannot enable ray-traced shadows for lights in your scene. To enable this feature, open your HDRP Asset, go to Lighting > Shadows, and enable Screen Space Shadows", messageType: MessageType.Warning); + public static readonly ConfigStyle dxrScreenSpaceShadowFS = new ConfigStyle( + label: "Screen Space Shadows (Default Camera Frame Setting)", + error: "Screen Space Shadows are disabled in the default Camera Frame Settings. This means Cameras that use these Frame Settings do not render ray-traced shadows. To enable this feature, go to Project Settings > HDRP Default Settings > Frame Settings > Default Frame Settings For Camera > Lighting and enable 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); + label: "Reflection (Asset)", + error: "Screen Space Reflection is disabled in the current HDRP Asset which means you cannot enable ray-traced reflections in Volume components. To enable this feature, open your HDRP Asset, go to Lighting > Reflections, and enable Screen Space Reflections", messageType: MessageType.Warning); + public static readonly ConfigStyle dxrReflectionsFS = new ConfigStyle( + label: "Reflection (Default Camera Frame Setting)", + error: "Screen Space Reflection is disabled in the default Camera Frame Settings. This means Cameras that use these Frame Settings do not render ray-traced reflections. To enable this feature, go to Project Settings > HDRP Default Settings > Frame Settings > Default Frame Settings For Camera > Lighting and enable 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: "Transparent Reflection (Asset)", + error: "Transparent Screen Space Reflection is disabled in the current HDRP Asset which means you cannot enable ray-traced reflections for transparent GameObjects from Volume components. To enable this feature, open your HDRP Asset, go to Lighting > Reflections, and enable Transparent Screen Space Reflections", messageType: MessageType.Warning); + public static readonly ConfigStyle dxrTransparentReflectionsFS = new ConfigStyle( + label: "Transparent Reflection (Default Camera Frame Setting)", + error: "Transparent Screen Space Reflection is disabled in the default Camera Frame Settings. This means Cameras that use these Frame Settings do not render ray-traced reflections for transparent GameObjects. To enable this feature, go to Project Settings > HDRP Default Settings > Frame Settings > Default Frame Settings For Camera > Lighting and enable On Transparent", 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); - public static readonly ConfigStyle dxr64bits = new ConfigStyle( + label: "Global Illumination (Asset)", + error: "Screen Space Global Illumination is disabled in the current HDRP asset which means you cannot enable ray-traced global illumination in Volume components. To enable this feature, open your HDRP Asset, go to Lighting and enable Screen Space Global Illumination", messageType: MessageType.Warning); + public static readonly ConfigStyle dxrGIFS = new ConfigStyle( + label: "Global Illumination (Default Camera Frame Setting)", + error: "Screen Space Global Illumination is disabled in the default Camera Frame Settings. This means Cameras that use these Frame Settings do not render ray-traced global illumination. To enable this feature, go to Project Settings > HDRP Default Settings > Frame Settings > Default Frame Settings For Camera > Lighting and enable 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."); public static readonly ConfigStyle dxrStaticBatching = new ConfigStyle( @@ -481,9 +494,19 @@ void UpdateDisplayOfConfigPackageArea(ConfigPackageState state) void GroupEntriesForDisplay(VisualElement container, InclusiveScope filter) { foreach (var entry in entries.Where(e => filter.Contains(e.scope))) + { + string error = entry.configStyle.error; + + // If it is necessary, append tht name of the current asset. + var hdrpAsset = HDRenderPipeline.currentAsset; + if (entry.displayAssetName && hdrpAsset != null) + { + error += " (" + hdrpAsset.name +")."; + } + container.Add(new ConfigInfoLine( entry.configStyle.label, - entry.configStyle.error, + error, entry.configStyle.messageType, entry.configStyle.button, () => entry.check(), @@ -491,6 +514,7 @@ void GroupEntriesForDisplay(VisualElement container, InclusiveScope filter) entry.indent, entry.configStyle.messageType == MessageType.Error || entry.forceDisplayCheck, entry.skipErrorIcon)); + } } void AddHDRPConfigInfo(VisualElement container) From 5f489fdbd7c5b69b80bdffe0fe5687c4f21c3bbe Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 23 Oct 2020 12:19:04 +0200 Subject: [PATCH 11/41] Expose HDRP shader tag IDs and per object config (#2292) * Expose shader pass names API * Updated changelog * exposed per object data in HDUtils * changed constants to accessors * Moved getters to static Co-authored-by: JulienIgnace-Unity --- .../CHANGELOG.md | 3 + .../RenderPipeline/HDStringConstants.cs | 57 ++++++++++++++++--- .../RenderPass/DrawRenderersCustomPass.cs | 2 +- .../Runtime/RenderPipeline/Utility/HDUtils.cs | 5 ++ 4 files changed, 58 insertions(+), 9 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index fa03fa7fb84..dad4210a8a2 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. +### Added +- Exposed the API to access HDRP shader pass names. + ### 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. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs index 84da7ca4a0a..42b8e46b14f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -1,60 +1,101 @@ namespace UnityEngine.Rendering.HighDefinition { - static class HDShaderPassNames + /// Pass names and shader ids used in HDRP. these names can be used as filters when rendering objects in a custom pass or a DrawRenderers() call. + public static class HDShaderPassNames { // ShaderPass string - use to have consistent name through the code + /// Empty pass name. public static readonly string s_EmptyStr = ""; + /// Forward pass name. public static readonly string s_ForwardStr = "Forward"; + /// Depth Only pass name. public static readonly string s_DepthOnlyStr = "DepthOnly"; + /// Depth Forward Only pass name. public static readonly string s_DepthForwardOnlyStr = "DepthForwardOnly"; + /// Forward Only pass name. public static readonly string s_ForwardOnlyStr = "ForwardOnly"; + /// GBuffer pass name. public static readonly string s_GBufferStr = "GBuffer"; + /// GBuffer With Prepass pass name. public static readonly string s_GBufferWithPrepassStr = "GBufferWithPrepass"; + /// Legacy Unlit cross pipeline pass name. public static readonly string s_SRPDefaultUnlitStr = "SRPDefaultUnlit"; + /// Motion Vectors pass name. public static readonly string s_MotionVectorsStr = "MotionVectors"; + /// Distortion Vectors pass name. public static readonly string s_DistortionVectorsStr = "DistortionVectors"; + /// Transparent Depth Prepass pass name. public static readonly string s_TransparentDepthPrepassStr = "TransparentDepthPrepass"; + /// Transparent Backface pass name. public static readonly string s_TransparentBackfaceStr = "TransparentBackface"; + /// Transparent Depth Postpass pass name. public static readonly string s_TransparentDepthPostpassStr = "TransparentDepthPostpass"; + /// RayTracing Prepass pass name. public static readonly string s_RayTracingPrepassStr = "RayTracingPrepass"; + /// Visibility DXR pass name. public static readonly string s_RayTracingVisibilityStr = "VisibilityDXR"; + /// PathTracing DXR pass name. public static readonly string s_PathTracingDXRStr = "PathTracingDXR"; + /// META pass name. public static readonly string s_MetaStr = "META"; + /// Shadow Caster pass name. public static readonly string s_ShadowCasterStr = "ShadowCaster"; + /// FullScreen Debug pass name. public static readonly string s_FullScreenDebugStr = "FullScreenDebug"; + /// DBuffer Projector pass name. public static readonly string s_DBufferProjectorStr = DecalSystem.s_MaterialDecalPassNames[(int)DecalSystem.MaterialDecalPass.DBufferProjector]; + /// Decal Projector Forward Emissive pass name. public static readonly string s_DecalProjectorForwardEmissiveStr = DecalSystem.s_MaterialDecalPassNames[(int)DecalSystem.MaterialDecalPass.DecalProjectorForwardEmissive]; + /// DBuffer Mesh pass name. public static readonly string s_DBufferMeshStr = DecalSystem.s_MaterialDecalPassNames[(int)DecalSystem.MaterialDecalPass.DBufferMesh]; + /// Decal Mesh Forward Emissive pass name. public static readonly string s_DecalMeshForwardEmissiveStr = DecalSystem.s_MaterialDecalPassNames[(int)DecalSystem.MaterialDecalPass.DecalMeshForwardEmissive]; // ShaderPass name + /// Empty shader tag id. public static readonly ShaderTagId s_EmptyName = new ShaderTagId(s_EmptyStr); + /// Forward shader tag id. public static readonly ShaderTagId s_ForwardName = new ShaderTagId(s_ForwardStr); + /// Depth Only shader tag id. public static readonly ShaderTagId s_DepthOnlyName = new ShaderTagId(s_DepthOnlyStr); + /// Depth Forward Only shader tag id. public static readonly ShaderTagId s_DepthForwardOnlyName = new ShaderTagId(s_DepthForwardOnlyStr); + /// Forward Only shader tag id. public static readonly ShaderTagId s_ForwardOnlyName = new ShaderTagId(s_ForwardOnlyStr); + /// GBuffer shader tag id. public static readonly ShaderTagId s_GBufferName = new ShaderTagId(s_GBufferStr); + /// GBufferWithPrepass shader tag id. public static readonly ShaderTagId s_GBufferWithPrepassName = new ShaderTagId(s_GBufferWithPrepassStr); + /// Legacy Unlit cross pipeline shader tag id. public static readonly ShaderTagId s_SRPDefaultUnlitName = new ShaderTagId(s_SRPDefaultUnlitStr); + /// Motion Vectors shader tag id. public static readonly ShaderTagId s_MotionVectorsName = new ShaderTagId(s_MotionVectorsStr); + /// Distortion Vectors shader tag id. public static readonly ShaderTagId s_DistortionVectorsName = new ShaderTagId(s_DistortionVectorsStr); + /// Transparent Depth Prepass shader tag id. public static readonly ShaderTagId s_TransparentDepthPrepassName = new ShaderTagId(s_TransparentDepthPrepassStr); + /// Transparent Backface shader tag id. public static readonly ShaderTagId s_TransparentBackfaceName = new ShaderTagId(s_TransparentBackfaceStr); + /// Transparent Depth Postpass shader tag id. public static readonly ShaderTagId s_TransparentDepthPostpassName = new ShaderTagId(s_TransparentDepthPostpassStr); + /// RayTracing Prepass shader tag id. public static readonly ShaderTagId s_RayTracingPrepassName = new ShaderTagId(s_RayTracingPrepassStr); + /// FullScreen Debug shader tag id. public static readonly ShaderTagId s_FullScreenDebugName = new ShaderTagId(s_FullScreenDebugStr); + /// DBuffer Mesh shader tag id. public static readonly ShaderTagId s_DBufferMeshName = new ShaderTagId(s_DBufferMeshStr); + /// Decal Mesh Forward Emissive shader tag id. public static readonly ShaderTagId s_DecalMeshForwardEmissiveName = new ShaderTagId(s_DecalMeshForwardEmissiveStr); // Legacy name - public static readonly ShaderTagId s_AlwaysName = new ShaderTagId("Always"); - public static readonly ShaderTagId s_ForwardBaseName = new ShaderTagId("ForwardBase"); - public static readonly ShaderTagId s_DeferredName = new ShaderTagId("Deferred"); - public static readonly ShaderTagId s_PrepassBaseName = new ShaderTagId("PrepassBase"); - public static readonly ShaderTagId s_VertexName = new ShaderTagId("Vertex"); - public static readonly ShaderTagId s_VertexLMRGBMName = new ShaderTagId("VertexLMRGBM"); - public static readonly ShaderTagId s_VertexLMName = new ShaderTagId("VertexLM"); + internal static readonly ShaderTagId s_AlwaysName = new ShaderTagId("Always"); + internal static readonly ShaderTagId s_ForwardBaseName = new ShaderTagId("ForwardBase"); + internal static readonly ShaderTagId s_DeferredName = new ShaderTagId("Deferred"); + internal static readonly ShaderTagId s_PrepassBaseName = new ShaderTagId("PrepassBase"); + internal static readonly ShaderTagId s_VertexName = new ShaderTagId("Vertex"); + internal static readonly ShaderTagId s_VertexLMRGBMName = new ShaderTagId("VertexLMRGBM"); + internal static readonly ShaderTagId s_VertexLMName = new ShaderTagId("VertexLM"); } // Pre-hashed shader ids - naming conventions are a bit off in this file as we use the same diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs index 34ce91f8008..8aff33e8dd5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs @@ -154,7 +154,7 @@ protected override void Execute(CustomPassContext ctx) stencilState = new StencilState(false), }; - PerObjectData renderConfig = ctx.hdCamera.frameSettings.IsEnabled(FrameSettingsField.Shadowmask) ? HDUtils.k_RendererConfigurationBakedLightingWithShadowMask : HDUtils.k_RendererConfigurationBakedLighting; + PerObjectData renderConfig = ctx.hdCamera.frameSettings.IsEnabled(FrameSettingsField.Shadowmask) ? HDUtils.GetBakedLightingWithShadowMaskRenderConfig() : HDUtils.GetBakedLightingRenderConfig(); var result = new RendererListDesc(shaderPasses, ctx.cullingResults, ctx.hdCamera.camera) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs index 499584b578e..f2e13fdbb4e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs @@ -18,6 +18,11 @@ public class HDUtils internal const PerObjectData k_RendererConfigurationBakedLighting = PerObjectData.LightProbe | PerObjectData.Lightmaps | PerObjectData.LightProbeProxyVolume; internal const PerObjectData k_RendererConfigurationBakedLightingWithShadowMask = k_RendererConfigurationBakedLighting | PerObjectData.OcclusionProbe | PerObjectData.OcclusionProbeProxyVolume | PerObjectData.ShadowMask; + /// Returns the render configuration for baked static lighting, this value can be used in a RendererListDesc call to render Lit objects. + public static PerObjectData GetBakedLightingRenderConfig() => k_RendererConfigurationBakedLighting; + /// Returns the render configuration for baked static lighting with shadow masks, this value can be used in a RendererListDesc call to render Lit objects when shadow masks are enabled. + public static PerObjectData GetBakedLightingWithShadowMaskRenderConfig() => k_RendererConfigurationBakedLightingWithShadowMask; + /// Default HDAdditionalReflectionData static internal HDAdditionalReflectionData s_DefaultHDAdditionalReflectionData { get { return ComponentSingleton.instance; } } /// Default HDAdditionalLightData From 6dda2a7639529a82b7c7fa351bb52839d7867409 Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Fri, 23 Oct 2020 14:42:05 +0200 Subject: [PATCH 12/41] - Updated the documentation about shadow matte and SSShadow and RTShadows. (#2339) * - Updated the documentation about shadow matte and SSShadow and RTShadows. * Update CHANGELOG.md Co-authored-by: sebastienlagarde --- .../Documentation~/Master-Node-Unlit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Unlit.md b/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Unlit.md index a2d01809c5e..9ff106a0ec9 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Unlit.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Unlit.md @@ -54,7 +54,7 @@ To view these properties, click the **Cog** icon in the top right of the master | **DepthTest** |Unity uses DepthTest when rendering an object, to check if it is behind another object. Unity does this by testing the Z-value of a given Objects pixel and comparing against a value stored in the Z-buffer. By default, DepthTest is set to Less Equal, allowing the original object to appear in front of the object it is tested against. Use the drop-down to select the comparison function to use for the depth test. Each comparison function changes how the Shader renders. To expose this option, select **Transparent** from the **Surface Type** drop-down.
• **Disabled:** Do not perform a ZTest.
• **Never:** The ZTest is never passed.
• **Less:** The ZTest passes if the pixels Z-value is less than the stored value.
• **Equal:** The ZTest passes if the pixels Z-value is equal to the stored value.
• **Less Equal:** The ZTest passes if the pixels Z-value is less than or equal than the Z-buffers value. This renders the tested pixel in front of the other.
• **Greater:** The ZTest passes if the pixels Z-value is greater than the stored value.
• **Not Equal:** The ZTest passes if the pixels Z-value is not equal to the stored value.
• **Greater Equal:** The ZTest passes if the pixels Z-value is greater than or equal to the stored value.
• **Always:** The ZTest always passes, there is no comparison to the stored value.| | **Double Sided** |Enable or disable whether or not the Shader should be rendered on both sides of a geometry.| | **Alpha Clipping** |Enable the checkbox to make this Material act like a [Cutout Shader](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterRenderingMode.html). Enabling this feature exposes more properties. For more information about the feature and for the list of properties this feature exposes, see the [Alpha Clipping documentation](Alpha-Clipping.md).| -| **Shadow Matte** |Enable or disable whether or not the Shader receive the shadow.| +| **Shadow Matte** |Indicates whether or not the Shader receives shadows. Shadow matte only supports shadow maps. It does not support Screen Space Shadows, [Ray-Traced Shadows](Ray-Traced-Shadows.md), or [Contact Shadows](Override-Contact-Shadows.md).| | **Override ShaderGUI** |Lets you override the [ShaderGUI](https://docs.unity3d.com/ScriptReference/ShaderGUI.html) that this Shader Graph uses. If `true`, the **ShaderGUI** property appears, which lets you specify the ShaderGUI to use. | | **- ShaderGUI** |The full name of the ShaderGUI class to use, including the class path.| From 56884cf74f9cb5b7b2e02bfef72940a100baba0b Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Fri, 23 Oct 2020 15:07:16 +0200 Subject: [PATCH 13/41] Fixed warnings when new input system is enabled (#2274) --- com.unity.render-pipelines.core/Runtime/Camera/FreeCamera.cs | 2 ++ .../PropertyBinding/Implementation/VFXInputButtonBinder.cs | 2 ++ .../PropertyBinding/Implementation/VFXInputKeyBinder.cs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/com.unity.render-pipelines.core/Runtime/Camera/FreeCamera.cs b/com.unity.render-pipelines.core/Runtime/Camera/FreeCamera.cs index 6f6ba2ada95..675439767c2 100644 --- a/com.unity.render-pipelines.core/Runtime/Camera/FreeCamera.cs +++ b/com.unity.render-pipelines.core/Runtime/Camera/FreeCamera.cs @@ -35,6 +35,7 @@ public class FreeCamera : MonoBehaviour /// public float m_Turbo = 10.0f; +#if !USE_INPUT_SYSTEM private static string kMouseX = "Mouse X"; private static string kMouseY = "Mouse Y"; private static string kRightStickX = "Controller Right Stick X"; @@ -44,6 +45,7 @@ public class FreeCamera : MonoBehaviour private static string kYAxis = "YAxis"; private static string kSpeedAxis = "Speed Axis"; +#endif #if USE_INPUT_SYSTEM InputAction lookAction; diff --git a/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputButtonBinder.cs b/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputButtonBinder.cs index 283f5584e7c..a66620a64bc 100644 --- a/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputButtonBinder.cs +++ b/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputButtonBinder.cs @@ -20,7 +20,9 @@ class VFXInputButtonBinder : VFXBinderBase public float SmoothSpeed = 2.0f; public bool UseButtonSmooth = true; +#if ENABLE_LEGACY_INPUT_MANAGER float m_CachedSmoothValue = 0.0f; +#endif public override bool IsValid(VisualEffect component) { diff --git a/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputKeyBinder.cs b/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputKeyBinder.cs index bbd9ce55c66..460eeb6f082 100644 --- a/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputKeyBinder.cs +++ b/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputKeyBinder.cs @@ -20,7 +20,9 @@ class VFXInputKeyBinder : VFXBinderBase public float SmoothSpeed = 2.0f; public bool UseKeySmooth = true; +#if ENABLE_LEGACY_INPUT_MANAGER float m_CachedSmoothValue = 0.0f; +#endif public override bool IsValid(VisualEffect component) { From f06c32a9c0426a8d365c4c97ec57996b4dbaf809 Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Fri, 23 Oct 2020 15:38:22 +0200 Subject: [PATCH 14/41] Fix nan when decal affect normals (#2319) * Use SafeNormalize * Update CHANGELOG.md Co-authored-by: JulienIgnace-Unity --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/Material/Lit/LitDecalData.hlsl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index dad4210a8a2..ed81781bab2 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -39,6 +39,7 @@ The version number for this package has increased due to a version update of a r - 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. +- Fixed nan when a decal affects normals. ### 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/Lit/LitDecalData.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl index 2ec0165034d..af6e087cf2a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl @@ -8,7 +8,7 @@ void ApplyDecalToSurfaceData(DecalSurfaceData decalSurfaceData, float3 vtxNormal // Always test the normal as we can have decompression artifact if (decalSurfaceData.normalWS.w < 1.0) { - surfaceData.normalWS.xyz = normalize(surfaceData.normalWS.xyz * decalSurfaceData.normalWS.w + decalSurfaceData.normalWS.xyz); + surfaceData.normalWS.xyz = SafeNormalize(surfaceData.normalWS.xyz * decalSurfaceData.normalWS.w + decalSurfaceData.normalWS.xyz); } #ifdef DECALS_4RT // only smoothness in 3RT mode From e4dea8d861220923f289cc85c0f7669f215725a3 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Fri, 23 Oct 2020 15:39:36 +0200 Subject: [PATCH 15/41] Fix bleeding of a view into another caused by TAA (#2317) * Make sure we clamp correctly when sampling in TAA * Changelog * More safe fix. Co-authored-by: JulienIgnace-Unity --- .../CHANGELOG.md | 1 + .../Shaders/TemporalAntialiasing.hlsl | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ed81781bab2..ab419bdbb78 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -40,6 +40,7 @@ The version number for this package has increased due to a version update of a r - 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. - Fixed nan when a decal affects normals. +- Fixed issue with TAA causing bleeding of a view into another when multiple views are visible. ### 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/PostProcessing/Shaders/TemporalAntialiasing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl index 3af4237d52c..eaff2540d4d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl @@ -18,22 +18,30 @@ #define COMPARE_DEPTH(a, b) step(a, b) #endif +float2 ClampAndScaleForBilinearWithCustomScale(float2 uv, float2 scale) +{ + float2 maxCoord = 1.0f - _ScreenSize.zw; + return min(uv, maxCoord) * scale; +} float3 Fetch(TEXTURE2D_X(tex), float2 coords, float2 offset, float2 scale) { - float2 uv = (coords + offset * _ScreenSize.zw) * scale; + float2 uv = (coords + offset * _ScreenSize.zw); + uv = ClampAndScaleForBilinearWithCustomScale(uv, scale); return SAMPLE_TEXTURE2D_X_LOD(tex, s_linear_clamp_sampler, uv, 0).xyz; } float4 Fetch4(TEXTURE2D_X(tex), float2 coords, float2 offset, float2 scale) { - float2 uv = (coords + offset * _ScreenSize.zw) * scale; + float2 uv = (coords + offset * _ScreenSize.zw); + uv = ClampAndScaleForBilinearWithCustomScale(uv, scale); return SAMPLE_TEXTURE2D_X_LOD(tex, s_linear_clamp_sampler, uv, 0); } float4 Fetch4Array(Texture2DArray tex, uint slot, float2 coords, float2 offset, float2 scale) { - float2 uv = (coords + offset * _ScreenSize.zw) * scale; + float2 uv = (coords + offset * _ScreenSize.zw); + uv = ClampAndScaleForBilinearWithCustomScale(uv, scale); return SAMPLE_TEXTURE2D_ARRAY_LOD(tex, s_linear_clamp_sampler, uv, slot, 0); } From d02178ea5206eb0bf26caeb1ab9e4088e67cb1c1 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Fri, 23 Oct 2020 15:41:11 +0200 Subject: [PATCH 16/41] Reset RT Handle size every now and then in editor if set to a big resolution and then reverted back (#2322) * Reset every now and then * Changelog * Bump min to 1440 * Update CHANGELOG.md Fixed changelog * Avoid reset if we still need the high res Co-authored-by: JulienIgnace-Unity --- .../Runtime/Textures/RTHandleSystem.cs | 24 +++++++++++++++++++ .../CHANGELOG.md | 1 + 2 files changed, 25 insertions(+) diff --git a/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs b/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs index 91b0c5a02bc..e99623c511d 100644 --- a/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs +++ b/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs @@ -67,6 +67,10 @@ internal enum ResizeMode int m_MaxWidths = 0; int m_MaxHeights = 0; +#if UNITY_EDITOR + // In editor every now and then we must reset the size of the rthandle system if it was set very high and then switched back to a much smaller scale. + int m_FramesSinceLastReset = 0; +#endif /// /// RTHandleSystem constructor. @@ -172,6 +176,26 @@ public void SetReferenceSize(int width, int height, MSAASamples msaaSamples, boo width = Mathf.Max(width, 1); height = Mathf.Max(height, 1); +#if UNITY_EDITOR + // If the reference size is significantly higher than the current actualWidth/Height and it is larger than 1440p dimensions, we reset the reference size every several frames + // in editor to avoid issues if a large resolution was temporarily set. + const int resetInterval = 100; + if (((m_MaxWidths / (float)width) > 2.0f && m_MaxWidths > 2560) || + ((m_MaxHeights / (float)height) > 2.0f && m_MaxHeights > 1440)) + { + if (m_FramesSinceLastReset > resetInterval) + { + m_FramesSinceLastReset = 0; + ResetReferenceSize(width, height); + } + m_FramesSinceLastReset++; + } + + // If some cameras is requesting the same res as the max res, we don't want to reset + if (m_MaxWidths == width && m_MaxHeights == height) + m_FramesSinceLastReset = 0; +#endif + bool sizeChanged = width > GetMaxWidth() || height > GetMaxHeight() || reset; bool msaaSamplesChanged = (msaaSamples != m_ScaledRTCurrentMSAASamples); diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ab419bdbb78..2624db78174 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -41,6 +41,7 @@ The version number for this package has increased due to a version update of a r - Fixed NullRef Exception when decals are in the scene, no asset is set and HDRP wizard is run. - Fixed nan when a decal affects normals. - Fixed issue with TAA causing bleeding of a view into another when multiple views are visible. +- Fix an issue that caused issues of usability of editor if a very high resolution is set by mistake and then reverted back to a smaller resolution. ### Changed - Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass. From 4c5a41f53dcc02fe703b369029ed540b4e80115d Mon Sep 17 00:00:00 2001 From: JulienIgnace-Unity Date: Fri, 23 Oct 2020 16:06:30 +0200 Subject: [PATCH 17/41] Hdrp/standardize transparent receive ssr (#2338) * Renaming * Changelog * Fix typos * Update HDWizard.Window.cs typo * Update HDWizard.Window.cs typo 2 Co-authored-by: FrancescoC-Unity --- 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 2624db78174..80388d55412 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -48,6 +48,7 @@ The version number for this package has increased due to a version update of a r - Claryfied doc for the LayeredLit material. - Various improvements for the Volumetric Fog. - Now the DXR wizard displays the name of the target asset that needs to be changed. +- 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 dfa8ab52429..931f6f43f01 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 @@ -150,11 +150,11 @@ public ConfigStyle(string label, string error, string button = resolve, MessageT label: "Reflection (Default Camera Frame Setting)", error: "Screen Space Reflection is disabled in the default Camera Frame Settings. This means Cameras that use these Frame Settings do not render ray-traced reflections. To enable this feature, go to Project Settings > HDRP Default Settings > Frame Settings > Default Frame Settings For Camera > Lighting and enable Screen Space Reflections", messageType: MessageType.Info); public static readonly ConfigStyle dxrTransparentReflections = new ConfigStyle( - label: "Transparent Reflection (Asset)", - error: "Transparent Screen Space Reflection is disabled in the current HDRP Asset which means you cannot enable ray-traced reflections for transparent GameObjects from Volume components. To enable this feature, open your HDRP Asset, go to Lighting > Reflections, and enable Transparent Screen Space Reflections", messageType: MessageType.Warning); + label: "Transparents receive SSR (Asset)", + error: "Transparents receive SSR is disabled in the current HDRP Asset which means you cannot enable ray-traced reflections for transparent GameObjects from Volume components. To enable this feature, open your HDRP Asset, go to Lighting > Reflections, and enable Transparents receive SSR", messageType: MessageType.Warning); public static readonly ConfigStyle dxrTransparentReflectionsFS = new ConfigStyle( - label: "Transparent Reflection (Default Camera Frame Setting)", - error: "Transparent Screen Space Reflection is disabled in the default Camera Frame Settings. This means Cameras that use these Frame Settings do not render ray-traced reflections for transparent GameObjects. To enable this feature, go to Project Settings > HDRP Default Settings > Frame Settings > Default Frame Settings For Camera > Lighting and enable On Transparent", messageType: MessageType.Info); + label: "Transparents receive SSR (Default Camera Frame Setting)", + error: "Transparents receive SSR is disabled in the default Camera Frame Settings. This means Cameras that use these Frame Settings do not render ray-traced reflections for transparent GameObjects. To enable this feature, go to Project Settings > HDRP Default Settings > Frame Settings > Default Frame Settings For Camera > Lighting and enable On Transparent", messageType: MessageType.Info); public static readonly ConfigStyle dxrGI = new ConfigStyle( label: "Global Illumination (Asset)", error: "Screen Space Global Illumination is disabled in the current HDRP asset which means you cannot enable ray-traced global illumination in Volume components. To enable this feature, open your HDRP Asset, go to Lighting and enable Screen Space Global Illumination", messageType: MessageType.Warning); 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 bb62e50f7986a7f017c938bbb336f78e2676eff3 Mon Sep 17 00:00:00 2001 From: Emmanuel Turquin Date: Fri, 23 Oct 2020 16:10:17 +0200 Subject: [PATCH 18/41] Added default volume profile asset change to the undo stack (case 1285268). (#2330) * Added default volume profile asset change to the undo stack. * Updated changelog. * ... * ... Co-authored-by: JulienIgnace-Unity --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 3 ++- .../Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 80388d55412..0abf97f57a9 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -1,4 +1,4 @@ -# Changelog +# Changelog All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) @@ -42,6 +42,7 @@ The version number for this package has increased due to a version update of a r - Fixed nan when a decal affects normals. - Fixed issue with TAA causing bleeding of a view into another when multiple views are visible. - Fix an issue that caused issues of usability of editor if a very high resolution is set by mistake and then reverted back to a smaller resolution. +- Fixed issue where Default Volume Profile Asset change in project settings was not added to the undo stack (case 1285268). ### 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/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs index 54c708f5766..e4f61b7ebd6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs @@ -245,6 +245,7 @@ void Draw_VolumeInspector() } else if (newAsset != asset) { + Undo.RegisterCompleteObjectUndo(hdrpAsset, "Default Volume Profile Asset Change."); asset = newAsset; hdrpAsset.defaultVolumeProfile = asset; EditorUtility.SetDirty(hdrpAsset); From 9d0bab337cda7224a96e3a457a8c166420110a77 Mon Sep 17 00:00:00 2001 From: JulienIgnace-Unity Date: Fri, 23 Oct 2020 17:27:44 +0200 Subject: [PATCH 19/41] Restored default directional light intensity constant (#2345) --- .../Runtime/Lighting/Light/HDAdditionalLightData.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 ad16fb3c746..17815178e4d 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 @@ -51,7 +51,7 @@ public static BoolScalableSetting UseContactShadow(HDRenderPipelineAsset hdrp) = /// /// The default intensity value for directional lights in Lux /// - public const float k_DefaultDirectionalLightIntensity = 100000; // In lux + public const float k_DefaultDirectionalLightIntensity = Mathf.PI; // In lux /// /// The default intensity value for punctual lights in Lumen /// @@ -1986,7 +1986,7 @@ internal void ReserveShadowMap(Camera camera, HDShadowManager shadowManager, HDS // 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 + // normalized ratio between light range and distance float range01 = Mathf.Clamp01(visibleLight.range / Vector3.Distance(camera.transform.position, visibleLight.GetPosition())); float scaleFactor01 = Mathf.Max(distance01, range01); @@ -2611,7 +2611,7 @@ public static void InitDefaultHDAdditionalLightData(HDAdditionalLightData lightD { case HDLightType.Directional: lightData.lightUnit = LightUnit.Lux; - lightData.intensity = k_DefaultDirectionalLightIntensity; + lightData.intensity = k_DefaultDirectionalLightIntensity / Mathf.PI * 100000.0f; // Change back to just k_DefaultDirectionalLightIntensity on 11.0.0 (can't change constant as it's a breaking change) break; case HDLightType.Area: // Rectangle by default when light is created switch (lightData.areaLightShape) From 1361f1b007b9fa3dbf7523abde084262207e1c70 Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Fri, 23 Oct 2020 18:26:49 +0200 Subject: [PATCH 20/41] Fixed changelog --- .../CHANGELOG.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 0abf97f57a9..60f1ed16e1a 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -11,13 +11,24 @@ The version number for this package has increased due to a version update of a r ### Added - Exposed the API to access HDRP shader pass names. +- Added the status check of default camera frame settings in the DXR wizard. +- Added frame setting for Virtual Texturing. ### 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. +- 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. +- Fixed nan when a decal affects normals. +- Fixed issue with TAA causing bleeding of a view into another when multiple views are visible. +- Fix an issue that caused issues of usability of editor if a very high resolution is set by mistake and then reverted back to a smaller resolution. +- Fixed issue where Default Volume Profile Asset change in project settings was not added to the undo stack (case 1285268). +- Fixed undo after enabling compositor. ### Changed - Improved the punctual light shadow rescale algorithm. +- Now the DXR wizard displays the name of the target asset that needs to be changed. +- Standardized naming for the option regarding Transparent objects being able to receive Screen Space Reflections. ## [10.2.0] - 2020-10-19 @@ -25,7 +36,6 @@ The version number for this package has increased due to a version update of a r - 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. -- Added the status check of default camera frame settings in the DXR wizard. ### Fixed - Fixed an issue where the Exposure Shader Graph node had clipped text. (case 1265057) @@ -37,19 +47,11 @@ The version number for this package has increased due to a version update of a r - 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. -- Fixed nan when a decal affects normals. -- Fixed issue with TAA causing bleeding of a view into another when multiple views are visible. -- Fix an issue that caused issues of usability of editor if a very high resolution is set by mistake and then reverted back to a smaller resolution. -- Fixed issue where Default Volume Profile Asset change in project settings was not added to the undo stack (case 1285268). ### 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. -- Now the DXR wizard displays the name of the target asset that needs to be changed. -- Standardized naming for the option regarding Transparent objects being able to receive Screen Space Reflections. ## [10.1.0] - 2020-10-12 @@ -87,7 +89,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) @@ -216,7 +217,6 @@ 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. From e0fa6c777f9c1aea6463485f13b2750246c65c3d Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Fri, 23 Oct 2020 18:27:56 +0200 Subject: [PATCH 21/41] More changelog fix --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 60f1ed16e1a..9b1d3c2d4d4 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -6,9 +6,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [11.0.0] - 2020-10-21 -Version Updated -The version number for this package has increased due to a version update of a related graphics package. - ### Added - Exposed the API to access HDRP shader pass names. - Added the status check of default camera frame settings in the DXR wizard. From eda4327692c6e831fd45d7de90e8398c2d90f2b6 Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Fri, 23 Oct 2020 19:42:03 +0200 Subject: [PATCH 22/41] Remove useless menu entry (#2335) --- .../Reflection/HDProbeUI.ContextualMenu.cs | 38 ------------------- .../HDProbeUI.ContextualMenu.cs.meta | 11 ------ 2 files changed, 49 deletions(-) delete mode 100644 com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.ContextualMenu.cs delete mode 100644 com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.ContextualMenu.cs.meta diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.ContextualMenu.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.ContextualMenu.cs deleted file mode 100644 index e0661bd6172..00000000000 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.ContextualMenu.cs +++ /dev/null @@ -1,38 +0,0 @@ -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Rendering.HighDefinition; - -namespace UnityEditor.Rendering.HighDefinition -{ - static partial class HDProbeUI - { - [MenuItem("GameObject/3D Object/Mirror", priority = CoreUtils.gameObjectMenuPriority)] - static void CreateMirrorGameObject(MenuCommand menuCommand) - { - GameObject plane = GameObject.CreatePrimitive(PrimitiveType.Plane); - GameObjectUtility.SetParentAndAlign(plane, menuCommand.context as GameObject); - Undo.RegisterCreatedObjectUndo(plane, "Create " + plane.name); - Selection.activeObject = plane; - - var planarProbe = plane.AddComponent(); - planarProbe.influenceVolume.boxSize = new Vector3(10, 0.01f, 10); - - var hdrp = HDRenderPipeline.defaultAsset; - var material = hdrp != null ? hdrp.GetDefaultMirrorMaterial() : null; - - if (material) - { - plane.GetComponent().sharedMaterial = material; - } - } - - [MenuItem("GameObject/Light/Planar Reflection Probe", priority = CoreUtils.gameObjectMenuPriority)] - static void CreatePlanarReflectionGameObject(MenuCommand menuCommand) - { - var parent = menuCommand.context as GameObject; - var go = CoreEditorUtils.CreateGameObject("Planar Reflection", parent); - var planarProbe = go.AddComponent(); - planarProbe.influenceVolume.boxSize = new Vector3(1, 0.01f, 1); - } - } -} diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.ContextualMenu.cs.meta b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.ContextualMenu.cs.meta deleted file mode 100644 index 927ac9bb947..00000000000 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.ContextualMenu.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f9ddf94c77394c14986865eb30c51d79 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: From ff96dd6621f04d3aa7f8ed16fdba52a884047919 Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Fri, 23 Oct 2020 20:04:05 +0200 Subject: [PATCH 23/41] Fixed the ray tracing shadow UI being displayed while it shouldn't (case 1286391). (#2341) Co-authored-by: sebastienlagarde --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Editor/Lighting/HDLightUI.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 9b1d3c2d4d4..13064adad00 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix an issue that caused issues of usability of editor if a very high resolution is set by mistake and then reverted back to a smaller resolution. - Fixed issue where Default Volume Profile Asset change in project settings was not added to the undo stack (case 1285268). - Fixed undo after enabling compositor. +- Fixed the ray tracing shadow UI being displayed while it shouldn't (case 1286391). ### Changed - Improved the punctual light shadow rescale algorithm. diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs index 21a7098c64f..c0480c596bb 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs @@ -1085,7 +1085,7 @@ static void DrawShadowMapContent(SerializedHDLight serialized, Editor owner) EditorGUILayout.Slider(serialized.areaLightShadowCone, HDAdditionalLightData.k_MinAreaLightShadowCone, HDAdditionalLightData.k_MaxAreaLightShadowCone, s_Styles.areaLightShadowCone); } - if (HDRenderPipeline.pipelineSupportsRayTracing) + if (HDRenderPipeline.pipelineSupportsRayTracing && HDRenderPipeline.pipelineSupportsScreenSpaceShadows) { bool isPunctual = lightType == HDLightType.Point || (lightType == HDLightType.Spot && serialized.spotLightShape.GetEnumValue() == SpotLightShape.Cone); if (isPunctual || (lightType == HDLightType.Area && serialized.areaLightShape == AreaLightShape.Rectangle)) From 63b8bc4c8fdd40a8946e26fbd7ee95e866afc865 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Fri, 23 Oct 2020 20:22:12 +0200 Subject: [PATCH 24/41] Add fade distance for light impact on volumetrics (#2291) * Fade * changelog * Don't display on directional Co-authored-by: sebastienlagarde --- .../CHANGELOG.md | 1 + .../Editor/Lighting/HDLightUI.Skin.cs | 1 + .../Editor/Lighting/HDLightUI.cs | 5 +++++ .../Editor/Lighting/SerializedHDLight.cs | 2 ++ .../Lighting/Light/HDAdditionalLightData.cs | 18 ++++++++++++++++++ .../Runtime/Lighting/LightLoop/LightLoop.cs | 4 +++- 6 files changed, 30 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 13064adad00..1683ea9e2d2 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Exposed the API to access HDRP shader pass names. - Added the status check of default camera frame settings in the DXR wizard. - Added frame setting for Virtual Texturing. +- Added a fade distance for light influencing volumetric lighting. ### Fixed - Fixed a null reference exception when creating a diffusion profile asset. diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Skin.cs index 27b7442decd..2eaf9d4624b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Skin.cs @@ -103,6 +103,7 @@ sealed class Styles // Volumetric Additional light data public readonly GUIContent volumetricEnable = new GUIContent("Enable", "When enabled, this Light uses Volumetrics."); public readonly GUIContent volumetricDimmer = new GUIContent("Multiplier", "Controls the intensity of the scattered Volumetric lighting."); + public readonly GUIContent volumetricFadeDistance = new GUIContent("Fade Distance", "The distance at which light smoothly fades out from contributing to volumetric lighting."); // Volumetric Additional shadow data public readonly GUIContent volumetricShadowDimmer = new GUIContent("Shadow Dimmer", "Dims the volumetric shadows this Light casts."); diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs index c0480c596bb..c114982ca93 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs @@ -991,6 +991,11 @@ static void DrawVolumetric(SerializedHDLight serialized, Editor owner) { EditorGUILayout.PropertyField(serialized.volumetricDimmer, s_Styles.volumetricDimmer); EditorGUILayout.Slider(serialized.volumetricShadowDimmer, 0.0f, 1.0f, s_Styles.volumetricShadowDimmer); + HDLightType lightType = serialized.type; + if (lightType != HDLightType.Directional) + { + EditorGUILayout.PropertyField(serialized.volumetricFadeDistance, s_Styles.volumetricFadeDistance); + } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/SerializedHDLight.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/SerializedHDLight.cs index 0e897c269d5..eb47bf03b96 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/SerializedHDLight.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/SerializedHDLight.cs @@ -27,6 +27,7 @@ internal class SerializedHDLight public SerializedProperty maxSmoothness; public SerializedProperty applyRangeAttenuation; public SerializedProperty volumetricDimmer; + public SerializedProperty volumetricFadeDistance; public SerializedProperty lightUnit; public SerializedProperty displayAreaLightEmissiveMesh; public SerializedProperty areaLightEmissiveMeshCastShadow; @@ -336,6 +337,7 @@ public SerializedHDLight(HDAdditionalLightData[] lightDatas, LightEditor.Setting spotIESCutoffPercent = o.Find("m_SpotIESCutoffPercent"); lightDimmer = o.Find("m_LightDimmer"); volumetricDimmer = o.Find("m_VolumetricDimmer"); + volumetricFadeDistance = o.Find("m_VolumetricFadeDistance"); lightUnit = o.Find("m_LightUnit"); displayAreaLightEmissiveMesh = o.Find("m_DisplayAreaLightEmissiveMesh"); fadeDistance = o.Find("m_FadeDistance"); 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 17815178e4d..c54c6ec34a7 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 @@ -304,6 +304,24 @@ public float fadeDistance } } + // Not used for directional lights. + [SerializeField] + float m_VolumetricFadeDistance = 10000.0f; + /// + /// Get/Set the light fade distance for volumetrics. + /// + public float volumetricFadeDistance + { + get => m_VolumetricFadeDistance; + set + { + if (m_VolumetricFadeDistance == value) + return; + + m_VolumetricFadeDistance = Mathf.Clamp(value, 0, float.MaxValue); + } + } + [SerializeField, FormerlySerializedAs("affectDiffuse")] bool m_AffectDiffuse = true; /// 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 a1f28c7516d..395798aa233 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 @@ -259,6 +259,7 @@ internal struct ProcessedLightData public LightVolumeType lightVolumeType; public float distanceToCamera; public float lightDistanceFade; + public float volumetricDistanceFade; public bool isBakedShadowMask; } @@ -1548,7 +1549,7 @@ internal void GetLightData(CommandBuffer cmd, HDCamera hdCamera, HDShadowSetting lightData.lightDimmer = processedData.lightDistanceFade * (additionalLightData.lightDimmer); lightData.diffuseDimmer = processedData.lightDistanceFade * (additionalLightData.affectDiffuse ? additionalLightData.lightDimmer : 0); lightData.specularDimmer = processedData.lightDistanceFade * (additionalLightData.affectSpecular ? additionalLightData.lightDimmer * hdCamera.frameSettings.specularGlobalDimmer : 0); - lightData.volumetricLightDimmer = processedData.lightDistanceFade * (additionalLightData.volumetricDimmer); + lightData.volumetricLightDimmer = Mathf.Min(processedData.volumetricDistanceFade, processedData.lightDistanceFade) * (additionalLightData.volumetricDimmer); lightData.cookieMode = CookieMode.None; lightData.shadowIndex = -1; @@ -2278,6 +2279,7 @@ void PreprocessLightData(ref ProcessedLightData processedData, VisibleLight ligh ref processedData.lightCategory, ref processedData.gpuLightType, ref processedData.lightVolumeType); processedData.lightDistanceFade = processedData.gpuLightType == GPULightType.Directional ? 1.0f : HDUtils.ComputeLinearDistanceFade(processedData.distanceToCamera, additionalLightData.fadeDistance); + processedData.volumetricDistanceFade = processedData.gpuLightType == GPULightType.Directional ? 1.0f : HDUtils.ComputeLinearDistanceFade(processedData.distanceToCamera, additionalLightData.volumetricFadeDistance); processedData.isBakedShadowMask = IsBakedShadowMaskLight(lightComponent); } From d66bf90791b2519c0b2de4302f82a49b88b0642f Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Fri, 23 Oct 2020 20:25:17 +0200 Subject: [PATCH 25/41] Fix bit in FrameSettings --- .../Runtime/RenderPipeline/Settings/FrameSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9994e65e288..6bca70b2b2c 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 @@ -134,7 +134,7 @@ public enum FrameSettingsField 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, + VirtualTexturing = 68, /// 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).")] From 32ba2a8ef1e6b226ba88a8f6eed332b87666ffa2 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Fri, 23 Oct 2020 23:14:32 +0200 Subject: [PATCH 26/41] Update sample cubemap image --- .../Documentation~/images/SampleCubemapNodeThumb.png | 4 ++-- .../Documentation~/images/SampleReflectedCubemapThumb.png | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 com.unity.shadergraph/Documentation~/images/SampleReflectedCubemapThumb.png diff --git a/com.unity.shadergraph/Documentation~/images/SampleCubemapNodeThumb.png b/com.unity.shadergraph/Documentation~/images/SampleCubemapNodeThumb.png index 416d91dde9d..4221429ea3b 100644 --- a/com.unity.shadergraph/Documentation~/images/SampleCubemapNodeThumb.png +++ b/com.unity.shadergraph/Documentation~/images/SampleCubemapNodeThumb.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5deaa6a1985ed29003793c2f7534774c1dedbae859f9a7a7d53f48cd5c6a4992 -size 31787 +oid sha256:3c52f7e22d78f83f9c377a4619f66f95c13bdf454d0c060274d16706b4c25a6e +size 11174 diff --git a/com.unity.shadergraph/Documentation~/images/SampleReflectedCubemapThumb.png b/com.unity.shadergraph/Documentation~/images/SampleReflectedCubemapThumb.png new file mode 100644 index 00000000000..416d91dde9d --- /dev/null +++ b/com.unity.shadergraph/Documentation~/images/SampleReflectedCubemapThumb.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5deaa6a1985ed29003793c2f7534774c1dedbae859f9a7a7d53f48cd5c6a4992 +size 31787 From 577281656ddf9e330c9d37934d106db94da46bd7 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 11:28:18 +0200 Subject: [PATCH 27/41] Revert "Update sample cubemap image" This reverts commit 32ba2a8ef1e6b226ba88a8f6eed332b87666ffa2. --- .../Documentation~/images/SampleCubemapNodeThumb.png | 4 ++-- .../Documentation~/images/SampleReflectedCubemapThumb.png | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 com.unity.shadergraph/Documentation~/images/SampleReflectedCubemapThumb.png diff --git a/com.unity.shadergraph/Documentation~/images/SampleCubemapNodeThumb.png b/com.unity.shadergraph/Documentation~/images/SampleCubemapNodeThumb.png index 4221429ea3b..416d91dde9d 100644 --- a/com.unity.shadergraph/Documentation~/images/SampleCubemapNodeThumb.png +++ b/com.unity.shadergraph/Documentation~/images/SampleCubemapNodeThumb.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3c52f7e22d78f83f9c377a4619f66f95c13bdf454d0c060274d16706b4c25a6e -size 11174 +oid sha256:5deaa6a1985ed29003793c2f7534774c1dedbae859f9a7a7d53f48cd5c6a4992 +size 31787 diff --git a/com.unity.shadergraph/Documentation~/images/SampleReflectedCubemapThumb.png b/com.unity.shadergraph/Documentation~/images/SampleReflectedCubemapThumb.png deleted file mode 100644 index 416d91dde9d..00000000000 --- a/com.unity.shadergraph/Documentation~/images/SampleReflectedCubemapThumb.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5deaa6a1985ed29003793c2f7534774c1dedbae859f9a7a7d53f48cd5c6a4992 -size 31787 From e2786f1c4caf0f8c46444d132531334052d2afb3 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 11:56:38 +0200 Subject: [PATCH 28/41] revert: Improve punctual shadow resolution rescale algorithm (#2309) --- .../CHANGELOG.md | 1 - .../Lighting/Light/HDAdditionalLightData.cs | 28 ++++++------------- .../Runtime/Lighting/LightLoop/LightLoop.cs | 2 +- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 1683ea9e2d2..d0bfed0dd57 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -25,7 +25,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed the ray tracing shadow UI being displayed while it shouldn't (case 1286391). ### Changed -- Improved the punctual light shadow rescale algorithm. - Now the DXR wizard displays the name of the target asset that needs to be changed. - Standardized naming for the option regarding Transparent objects being able to receive Screen Space Reflections. 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 c54c6ec34a7..5edea959834 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 @@ -1962,7 +1962,7 @@ internal int GetResolutionFromSettings(ShadowMapType shadowMapType, HDShadowInit } } - internal void ReserveShadowMap(Camera camera, HDShadowManager shadowManager, HDShadowSettings shadowSettings, HDShadowInitParameters initParameters, VisibleLight visibleLight, HDLightType lightType) + internal void ReserveShadowMap(Camera camera, HDShadowManager shadowManager, HDShadowSettings shadowSettings, HDShadowInitParameters initParameters, Rect screenRect, HDLightType lightType) { if (!m_WillRenderShadowMap) return; @@ -1996,26 +1996,14 @@ internal void ReserveShadowMap(Camera camera, HDShadowManager shadowManager, HDS if (viewPortRescaling && !shadowIsInCacheSystem) { - // 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())); - - 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); + float screenArea = screenRect.width * screenRect.height; + viewportSize *= Mathf.Lerp(64f / viewportSize.x, 1f, screenArea); + viewportSize = Vector2.Max(new Vector2(64f, 64f) / viewportSize, viewportSize); + + // Prevent flickering caused by the floating size of the viewport + viewportSize.x = Mathf.Round(viewportSize.x); + viewportSize.y = Mathf.Round(viewportSize.y); } 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 395798aa233..e8d8c7ee997 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 @@ -2357,7 +2357,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, lightType); + additionalData.ReserveShadowMap(hdCamera.camera, m_ShadowManager, hdShadowSettings, m_ShadowInitParameters, light.screenRect, lightType); } // Reserve the cookie resolution in the 2D atlas From bdd18e55f7b2a940387d28fe9b2d3c6f51d75f52 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 12:09:16 +0200 Subject: [PATCH 29/41] Update TestCaseFilters.asset --- .../Assets/TestCaseFilters.asset | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset b/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset index ef6ee39b28c..b1f145fdfc3 100644 --- a/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset +++ b/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset @@ -17,25 +17,7 @@ MonoBehaviour: FilteredScenes: - {fileID: 102900000, guid: b0ec7521f32466147a09e7dadff3ae0e, type: 3} ColorSpace: 1 - BuildPlatform: 5 - GraphicsDevice: 21 - XrSdk: - StereoModes: 0 - Reason: all black on Yamato but work locally - - FilteredScene: {fileID: 0} - FilteredScenes: - - {fileID: 102900000, guid: b0ec7521f32466147a09e7dadff3ae0e, type: 3} - ColorSpace: 1 - BuildPlatform: 24 - GraphicsDevice: 21 - XrSdk: - StereoModes: 0 - Reason: all black on Yamato but work locally - - FilteredScene: {fileID: 0} - FilteredScenes: - - {fileID: 102900000, guid: 897c2870240f77a46a18884a0446b797, type: 3} - ColorSpace: 1 - BuildPlatform: 5 + BuildPlatform: -2 GraphicsDevice: 21 XrSdk: StereoModes: 0 @@ -44,7 +26,7 @@ MonoBehaviour: FilteredScenes: - {fileID: 102900000, guid: 897c2870240f77a46a18884a0446b797, type: 3} ColorSpace: 1 - BuildPlatform: 24 + BuildPlatform: -2 GraphicsDevice: 21 XrSdk: StereoModes: 0 From b76054838daf357da0bf115b8509ad3db30f6867 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 14:44:25 +0200 Subject: [PATCH 30/41] Merge branch 'master' into hd/bugfix From 38b14133f25529f3a862337fc8bd0e974bc2a648 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 15:03:03 +0200 Subject: [PATCH 31/41] Update SG_DS_Flipped.mat --- .../8x_ShaderGraph/8101_Opaque/SG_DS_Flipped.mat | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8101_Opaque/SG_DS_Flipped.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8101_Opaque/SG_DS_Flipped.mat index d27a8caaff6..63e486e3075 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8101_Opaque/SG_DS_Flipped.mat +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8101_Opaque/SG_DS_Flipped.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 11 --- !u!21 &2100000 Material: serializedVersion: 6 @@ -127,6 +127,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Floats: - Vector1_52486F46: 0.5 - Vector1_BEAFB0DB: 0.5 From 31abc85bb464313b96472be61bf59dabf5c1f579 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 15:03:35 +0200 Subject: [PATCH 32/41] update settings --- .../HDRP_Tests/ProjectSettings/HDRPProjectSettings.asset | 3 --- TestProjects/HDRP_Tests/ProjectSettings/QualitySettings.asset | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/TestProjects/HDRP_Tests/ProjectSettings/HDRPProjectSettings.asset b/TestProjects/HDRP_Tests/ProjectSettings/HDRPProjectSettings.asset index 62745341dc0..078c26f8925 100644 --- a/TestProjects/HDRP_Tests/ProjectSettings/HDRPProjectSettings.asset +++ b/TestProjects/HDRP_Tests/ProjectSettings/HDRPProjectSettings.asset @@ -13,9 +13,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: version: 1 - m_DefaultScenePrefabSaved: {fileID: 4893056312182120781, guid: a1dfdae16e0448542a6124642d4c13e9, - type: 3} - m_DefaultDXRScenePrefabSaved: {fileID: 0} m_ProjectSettingFolderPath: HDRPDefaultResources m_WizardPopupAtStart: 0 m_WizardPopupAlreadyShownOnce: 0 diff --git a/TestProjects/HDRP_Tests/ProjectSettings/QualitySettings.asset b/TestProjects/HDRP_Tests/ProjectSettings/QualitySettings.asset index 736e69697b1..19de6c3944e 100644 --- a/TestProjects/HDRP_Tests/ProjectSettings/QualitySettings.asset +++ b/TestProjects/HDRP_Tests/ProjectSettings/QualitySettings.asset @@ -27,7 +27,7 @@ QualitySettings: realtimeReflectionProbes: 1 billboardsFaceCameraPosition: 1 vSyncCount: 1 - lodBias: 2 + lodBias: 1 maximumLODLevel: 0 streamingMipmapsActive: 0 streamingMipmapsAddAllCameras: 1 From 82d3b18a6ee402a41efd6d62fec403e93b5a5611 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 15:06:58 +0200 Subject: [PATCH 33/41] Update CHANGELOG.md --- .../CHANGELOG.md | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b4dffb2cfee..02ca9fa9af4 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -6,27 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [11.0.0] - 2020-10-21 -### Added -- Exposed the API to access HDRP shader pass names. -- Added the status check of default camera frame settings in the DXR wizard. -- Added frame setting for Virtual Texturing. -- Added a fade distance for light influencing volumetric lighting. - -### 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. -- 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. -- Fixed nan when a decal affects normals. -- Fixed issue with TAA causing bleeding of a view into another when multiple views are visible. -- Fix an issue that caused issues of usability of editor if a very high resolution is set by mistake and then reverted back to a smaller resolution. -- Fixed issue where Default Volume Profile Asset change in project settings was not added to the undo stack (case 1285268). -- Fixed undo after enabling compositor. -- Fixed the ray tracing shadow UI being displayed while it shouldn't (case 1286391). - -### Changed -- Now the DXR wizard displays the name of the target asset that needs to be changed. -- Standardized naming for the option regarding Transparent objects being able to receive Screen Space Reflections. +Version Updated +The version number for this package has increased due to a version update of a related graphics package. ## [10.2.0] - 2020-10-19 @@ -35,6 +16,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Adding support of 4 channel tex coords for ray tracing (case 1265309). - Added a help button on the volume component toolbar for documentation. - Added range remapping to metallic property for Lit and Decal shaders. +- Exposed the API to access HDRP shader pass names. +- Added the status check of default camera frame settings in the DXR wizard. +- Added frame setting for Virtual Texturing. +- Added a fade distance for light influencing volumetric lighting. ### Fixed - Fixed an issue where the Exposure Shader Graph node had clipped text. (case 1265057) @@ -49,6 +34,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed bounding box generation that resulted in incorrect light culling (case 3875925). - VFX : Fix Emissive writing in Opaque Lit Output with PSSL platforms (case 273378). - Fixed issue where pivot of DecalProjector was not aligned anymore on Transform position when manipulating the size of the projector from the Inspector. +- Fixed a null reference exception when creating a diffusion profile asset. +- Fixed the diffusion profile not being registered as a dependency of the ShaderGraph. +- 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. +- Fixed nan when a decal affects normals. +- Fixed issue with TAA causing bleeding of a view into another when multiple views are visible. +- Fix an issue that caused issues of usability of editor if a very high resolution is set by mistake and then reverted back to a smaller resolution. +- Fixed issue where Default Volume Profile Asset change in project settings was not added to the undo stack (case 1285268). +- Fixed undo after enabling compositor. +- Fixed the ray tracing shadow UI being displayed while it shouldn't (case 1286391). ### Changed - Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass. @@ -57,6 +52,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Use draggable fields for float scalable settings - Migrated the fabric & hair shadergraph samples directly into the renderpipeline resources. - Removed green coloration of the UV on the DecalProjector gizmo. +- Now the DXR wizard displays the name of the target asset that needs to be changed. +- Standardized naming for the option regarding Transparent objects being able to receive Screen Space Reflections. ## [10.1.0] - 2020-10-12 From ce8389bcf62b5166948466131c348d267d37c9ec Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 15:13:14 +0200 Subject: [PATCH 34/41] remove test case filter in runtime test --- .../Assets/TestCaseFilters.asset | 33 ------------------- .../Assets/TestCaseFilters.asset.meta | 8 ----- 2 files changed, 41 deletions(-) delete mode 100644 TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset delete mode 100644 TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset.meta diff --git a/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset b/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset deleted file mode 100644 index b1f145fdfc3..00000000000 --- a/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset +++ /dev/null @@ -1,33 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f6aa9f32113aec4a8bded44c1febe5c, type: 3} - m_Name: TestCaseFilters - m_EditorClassIdentifier: - filters: - - FilteredScene: {fileID: 0} - FilteredScenes: - - {fileID: 102900000, guid: b0ec7521f32466147a09e7dadff3ae0e, type: 3} - ColorSpace: 1 - BuildPlatform: -2 - GraphicsDevice: 21 - XrSdk: - StereoModes: 0 - Reason: all black on Yamato but work locally - - FilteredScene: {fileID: 0} - FilteredScenes: - - {fileID: 102900000, guid: 897c2870240f77a46a18884a0446b797, type: 3} - ColorSpace: 1 - BuildPlatform: -2 - GraphicsDevice: 21 - XrSdk: - StereoModes: 0 - Reason: all black on Yamato but work locally diff --git a/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset.meta b/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset.meta deleted file mode 100644 index 9029546581b..00000000000 --- a/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f84f907c1962c284abd349fb673e854d -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: From 5011547dd3c5a979163ae8abddfea09d48524b47 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 19:39:51 +0200 Subject: [PATCH 35/41] migrate correctly to enable virtual texturing. --- .../RenderPipeline/HDRenderPipelineAsset.Migration.cs | 11 +++++++++-- .../Settings/FrameSettings.Migration.cs | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.Migration.cs index 94f61a5b5c0..6b86bd3e3a6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.Migration.cs @@ -23,7 +23,8 @@ enum Version ReplaceTextureArraysByAtlasForCookieAndPlanar, AddedAdaptiveSSS, RemoveCookieCubeAtlasToOctahedral2D, - RoughDistortion + RoughDistortion, + VirtualTexturing } static readonly MigrationDescription k_Migration = MigrationDescription.New( @@ -132,7 +133,13 @@ enum Version FrameSettings.MigrateRoughDistortion(ref data.m_RenderingPathDefaultCameraFrameSettings); FrameSettings.MigrateRoughDistortion(ref data.m_RenderingPathDefaultBakedOrCustomReflectionFrameSettings); FrameSettings.MigrateRoughDistortion(ref data.m_RenderingPathDefaultRealtimeReflectionFrameSettings); - }) + }), + MigrationStep.New(Version.VirtualTexturing, (HDRenderPipelineAsset data) => + { + FrameSettings.MigrateVirtualTexturing(ref data.m_RenderingPathDefaultCameraFrameSettings); + FrameSettings.MigrateVirtualTexturing(ref data.m_RenderingPathDefaultBakedOrCustomReflectionFrameSettings); + FrameSettings.MigrateVirtualTexturing(ref data.m_RenderingPathDefaultRealtimeReflectionFrameSettings); + }) ); [SerializeField] diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.Migration.cs index 0385158afb7..35c2e669738 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.Migration.cs @@ -431,5 +431,10 @@ internal static void MigrateRoughDistortion(ref FrameSettings cameraFrameSetting { cameraFrameSettings.SetEnabled(FrameSettingsField.RoughDistortion, true); } + + internal static void MigrateVirtualTexturing(ref FrameSettings cameraFrameSettings) + { + cameraFrameSettings.SetEnabled(FrameSettingsField.VirtualTexturing, true); + } } } From ef2fffe9b68da779f87c2031b4f141419f2250f0 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 20:02:16 +0200 Subject: [PATCH 36/41] revert some change one in Hdrp/standardize transparent receive ssr #2338 --- .../Material/ShaderGraph/SurfaceOptionPropertyBlock.cs | 2 +- .../Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs | 5 +++-- .../Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs | 2 +- .../Editor/RenderPipeline/HDRenderPipelineUI.cs | 2 ++ .../Editor/Wizard/HDWizard.Window.cs | 8 ++++---- .../Runtime/RenderPipeline/Settings/FrameSettings.cs | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) 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 f36b289675c..dc3290a3f0e 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(receivesSSRText, () => lightingData.receiveSSRTransparent, (newValue) => lightingData.receiveSSRTransparent = newValue); + AddProperty(receivesSSRTransparentText, () => 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 a0f617d5485..5e8ce7270f2 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,8 @@ 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."); public static string afterPostProcessZTestInfoBox = "After post-process material wont be ZTested. Enable the \"ZTest For After PostProcess\" checkbox in the Frame Settings to force the depth-test if the TAA is disabled."; @@ -762,7 +763,7 @@ void DrawLitSurfaceOptions() { // Based on the surface type, display the right recieveSSR option if (surfaceTypeValue == SurfaceType.Transparent) - materialEditor.ShaderProperty(receivesSSRTransparent, Styles.receivesSSRText); + materialEditor.ShaderProperty(receivesSSRTransparent, Styles.receivesSSRTransparentText); 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 c7d413efef9..026fe4f78f5 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("Transparents receive SSR", "When enabled, HDRP executes additional steps to achieve screen space reflection (SSR) on transparent objects."); + public static readonly GUIContent supportSSRTransparentContent = EditorGUIUtility.TrTextContent("Transparent", "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/RenderPipeline/HDRenderPipelineUI.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs index fc4e5a940df..a90656a402f 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs @@ -255,7 +255,9 @@ static void Drawer_SectionReflection(SerializedHDRenderPipelineAsset serialized, EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportSSR, Styles.supportSSRContent); using (new EditorGUI.DisabledScope(!serialized.renderPipelineSettings.supportSSR.boolValue)) { + ++EditorGUI.indentLevel; EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportSSRTransparent, Styles.supportSSRTransparentContent); + --EditorGUI.indentLevel; } EditorGUILayout.Space(); 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 931f6f43f01..091e3190332 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 @@ -150,11 +150,11 @@ public ConfigStyle(string label, string error, string button = resolve, MessageT label: "Reflection (Default Camera Frame Setting)", error: "Screen Space Reflection is disabled in the default Camera Frame Settings. This means Cameras that use these Frame Settings do not render ray-traced reflections. To enable this feature, go to Project Settings > HDRP Default Settings > Frame Settings > Default Frame Settings For Camera > Lighting and enable Screen Space Reflections", messageType: MessageType.Info); public static readonly ConfigStyle dxrTransparentReflections = new ConfigStyle( - label: "Transparents receive SSR (Asset)", - error: "Transparents receive SSR is disabled in the current HDRP Asset which means you cannot enable ray-traced reflections for transparent GameObjects from Volume components. To enable this feature, open your HDRP Asset, go to Lighting > Reflections, and enable Transparents receive SSR", messageType: MessageType.Warning); + label: "Screen Space Reflection - Transparent (Asset)", + error: "Screen Space Reflection - Transparent is disabled in the current HDRP Asset which means you cannot enable ray-traced reflections for transparent GameObjects from Volume components. To enable this feature, open your HDRP Asset, go to Lighting > Reflections, and enable Transparents receive SSR", messageType: MessageType.Warning); public static readonly ConfigStyle dxrTransparentReflectionsFS = new ConfigStyle( - label: "Transparents receive SSR (Default Camera Frame Setting)", - error: "Transparents receive SSR is disabled in the default Camera Frame Settings. This means Cameras that use these Frame Settings do not render ray-traced reflections for transparent GameObjects. To enable this feature, go to Project Settings > HDRP Default Settings > Frame Settings > Default Frame Settings For Camera > Lighting and enable On Transparent", messageType: MessageType.Info); + label: "Screen Space Reflection - Transparent (Default Camera Frame Setting)", + error: "Screen Space Reflection - Transparent is disabled in the default Camera Frame Settings. This means Cameras that use these Frame Settings do not render ray-traced reflections for transparent GameObjects. To enable this feature, go to Project Settings > HDRP Default Settings > Frame Settings > Default Frame Settings For Camera > Lighting and enable On Transparent", messageType: MessageType.Info); public static readonly ConfigStyle dxrGI = new ConfigStyle( label: "Global Illumination (Asset)", error: "Screen Space Global Illumination is disabled in the current HDRP asset which means you cannot enable ray-traced global illumination in Volume components. To enable this feature, open your HDRP Asset, go to Lighting and enable Screen Space Global Illumination", messageType: MessageType.Warning); 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 6bca70b2b2c..a9a50ef6d78 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 @@ -251,7 +251,7 @@ public enum FrameSettingsField [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 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.")] + [FrameSettingsField(1, displayedName: "Transparents", 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 3e266143545e0566aa7362c1d751514355e975bf Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 20:15:45 +0200 Subject: [PATCH 37/41] Fix breaking change in CoreEditorUtils.cs --- .../Editor/CoreEditorUtils.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/com.unity.render-pipelines.core/Editor/CoreEditorUtils.cs b/com.unity.render-pipelines.core/Editor/CoreEditorUtils.cs index 7c3bf6f78ff..35059adcfab 100644 --- a/com.unity.render-pipelines.core/Editor/CoreEditorUtils.cs +++ b/com.unity.render-pipelines.core/Editor/CoreEditorUtils.cs @@ -448,6 +448,18 @@ public static bool DrawSubHeaderFoldout(GUIContent title, bool state, bool isBox /// Delegate saying if we have MoreOptions /// Callback called when the MoreOptions is toggled /// return the state of the foldout header + public static bool DrawHeaderToggle(string title, SerializedProperty group, SerializedProperty activeField, Action contextAction = null, Func hasMoreOptions = null, Action toggleMoreOptions = null) + => DrawHeaderToggle(EditorGUIUtility.TrTextContent(title), group, activeField, contextAction, hasMoreOptions, toggleMoreOptions, null); + + /// Draw a header toggle like in Volumes + /// The title of the header + /// The group of the header + /// The active field + /// The context action + /// Delegate saying if we have MoreOptions + /// Callback called when the MoreOptions is toggled + /// Documentation URL + /// return the state of the foldout header public static bool DrawHeaderToggle(string title, SerializedProperty group, SerializedProperty activeField, Action contextAction = null, Func hasMoreOptions = null, Action toggleMoreOptions = null, string documentationURL = null) => DrawHeaderToggle(EditorGUIUtility.TrTextContent(title), group, activeField, contextAction, hasMoreOptions, toggleMoreOptions, documentationURL); @@ -459,6 +471,17 @@ public static bool DrawHeaderToggle(string title, SerializedProperty group, Seri /// Delegate saying if we have MoreOptions /// Callback called when the MoreOptions is toggled /// return the state of the foldout header + public static bool DrawHeaderToggle(GUIContent title, SerializedProperty group, SerializedProperty activeField, Action contextAction = null, Func hasMoreOptions = null, Action toggleMoreOptions = null) + => DrawHeaderToggle(title, group, activeField, contextAction, hasMoreOptions, toggleMoreOptions, null); + /// Draw a header toggle like in Volumes + /// The title of the header + /// The group of the header + /// The active field + /// The context action + /// Delegate saying if we have MoreOptions + /// Callback called when the MoreOptions is toggled + /// Documentation URL + /// return the state of the foldout header public static bool DrawHeaderToggle(GUIContent title, SerializedProperty group, SerializedProperty activeField, Action contextAction = null, Func hasMoreOptions = null, Action toggleMoreOptions = null, string documentationURL = null) { var backgroundRect = GUILayoutUtility.GetRect(1f, 17f); From 9865d87334e312867f2bea6c0f78070809d08350 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 22:01:29 +0200 Subject: [PATCH 38/41] Revert "remove test case filter in runtime test" This reverts commit ce8389bcf62b5166948466131c348d267d37c9ec. --- .../Assets/TestCaseFilters.asset | 33 +++++++++++++++++++ .../Assets/TestCaseFilters.asset.meta | 8 +++++ 2 files changed, 41 insertions(+) create mode 100644 TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset create mode 100644 TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset.meta diff --git a/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset b/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset new file mode 100644 index 00000000000..b1f145fdfc3 --- /dev/null +++ b/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset @@ -0,0 +1,33 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f6aa9f32113aec4a8bded44c1febe5c, type: 3} + m_Name: TestCaseFilters + m_EditorClassIdentifier: + filters: + - FilteredScene: {fileID: 0} + FilteredScenes: + - {fileID: 102900000, guid: b0ec7521f32466147a09e7dadff3ae0e, type: 3} + ColorSpace: 1 + BuildPlatform: -2 + GraphicsDevice: 21 + XrSdk: + StereoModes: 0 + Reason: all black on Yamato but work locally + - FilteredScene: {fileID: 0} + FilteredScenes: + - {fileID: 102900000, guid: 897c2870240f77a46a18884a0446b797, type: 3} + ColorSpace: 1 + BuildPlatform: -2 + GraphicsDevice: 21 + XrSdk: + StereoModes: 0 + Reason: all black on Yamato but work locally diff --git a/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset.meta b/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset.meta new file mode 100644 index 00000000000..9029546581b --- /dev/null +++ b/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f84f907c1962c284abd349fb673e854d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: From a1dd1a91fba8683a1407e077f69557f4c09c6fa3 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 23:29:12 +0200 Subject: [PATCH 39/41] Revert "Restored purge of unused resources in render graph (#2306)" This reverts commit bc54701791ea1142d2693b10a75fec126ce510fc. --- .../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 78a842b88da..cab8e7b1d68 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 31970e60f12f47f222e6e529dcdd777981fcac3c Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 23:43:43 +0200 Subject: [PATCH 40/41] Update documentation --- .../Documentation~/AxF-Shader.md | 2 +- .../Documentation~/Frame-Settings.md | 2 +- .../Documentation~/HDRP-Asset.md | 1 + .../Documentation~/Layered-Lit-Shader.md | 2 +- .../Documentation~/Lit-Shader.md | 2 +- .../Documentation~/Lit-Tessellation-Shader.md | 2 +- .../Documentation~/Master-Node-Fabric.md | 2 +- .../Documentation~/Master-Node-Hair.md | 2 +- .../Documentation~/Master-Node-Lit.md | 2 +- .../DefaultLookDevProfile.asset | 81 +++++++++++-------- 10 files changed, 55 insertions(+), 43 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/AxF-Shader.md b/com.unity.render-pipelines.high-definition/Documentation~/AxF-Shader.md index 8f0026114b0..84ac7b83d55 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/AxF-Shader.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/AxF-Shader.md @@ -52,7 +52,7 @@ Note: The AxF Importer imports every Texture as half float, linear, sRGB gamut ( | **- Rendering Pass** | Use the drop-down to set the rendering pass that HDRP processes this Material in. For more information on this property, see the [Surface Type documentation](Surface-Type.md). | | **Double-Sided** | Enable the checkbox to make HDRP render both faces of the polygons in your geometry. For more information about the feature and for the list of properties this feature exposes, see the [Double-Sided documentation](Double-Sided.md). | | **Receive Decals** | Enable the checkbox to allow HDRP to draw decals on this Material’s surface. | -| **Receive SSR** | Enable the checkbox to make HDRP include this Material when it processes the screen space reflection pass. | +| **Receive SSR (Transparent)** | Enable the checkbox to make HDRP include this Material when it processes the screen space reflection pass. There is a separate option for transparent Surface Type. | ### Main Mapping Configuration diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Frame-Settings.md b/com.unity.render-pipelines.high-definition/Documentation~/Frame-Settings.md index b8205b968d2..522f7e10ce6 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Frame-Settings.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Frame-Settings.md @@ -77,7 +77,7 @@ These settings control lighting features for your rendering components. Here you | **Screen Space Shadows** | [DXR only] Enable the checkbox to allow [Lights](Light-Component.md) to render shadow maps into screen space buffers to reduce lighting Shader complexity. This technique increases processing speed but also increases the memory footprint. | | **Shadowmask** | Enable the checkbox to make HDRP support the [Shadowmasks lighting mode](Lighting-Mode-Shadowmask.md). | | **Screen Space Refection** | Enable the checkbox to make HDRP process Screen Space Reflections (SSR). This allows HDRP to calculate SSR for this Camera/Reflection Probe. | -| - **On Transparent** | Enable the checkbox to make HDRP process Screen Space Reflections (SSR) on transparent objects. | +| - **Transparent** | Enable the checkbox to make HDRP process Screen Space Reflections (SSR) on transparent materials. | | **Screen Space Global Illumination** | Enable the checkbox to make HDRP process Screen Space Global Illumination (SSGI). | | **Screen Space Ambient Occlusion** | Enable the checkbox to make HDRP process Screen Space Ambient Occlusion (SSAO). This allows HDRP to calculate SSAO for this Camera/Reflection Probe. | | **Transmission** | Enable the checkbox to make HDRP process the transmission effect. This allows subsurface scattering Materials to use transmission, for example, light transmits through a leaf with a subsurface scattering Material. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Asset.md b/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Asset.md index 3b70883eb02..aaafb00c36e 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Asset.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Asset.md @@ -110,6 +110,7 @@ Use the Reflection settings to configure the max number and resolution of the pr | **Property** | **Description** | | ---------------------------------------- | ------------------------------------------------------------ | | **Screen Space Reflection** | Enable the checkbox to make HDRP support [screen space reflection](https://docs.unity3d.com/Manual/PostProcessing-ScreenSpaceReflection.html). SSR is a technique for calculating reflections by reusing screen space data. | +| **- Transparent** | Enable the checkbox to make HDRP support [screen space reflection](https://docs.unity3d.com/Manual/PostProcessing-ScreenSpaceReflection.html) on transparent materials.| | **Reflection and Planar Probes Format** | Color format used for reflection and planar probes. | | **Compress Reflection Probe Cache** | Enable the checkbox to compress the [Reflection Probe](Reflection-Probe.md) cache in order to save space on disk. | | **Reflection Cubemap Size** | Use the drop-down to select the maximum resolution of individual Reflection Probe[ ](https://docs.unity3d.com/Manual/class-Cubemap.html)[cubemaps](https://docs.unity3d.com/Manual/class-Cubemap.html). | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Layered-Lit-Shader.md b/com.unity.render-pipelines.high-definition/Documentation~/Layered-Lit-Shader.md index ba8cfc6f045..e8350d48bb8 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Layered-Lit-Shader.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Layered-Lit-Shader.md @@ -25,7 +25,7 @@ To create a new Layered Lit Material, navigate to your Project's Asset window, r | **Alpha Clipping** | Enable the checkbox to make this Material act like a [Cutout Shader](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterRenderingMode.html). Enabling this feature exposes more properties. For more information about the feature and for the list of properties this feature exposes, see the [Alpha Clipping documentation](Alpha-Clipping.md). | | **Material Type** | Allows you to give your Material a type, which allows you to customize it with different settings depending on the **Material Type** you select. For Layered Lit Materials, you can only use the **Subsurface Scattering**, **Standard**, or **Translucent** **Material Type**. For more information about the feature and for the list of properties each **Material Type** exposes, see the [Material Type documentation](Material-Type.md). | | **Receive Decals** | Enable the checkbox to allow HDRP to draw decals on this Material’s surface. | -| **Receive SSR** | Enable the checkbox to make HDRP include this Material when it processes the screen space reflection pass. | +| **Receive SSR (Transparent)** | Enable the checkbox to make HDRP include this Material when it processes the screen space reflection pass. There is a separate option for transparent Surface Type.| | **Geometric Specular AA** | Enable the checkbox to tell HDRP to perform geometric anti-aliasing on this Material. This modifies the smoothness values on surfaces of curved geometry in order to remove specular artifacts. For more information about the feature and for the list of properties this feature exposes, see the [Geometric Specular Anti-aliasing documentation](Geometric-Specular-Anti-Aliasing.md). | | **Displacement Mode** | Use this drop-down to select the method that HDRP uses to alter the height of the Material’s surface. For more information about the feature and for the list of properties each **Displacement Mode** exposes, see the [Displacement Mode documentation](Displacement-Mode.md). | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Lit-Shader.md b/com.unity.render-pipelines.high-definition/Documentation~/Lit-Shader.md index a21d93575a2..a3a6ca88ecc 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Lit-Shader.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Lit-Shader.md @@ -22,7 +22,7 @@ To create a new Lit Material, navigate to your Project's Asset window, right-cli | **Double-Sided** | Enable the checkbox to make HDRP render both faces of the polygons in your geometry. For more information about the feature and for the list of properties this feature exposes, see the [Double-Sided documentation](Double-Sided.md). | | **Material Type** | Allows you to give your Material a type, which allows you to customize it with different settings depending on the **Material Type** you select. For more information about the feature and for the list of properties each **Material Type** exposes, see the [Material Type documentation](Material-Type.md). | | **Receive Decals** | Enable the checkbox to allow HDRP to draw decals on this Material’s surface. | -| **Receive SSR** | Enable the checkbox to make HDRP include this Material when it processes the screen space reflection pass. | +| **Receive SSR (Transparent)** | Enable the checkbox to make HDRP include this Material when it processes the screen space reflection pass. There is a separate option for transparent Surface Type.| | **Geometric Specular AA** | Enable the checkbox to make HDRP perform geometric anti-aliasing on this Material. This modifies the smoothness values on surfaces of curved geometry in order to remove specular artifacts. For more information about the feature and for the list of properties this feature exposes, see the [Geometric Specular Anti-aliasing documentation](Geometric-Specular-Anti-Aliasing.md). | | **Displacement Mode** | Use this drop-down to select the method that HDRP uses to alter the height of the Material’s surface. For more information about the feature and for the list of properties each **Displacement Mode** exposes, see the [Displacement Mode documentation](Displacement-Mode.md). | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Lit-Tessellation-Shader.md b/com.unity.render-pipelines.high-definition/Documentation~/Lit-Tessellation-Shader.md index a1e9fa83a4c..d4d8a7e741c 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Lit-Tessellation-Shader.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Lit-Tessellation-Shader.md @@ -33,7 +33,7 @@ To create a new Lit Tessellation Material: | **Double-Sided** | Enable the checkbox to make HDRP render both faces of the polygons in your geometry. For more information about the feature and for the list of properties this feature exposes, see the [Double-Sided documentation](Double-Sided.md). | | **Material Type** | Allows you to give your Material a type, which allows you to customize it with different settings depending on the **Material Type** you select. For more information about the feature and for the list of properties each **Material Type** exposes, see the [Material Type documentation](Material-Type.md). | | **Receive Decals** | Enable the checkbox to allow HDRP to draw decals on this Material’s surface. | -| **Receive SSR** | Enable the checkbox to make HDRP include this Material when it processes the screen space reflection pass. | +| **Receive SSR (Transparent)** | Enable the checkbox to make HDRP include this Material when it processes the screen space reflection pass. There is a separate option for transparent Surface Type. | | **Geometric Specular AA** | Enable the checkbox to make HDRP perform geometric anti-aliasing on this Material. This modifies the smoothness values on surfaces of curved geometry in order to remove specular artifacts. For more information about the feature and for the list of properties this feature exposes, see the [Geometric Specular Anti-aliasing documentation](Geometric-Specular-Anti-Aliasing.md). | | **Displacement Mode** | Use this drop-down to select the method that HDRP uses to alter the height of the Material’s surface. For more information about the feature and for the list of properties each **Displacement Mode ** exposes, see the [Displacement Mode documentation](Displacement-Mode.md). | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Fabric.md b/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Fabric.md index 7c5a2bc2c76..93b29c608e7 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Fabric.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Fabric.md @@ -77,7 +77,7 @@ To view these properties, click the **Cog** in the top right of the Master Node. | **Subsurface Scattering** | Indicates whether the Material supports subsurface scattering. To disable subsurface scattering in specific regions of the Material, use the **Subsurface Mask**. | | **Transmission** | Indicates whether the Material supports transmission. | | **Receive Decals** | Enable the checkbox to allow HDRP to draw decals on this Material’s surface. | -| **Receive SSR** | Indicates whether HDRP includes this Material when it processes the screen space reflection pass. | +| **Receive SSR (Transparent)** | Indicates whether HDRP includes this Material when it processes the screen space reflection pass. There is a separate option for transparent Surface Type.| | **Add Precomputed Velocity** | Indicates whether this Material uses precomputed velocity information stored in an Alembic file. | | **Specular Occlusion Mode** | Set the mode that HDRP uses to calculate specular occlusion.
• **Off**: Disables specular occlusion.
• **From AO**: Calculates specular occlusion from the ambient occlusion map and the Camera's view vector.
• **From AO and Bent Normal**: Calculates specular occlusion from the ambient occlusion map, the bent normal map, and the Camera's view vector.
• **Custom**: Allows you to specify your own specular occlusion values. | | **Override Baked GI** | Enable this setting to expose two baked GI [input ports](#InputPorts). This makes this Materials ignore global illumination in your Scene and, instead, allows you to provide your own global illumination values and customize the way this Material looks. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Hair.md b/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Hair.md index 8b54366e636..e7f37a82d1f 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Hair.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Hair.md @@ -71,7 +71,7 @@ To view these properties, click the cog icon in the top right of the master node | **Alpha Clipping** | Enable the checkbox to make this Material act like a [Cutout Shader](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterRenderingMode.html). Enabling this feature exposes more properties. For more information about the feature and for the list of properties this feature exposes, see the [Alpha Clipping documentation](Alpha-Clipping.md). | | **- Use Shadow Threshold** | Enable this setting to set another threshold value for alpha clipping shadows. | | **Receive Decals** | Enable the checkbox to allow HDRP to draw decals on this Material’s surface. | -| **Receive SSR** | Enable this setting to make HDRP include this Material when it processes the screen space reflection pass. | +| **Receive SSR (Transparent)** | Enable this setting to make HDRP include this Material when it processes the screen space reflection pass. There is a separate option for transparent Surface Type.| | **Add Precomputed Velocity** | Enable this setting to use precomputed velocity information stored in an Alembic file. | | **Geometric Specular AA** | Enable this setting to make HDRP perform geometric anti-aliasing on this Material. This modifies the smoothness values on surfaces of curved geometry to remove specular artifacts. For more information about the feature and for the list of properties this feature exposes, see the [Geometric Specular Anti-aliasing documentation](Geometric-Specular-Anti-Aliasing.md). | | **Specular Occlusion Mode** | Set the mode that HDRP uses to calculate specular occlusion.
• **Off**: Disables specular occlusion.
• **From AO**: Calculates specular occlusion from the ambient occlusion map and the Camera's view vector.
• **From AO and Bent Normal**: Calculates specular occlusion from the ambient occlusion map, the bent normal map, and the Camera's view vector.
• **Custom**: Allows you to specify your own specular occlusion values. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Lit.md b/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Lit.md index aaefdc85996..0e47e10ec95 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Lit.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Lit.md @@ -91,7 +91,7 @@ To view these properties, click the gear icon in the top right of the master nod | **Transmission** | Enable the checkbox to make HDRP simulate the translucency of an object using a thickness map. Configure subsurface scattering and transmission settings using a [Diffusion Profile](Diffusion-Profile.md). For more information, see documentation on [Subsurface Scattering](Subsurface-Scattering.md).
This setting only appears when you set **Material Type** to **Subsurface Scattering** | | **Energy Conserving Specular** | Enable the checkbox to make HDRP reduce the diffuse color of the Material if the specular effect is more intense. This makes the lighting of the Material more consistent, which makes the Material look more physically accurate.
This port only appears when you set **Material Type** to **Specular Color** | | **Receive Decals** | Enable the checkbox to allow HDRP to draw decals on this Material’s surface. | -| **Receive SSR** | Enable this setting to make HDRP include this Material when it processes the screen space reflection pass. | +| **Receive SSR (Transparent)** | Enable this setting to make HDRP include this Material when it processes the screen space reflection pass. There is a separate option for transparent Surface Type.| | **Add Precomputed Velocity** | Enable this setting to use precomputed velocity information stored in an Alembic file. | | **Geometric Specular AA** | Enable this setting to make HDRP perform geometric anti-aliasing on this Material. This modifies the smoothness values on surfaces of curved geometry to remove specular artifacts. For more information about the feature and for the list of properties this feature exposes, see the [Geometric Specular Anti-aliasing documentation](Geometric-Specular-Anti-Aliasing.md). | | **Specular Occlusion Mode** | Set the mode that HDRP uses to calculate specular occlusion.
• **Off**: Disables specular occlusion.
• **From AO**: Calculates specular occlusion from the ambient occlusion map and the Camera's view vector.
• **From AO and Bent Normal**: Calculates specular occlusion from the ambient occlusion map, the bent normal map, and the Camera's view vector.
• **Custom**: Allows you to specify your own specular occlusion values. | diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipelineResources/DefaultLookDevProfile.asset b/com.unity.render-pipelines.high-definition/Editor/RenderPipelineResources/DefaultLookDevProfile.asset index 4d962f70368..373f9cd631d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipelineResources/DefaultLookDevProfile.asset +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipelineResources/DefaultLookDevProfile.asset @@ -31,6 +31,9 @@ MonoBehaviour: m_EditorClassIdentifier: active: 1 m_AdvancedMode: 0 + quality: + m_OverrideState: 0 + m_Value: 1 rayTracing: m_OverrideState: 0 m_Value: 0 @@ -44,24 +47,16 @@ MonoBehaviour: m_Value: 0 min: 0 max: 1 - stepCount: - m_OverrideState: 0 - m_Value: 6 - min: 2 - max: 32 radius: m_OverrideState: 1 m_Value: 1 min: 0.25 max: 5 - fullResolution: + spatialBilateralAggressiveness: m_OverrideState: 0 - m_Value: 0 - maximumRadiusInPixels: - m_OverrideState: 0 - m_Value: 40 - min: 16 - max: 256 + m_Value: 0.15 + min: 0 + max: 1 temporalAccumulation: m_OverrideState: 0 m_Value: 1 @@ -70,14 +65,6 @@ MonoBehaviour: m_Value: 0.5 min: 0 max: 1 - bilateralUpsample: - m_OverrideState: 0 - m_Value: 1 - directionCount: - m_OverrideState: 0 - m_Value: 2 - min: 1 - max: 6 blurSharpness: m_OverrideState: 0 m_Value: 0.1 @@ -88,21 +75,41 @@ MonoBehaviour: m_Value: serializedVersion: 2 m_Bits: 4294967295 - rayLength: - m_OverrideState: 0 - m_Value: 0.5 + m_StepCount: + m_OverrideState: 1 + m_Value: 6 + min: 2 + max: 32 + m_FullResolution: + m_OverrideState: 1 + m_Value: 0 + m_MaximumRadiusInPixels: + m_OverrideState: 1 + m_Value: 40 + min: 16 + max: 256 + m_BilateralUpsample: + m_OverrideState: 1 + m_Value: 1 + m_DirectionCount: + m_OverrideState: 1 + m_Value: 2 + min: 1 + max: 6 + m_RayLength: + m_OverrideState: 1 + m_Value: 3 min: 0 - max: 50 - sampleCount: - m_OverrideState: 0 - m_Value: 4 + m_SampleCount: + m_OverrideState: 1 + m_Value: 2 min: 1 max: 64 - denoise: - m_OverrideState: 0 - m_Value: 0 - denoiserRadius: - m_OverrideState: 0 + m_Denoise: + m_OverrideState: 1 + m_Value: 1 + m_DenoiserRadius: + m_OverrideState: 1 m_Value: 0.5 min: 0.001 max: 1 @@ -172,6 +179,10 @@ MonoBehaviour: quality: m_OverrideState: 0 m_Value: 3 + threshold: + m_OverrideState: 0 + m_Value: 0 + min: 0 intensity: m_OverrideState: 1 m_Value: 0.1 @@ -195,15 +206,15 @@ MonoBehaviour: m_OverrideState: 0 m_Value: 0 min: 0 - prefilter: - m_OverrideState: 0 - m_Value: 0 anamorphic: m_OverrideState: 0 m_Value: 1 m_Resolution: m_OverrideState: 0 m_Value: 2 + m_HighQualityPrefiltering: + m_OverrideState: 0 + m_Value: 0 m_HighQualityFiltering: m_OverrideState: 0 m_Value: 1 From 1d70c8be9ee9fbcfbc664df3832f0f255e33a6b8 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 24 Oct 2020 23:52:14 +0200 Subject: [PATCH 41/41] Revert: Fix nan when decal affect normals (#2319) --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 - .../Runtime/Material/Lit/LitDecalData.hlsl | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 02ca9fa9af4..6d7893cba8b 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -38,7 +38,6 @@ The version number for this package has increased due to a version update of a r - Fixed the diffusion profile not being registered as a dependency of the ShaderGraph. - 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. -- Fixed nan when a decal affects normals. - Fixed issue with TAA causing bleeding of a view into another when multiple views are visible. - Fix an issue that caused issues of usability of editor if a very high resolution is set by mistake and then reverted back to a smaller resolution. - Fixed issue where Default Volume Profile Asset change in project settings was not added to the undo stack (case 1285268). diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl index af6e087cf2a..2ec0165034d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl @@ -8,7 +8,7 @@ void ApplyDecalToSurfaceData(DecalSurfaceData decalSurfaceData, float3 vtxNormal // Always test the normal as we can have decompression artifact if (decalSurfaceData.normalWS.w < 1.0) { - surfaceData.normalWS.xyz = SafeNormalize(surfaceData.normalWS.xyz * decalSurfaceData.normalWS.w + decalSurfaceData.normalWS.xyz); + surfaceData.normalWS.xyz = normalize(surfaceData.normalWS.xyz * decalSurfaceData.normalWS.w + decalSurfaceData.normalWS.xyz); } #ifdef DECALS_4RT // only smoothness in 3RT mode