From 8b09078a0dc3ebea937b1905b1edbb697d64dea8 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Sat, 8 Jul 2023 19:49:06 +0200 Subject: [PATCH] Clear initial auto-exposure value to zero instead of negative one. Fixes black screen flashes on Metal when performing an accumulation reset. --- Assets/Scripts/Core/Fsr2Context.cs | 2 +- .../PostProcessing/Runtime/FSR2/Fsr2Context.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Core/Fsr2Context.cs b/Assets/Scripts/Core/Fsr2Context.cs index 64ca979..5105008 100644 --- a/Assets/Scripts/Core/Fsr2Context.cs +++ b/Assets/Scripts/Core/Fsr2Context.cs @@ -204,7 +204,7 @@ namespace FidelityFX // Auto exposure always used to track luma changes in locking logic commandBuffer.SetRenderTarget(_resources.AutoExposure); - commandBuffer.ClearRenderTarget(false, true, new Color(-1f, 1e8f, 0f, 0f)); + commandBuffer.ClearRenderTarget(false, true, new Color(0f, 1e8f, 0f, 0f)); // Reset atomic counter to 0 commandBuffer.SetRenderTarget(_resources.SpdAtomicCounter); diff --git a/com.unity.postprocessing/PostProcessing/Runtime/FSR2/Fsr2Context.cs b/com.unity.postprocessing/PostProcessing/Runtime/FSR2/Fsr2Context.cs index 64ca979..5105008 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/FSR2/Fsr2Context.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/FSR2/Fsr2Context.cs @@ -204,7 +204,7 @@ namespace FidelityFX // Auto exposure always used to track luma changes in locking logic commandBuffer.SetRenderTarget(_resources.AutoExposure); - commandBuffer.ClearRenderTarget(false, true, new Color(-1f, 1e8f, 0f, 0f)); + commandBuffer.ClearRenderTarget(false, true, new Color(0f, 1e8f, 0f, 0f)); // Reset atomic counter to 0 commandBuffer.SetRenderTarget(_resources.SpdAtomicCounter);