diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SuperResolution.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SuperResolution.cs index abfa966..e80ab93 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SuperResolution.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SuperResolution.cs @@ -102,6 +102,7 @@ namespace UnityEngine.Rendering.PostProcessing public Vector2 jitter { get; private set; } public Vector2Int renderSize => _renderSize; public Vector2Int displaySize => _displaySize; + public RenderTargetIdentifier colorOpaqueOnly { get; set; } private Fsr2Context _fsrContext; private Vector2Int _renderSize; @@ -163,7 +164,7 @@ namespace UnityEngine.Rendering.PostProcessing context.camera.rect = _originalRect; } - public void Render(PostProcessRenderContext context, RenderTargetIdentifier opaqueOnly) + public void Render(PostProcessRenderContext context) { var cmd = context.command; cmd.BeginSample("FSR2"); @@ -180,11 +181,11 @@ namespace UnityEngine.Rendering.PostProcessing cmd.SetGlobalTexture(Fsr2ShaderIDs.SrvInputDepth, BuiltinRenderTextureType.CameraTarget, RenderTextureSubElement.Depth); cmd.SetGlobalTexture(Fsr2ShaderIDs.SrvInputMotionVectors, BuiltinRenderTextureType.MotionVectors); - SetupDispatchDescription(context, opaqueOnly); + SetupDispatchDescription(context); if (autoGenerateReactiveMask) { - SetupAutoReactiveDescription(context, opaqueOnly); + SetupAutoReactiveDescription(context); cmd.GetTemporaryRT(Fsr2ShaderIDs.UavAutoReactive, _renderSize.x, _renderSize.y, 0, default, GraphicsFormat.R8_UNorm, 1, true); _fsrContext.GenerateReactiveMask(_genReactiveDescription, cmd); @@ -263,7 +264,7 @@ namespace UnityEngine.Rendering.PostProcessing jitter = new Vector2(jitterX, jitterY); } - private void SetupDispatchDescription(PostProcessRenderContext context, RenderTargetIdentifier opaqueOnly) + private void SetupDispatchDescription(PostProcessRenderContext context) { var camera = context.camera; @@ -299,7 +300,7 @@ namespace UnityEngine.Rendering.PostProcessing _dispatchDescription.EnableAutoReactive = autoGenerateTransparencyAndComposition; if (autoGenerateTransparencyAndComposition) { - _dispatchDescription.ColorOpaqueOnly = opaqueOnly; + _dispatchDescription.ColorOpaqueOnly = colorOpaqueOnly; _dispatchDescription.AutoTcThreshold = generateTransparencyAndCompositionParameters.autoTcThreshold; _dispatchDescription.AutoTcScale = generateTransparencyAndCompositionParameters.autoTcScale; _dispatchDescription.AutoReactiveScale = generateTransparencyAndCompositionParameters.autoReactiveScale; @@ -313,9 +314,9 @@ namespace UnityEngine.Rendering.PostProcessing } } - private void SetupAutoReactiveDescription(PostProcessRenderContext context, RenderTargetIdentifier opaqueOnly) + private void SetupAutoReactiveDescription(PostProcessRenderContext context) { - _genReactiveDescription.ColorOpaqueOnly = opaqueOnly; + _genReactiveDescription.ColorOpaqueOnly = colorOpaqueOnly; _genReactiveDescription.ColorPreUpscale = null; _genReactiveDescription.OutReactive = null; _genReactiveDescription.RenderSize = _renderSize; 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 d9146db..1b7145a 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 @@ -1159,7 +1159,8 @@ namespace UnityEngine.Rendering.PostProcessing var finalDestination = context.destination; context.GetScreenSpaceTemporaryRT(cmd, fsrTarget, 0, context.sourceFormat); context.destination = fsrTarget; - superResolution.Render(context, m_opaqueOnly); + superResolution.colorOpaqueOnly = m_opaqueOnly; + superResolution.Render(context); context.source = fsrTarget; context.destination = finalDestination;