From 489b8571d2d7e899c09b6e267d5d5f5086dac321 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Thu, 1 Jun 2023 11:09:13 +0200 Subject: [PATCH] Reset camera viewport in OnRenderImage when we're not blitting directly to the camera target. This fixes some potential issues with other systems that are affected by when/where the camera viewport is modified. --- .../PostProcessing/Runtime/PostProcessLayer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs index 6576021..8735f41 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs @@ -292,6 +292,9 @@ namespace UnityEngine.Rendering.PostProcessing if (!finalBlitToCameraTarget && m_CurrentContext.IsSuperResolutionActive()) { + // Set the camera back to its original parameters, so we can output at full display resolution + superResolution.ResetCameraViewport(m_CurrentContext); + // Blit the upscaled image to the backbuffer Graphics.Blit(m_upscaledOutput, dst); m_upscaledOutput.Release(); @@ -762,7 +765,7 @@ namespace UnityEngine.Rendering.PostProcessing return; // Set the camera back to its original parameters, so we can output at full display resolution - if (m_CurrentContext.IsSuperResolutionActive()) + if (finalBlitToCameraTarget && m_CurrentContext.IsSuperResolutionActive()) { superResolution.ResetCameraViewport(m_CurrentContext); }