From 9668b132e7d11a21323608e72e40840d8885f8d1 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Fri, 7 Jul 2023 10:50:00 +0200 Subject: [PATCH] Clear initial exposure value with zero. Seems to work fine for all tested platforms, and eliminates the black screen flashes on Metal without requiring any platform-specific hacks. --- Assets/Scripts/Core/Fsr2Context.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/Core/Fsr2Context.cs b/Assets/Scripts/Core/Fsr2Context.cs index cb67355..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, SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal ? Color.clear : 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);