From 010be580b967fb3ccd42e167b16d615ce8398570 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Wed, 6 Nov 2024 16:17:59 +0100 Subject: [PATCH] Simplified prepare inputs shader and added a comment about the depth RT --- .../PostProcessing/Runtime/Effects/Upscaling/PSSRUpscaler.cs | 2 +- .../PostProcessing/Shaders/Builtins/PrepareInputs.compute | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/PSSRUpscaler.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/PSSRUpscaler.cs index 86fdb69..ce6c51a 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/PSSRUpscaler.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/PSSRUpscaler.cs @@ -39,7 +39,7 @@ namespace UnityEngine.Rendering.PostProcessing initParams.maxRenderHeight = (uint)config.MaxRenderSize.y; CreateRenderTexture(ref _inputColor, "PSSR Input Color", config.MaxRenderSize, context.sourceFormat, true); - CreateRenderTexture(ref _inputDepth, "PSSR Input Depth", config.MaxRenderSize, GraphicsFormat.R32_SFloat, true); + CreateRenderTexture(ref _inputDepth, "PSSR Input Depth", config.MaxRenderSize, GraphicsFormat.R32_SFloat, true); // TODO: this texture won't have tile mode kDepth, meaning PSSR doesn't detect it correctly. Is this a problem? CreateRenderTexture(ref _inputMotionVectors, "PSSR Input Motion Vectors", config.MaxRenderSize, GraphicsFormat.R16G16_SFloat, true); CreateRenderTexture(ref _outputColor, "PSSR Output Color", config.UpscaleSize, RenderTextureFormat.RGB111110Float); diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/PrepareInputs.compute b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/PrepareInputs.compute index bfed7e0..b24413f 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/PrepareInputs.compute +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Shaders/Builtins/PrepareInputs.compute @@ -17,9 +17,9 @@ cbuffer Params: register(b0) }; [numthreads(8, 8, 1)] -void CS(uint2 GroupId: SV_GroupID, uint2 GroupThreadId: SV_GroupThreadID) +void CS(uint3 dtid : SV_DispatchThreadID) { - uint2 InputPos = GroupId * uint2(8, 8) + GroupThreadId; + uint2 InputPos = dtid.xy; if (prepareColor) OutColor[InputPos] = InColor[InputPos]; if (prepareDepth) OutDepth[InputPos] = InDepth[InputPos];