From b0181fa78c745774181ac371c9d5894e77c95c90 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 2 Feb 2021 17:35:55 +0100 Subject: [PATCH 1/2] Have two frames with reprojection off on cut (due to exposure) --- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 3 +++ .../Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index f8ab5ebeb03..4f39b97a5d8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -83,6 +83,8 @@ public struct ViewConstants /// Volumetric history buffer state. public bool volumetricHistoryIsValid = false; + internal int volumetricValidFrames = 0; + /// Width actually used for rendering after dynamic resolution and XR is applied. public int actualWidth { get; private set; } /// Height actually used for rendering after dynamic resolution and XR is applied. @@ -129,6 +131,7 @@ public void Reset() cameraFrameCount = 0; resetPostProcessingHistory = true; volumetricHistoryIsValid = false; + volumetricValidFrames = 0; colorPyramidHistoryIsValid = false; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs index 6430d0dc524..e11be2585eb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs @@ -742,8 +742,10 @@ TextureHandle VolumetricLightingPass(RenderGraph renderGraph, HDCamera hdCamera, FilterVolumetricLighting(data.parameters, data.lightingBuffer, ctx.cmd); }); - if (parameters.enableReprojection) + if (parameters.enableReprojection && hdCamera.volumetricValidFrames > 1) hdCamera.volumetricHistoryIsValid = true; // For the next frame.. + else + hdCamera.volumetricValidFrames++; return passData.lightingBuffer; } From e13ee78629c8d1ac4a63f0958d7529ff60586a13 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 2 Feb 2021 17:46:42 +0100 Subject: [PATCH 2/2] changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 35db6b9a781..23f9cca4b46 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Fixed an exception when opening the color picker in the material UI (case 1307143). - Fixed lights shadow frustum near and far planes. +- White flashes on camera cuts on volumetric fog. ### Changed - Removed the material pass probe volumes evaluation mode.