From e4344cb4e37fd912f10fe5337fc78c50154c2285 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 22 Jul 2021 13:42:36 +0200 Subject: [PATCH 1/2] Fix --- .../RenderPipeline/HDRenderPipeline.PostProcess.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 8ab8c041f54..0457b229fce 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1185,6 +1185,8 @@ TextureHandle DynamicExposurePass(RenderGraph renderGraph, HDCamera hdCamera, Te { // Dynamic exposure - will be applied in the next frame // Not considered as a post-process so it's not affected by its enabled state + + TextureHandle exposureForImmediateApplication = TextureHandle.nullHandle; if (!IsExposureFixed(hdCamera) && hdCamera.exposureControlFS) { using (var builder = renderGraph.AddRenderPass("Dynamic Exposure", out var passData, ProfilingSampler.Get(HDProfileId.DynamicExposure))) @@ -1199,6 +1201,7 @@ TextureHandle DynamicExposurePass(RenderGraph renderGraph, HDCamera hdCamera, Te { DoHistogramBasedExposure(data, ctx.cmd); }); + exposureForImmediateApplication = passData.nextExposure; } else { @@ -1212,6 +1215,7 @@ TextureHandle DynamicExposurePass(RenderGraph renderGraph, HDCamera hdCamera, Te { DoDynamicExposure(data, ctx.cmd); }); + exposureForImmediateApplication = passData.nextExposure; } } @@ -1227,7 +1231,7 @@ TextureHandle DynamicExposurePass(RenderGraph renderGraph, HDCamera hdCamera, Te passData.height = hdCamera.actualHeight; passData.viewCount = hdCamera.viewCount; passData.source = builder.ReadTexture(source); - passData.prevExposure = builder.ReadTexture(renderGraph.ImportTexture(GetPreviousExposureTexture(hdCamera))); + passData.prevExposure = exposureForImmediateApplication; TextureHandle dest = GetPostprocessOutputHandle(renderGraph, "Apply Exposure Destination"); passData.destination = builder.WriteTexture(dest); @@ -1235,10 +1239,6 @@ TextureHandle DynamicExposurePass(RenderGraph renderGraph, HDCamera hdCamera, Te builder.SetRenderFunc( (ApplyExposureData data, RenderGraphContext ctx) => { - // Note: we use previous instead of current because the textures - // are swapped internally as the system expects the texture will be used - // on the next frame. So the actual "current" for this frame is in - // "previous". ctx.cmd.SetComputeTextureParam(data.applyExposureCS, data.applyExposureKernel, HDShaderIDs._ExposureTexture, data.prevExposure); ctx.cmd.SetComputeTextureParam(data.applyExposureCS, data.applyExposureKernel, HDShaderIDs._InputTexture, data.source); ctx.cmd.SetComputeTextureParam(data.applyExposureCS, data.applyExposureKernel, HDShaderIDs._OutputTexture, data.destination); From 37896b86891ec57068ec78e53fe09142a5758a14 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Thu, 22 Jul 2021 13:43:57 +0200 Subject: [PATCH 2/2] changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 04055d66a4e..27e1a6369a6 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -309,6 +309,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed conflicting runtime debug menu command with an option to disable runtime debug window hotkey. - Fixed screen-space shadows with XR single-pass and camera relative rendering (1348260). - Fixed ghosting issues if the exposure changed too much (RTGI). +- Fix white flashes when history is reset due to changes on type of upsampler. ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard