From e624b61ea528d0f4c739ca3569bafe908881af94 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Fri, 24 Feb 2023 23:32:51 +0100 Subject: [PATCH] Removed all of the TCR auto-generation stuff, as I have no intention of actually supporting this anytime soon --- .../FSR2/ffx_fsr2_tcr_autogen_pass.compute | 14 - .../ffx_fsr2_tcr_autogen_pass.compute.meta | 8 - .../FSR2/shaders/ffx_fsr2_tcr_autogen.h | 250 ------------------ .../FSR2/shaders/ffx_fsr2_tcr_autogen.h.meta | 27 -- .../shaders/ffx_fsr2_tcr_autogen_pass.hlsl | 114 -------- .../ffx_fsr2_tcr_autogen_pass.hlsl.meta | 7 - Assets/Scripts/Fsr2Context.cs | 2 - 7 files changed, 422 deletions(-) delete mode 100644 Assets/Resources/FSR2/ffx_fsr2_tcr_autogen_pass.compute delete mode 100644 Assets/Resources/FSR2/ffx_fsr2_tcr_autogen_pass.compute.meta delete mode 100644 Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen.h delete mode 100644 Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen.h.meta delete mode 100644 Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.hlsl delete mode 100644 Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.hlsl.meta diff --git a/Assets/Resources/FSR2/ffx_fsr2_tcr_autogen_pass.compute b/Assets/Resources/FSR2/ffx_fsr2_tcr_autogen_pass.compute deleted file mode 100644 index 40e092b..0000000 --- a/Assets/Resources/FSR2/ffx_fsr2_tcr_autogen_pass.compute +++ /dev/null @@ -1,14 +0,0 @@ -#pragma kernel CS - -#pragma multi_compile_local __ FFX_HALF -#pragma multi_compile_local __ FFX_FSR2_OPTION_REPROJECT_USE_LANCZOS_TYPE -#pragma multi_compile_local __ FFX_FSR2_OPTION_HDR_COLOR_INPUT -#pragma multi_compile_local __ FFX_FSR2_OPTION_LOW_RESOLUTION_MOTION_VECTORS -#pragma multi_compile_local __ FFX_FSR2_OPTION_JITTERED_MOTION_VECTORS -#pragma multi_compile_local __ FFX_FSR2_OPTION_INVERTED_DEPTH -#pragma multi_compile_local __ FFX_FSR2_OPTION_APPLY_SHARPENING - -#define FFX_GPU // Compiling for GPU -#define FFX_HLSL // Compile for plain HLSL - -#include "shaders/ffx_fsr2_tcr_autogen_pass.hlsl" diff --git a/Assets/Resources/FSR2/ffx_fsr2_tcr_autogen_pass.compute.meta b/Assets/Resources/FSR2/ffx_fsr2_tcr_autogen_pass.compute.meta deleted file mode 100644 index a6118a2..0000000 --- a/Assets/Resources/FSR2/ffx_fsr2_tcr_autogen_pass.compute.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e7f95f2317bb74045a43b795b8928cbe -ComputeShaderImporter: - externalObjects: {} - preprocessorOverride: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen.h b/Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen.h deleted file mode 100644 index 101b75d..0000000 --- a/Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen.h +++ /dev/null @@ -1,250 +0,0 @@ -// This file is part of the FidelityFX SDK. -// -// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#define USE_YCOCG 1 - -#define fAutogenEpsilon 0.01f - -// EXPERIMENTAL - -FFX_MIN16_F ComputeAutoTC_01(FFX_MIN16_I2 uDispatchThreadId, FFX_MIN16_I2 iPrevIdx) -{ - FfxFloat32x3 colorPreAlpha = LoadOpaqueOnly(uDispatchThreadId); - FfxFloat32x3 colorPostAlpha = LoadInputColor(uDispatchThreadId); - FfxFloat32x3 colorPrevPreAlpha = LoadPrevPreAlpha(iPrevIdx); - FfxFloat32x3 colorPrevPostAlpha = LoadPrevPostAlpha(iPrevIdx); - -#if USE_YCOCG - colorPreAlpha = RGBToYCoCg(colorPreAlpha); - colorPostAlpha = RGBToYCoCg(colorPostAlpha); - colorPrevPreAlpha = RGBToYCoCg(colorPrevPreAlpha); - colorPrevPostAlpha = RGBToYCoCg(colorPrevPostAlpha); -#endif - - FfxFloat32x3 colorDeltaCurr = colorPostAlpha - colorPreAlpha; - FfxFloat32x3 colorDeltaPrev = colorPrevPostAlpha - colorPrevPreAlpha; - bool hasAlpha = any(FFX_GREATER_THAN(abs(colorDeltaCurr), FfxFloat32x3(fAutogenEpsilon, fAutogenEpsilon, fAutogenEpsilon))); - bool hadAlpha = any(FFX_GREATER_THAN(abs(colorDeltaPrev), FfxFloat32x3(fAutogenEpsilon, fAutogenEpsilon, fAutogenEpsilon))); - - FfxFloat32x3 X = colorPreAlpha; - FfxFloat32x3 Y = colorPostAlpha; - FfxFloat32x3 Z = colorPrevPreAlpha; - FfxFloat32x3 W = colorPrevPostAlpha; - - FFX_MIN16_F retVal = FFX_MIN16_F(ffxSaturate(dot(abs(abs(Y - X) - abs(W - Z)), FfxFloat32x3(1, 1, 1)))); - - // cleanup very small values - retVal = (retVal < getTcThreshold()) ? FFX_MIN16_F(0.0f) : FFX_MIN16_F(1.f); - - return retVal; -} - -// works ok: thin edges -FFX_MIN16_F ComputeAutoTC_02(FFX_MIN16_I2 uDispatchThreadId, FFX_MIN16_I2 iPrevIdx) -{ - FfxFloat32x3 colorPreAlpha = LoadOpaqueOnly(uDispatchThreadId); - FfxFloat32x3 colorPostAlpha = LoadInputColor(uDispatchThreadId); - FfxFloat32x3 colorPrevPreAlpha = LoadPrevPreAlpha(iPrevIdx); - FfxFloat32x3 colorPrevPostAlpha = LoadPrevPostAlpha(iPrevIdx); - -#if USE_YCOCG - colorPreAlpha = RGBToYCoCg(colorPreAlpha); - colorPostAlpha = RGBToYCoCg(colorPostAlpha); - colorPrevPreAlpha = RGBToYCoCg(colorPrevPreAlpha); - colorPrevPostAlpha = RGBToYCoCg(colorPrevPostAlpha); -#endif - - FfxFloat32x3 colorDelta = colorPostAlpha - colorPreAlpha; - FfxFloat32x3 colorPrevDelta = colorPrevPostAlpha - colorPrevPreAlpha; - bool hasAlpha = any(FFX_GREATER_THAN(abs(colorDelta), FfxFloat32x3(fAutogenEpsilon, fAutogenEpsilon, fAutogenEpsilon))); - bool hadAlpha = any(FFX_GREATER_THAN(abs(colorPrevDelta), FfxFloat32x3(fAutogenEpsilon, fAutogenEpsilon, fAutogenEpsilon))); - - FfxFloat32x3 delta = colorPostAlpha - colorPreAlpha; //prev+1*d = post => d = color, alpha = - FfxFloat32x3 deltaPrev = colorPrevPostAlpha - colorPrevPreAlpha; - - FfxFloat32x3 X = colorPrevPreAlpha; - FfxFloat32x3 N = colorPreAlpha - colorPrevPreAlpha; - FfxFloat32x3 YAminusXA = colorPrevPostAlpha - colorPrevPreAlpha; - FfxFloat32x3 NminusNA = colorPostAlpha - colorPrevPostAlpha; - - FfxFloat32x3 A = (hasAlpha || hadAlpha) ? NminusNA / max(FfxFloat32x3(fAutogenEpsilon, fAutogenEpsilon, fAutogenEpsilon), N) : FfxFloat32x3(0, 0, 0); - - FFX_MIN16_F retVal = FFX_MIN16_F( max(max(A.x, A.y), A.z) ); - - // only pixels that have significantly changed in color shuold be considered - retVal = ffxSaturate(retVal * FFX_MIN16_F(length(colorPostAlpha - colorPrevPostAlpha)) ); - - return retVal; -} - -// This function computes the TransparencyAndComposition mask: -// This mask indicates pixels that should discard locks and apply color clamping. -// -// Typically this is the case for translucent pixels (that don't write depth values) or pixels where the correctness of -// the MVs can not be guaranteed (e.g. procedutal movement or vegetation that does not have MVs to reduce the cost during rasterization) -// Also, large changes in color due to changed lighting should be marked to remove locks on pixels with "old" lighting. -// -// This function takes a opaque only and a final texture and uses internal copies of those textures from the last frame. -// The function tries to determine where the color changes between opaque only and final image to determine the pixels that use transparency. -// Also it uses the previous frames and detects where the use of transparency changed to mark those pixels. -// Additionally it marks pixels where the color changed significantly in the opaque only image, e.g. due to lighting or texture animation. -// -// In the final step it stores the current textures in internal textures for the next frame - -FFX_MIN16_F ComputeTransparencyAndComposition(FFX_MIN16_I2 uDispatchThreadId, FFX_MIN16_I2 iPrevIdx) -{ - FFX_MIN16_F retVal = ComputeAutoTC_02(uDispatchThreadId, iPrevIdx); - - // [branch] - if (retVal > FFX_MIN16_F(0.01f)) - { - retVal = ComputeAutoTC_01(uDispatchThreadId, iPrevIdx); - } - return retVal; -} - -float computeSolidEdge(FFX_MIN16_I2 curPos, FFX_MIN16_I2 prevPos) -{ - float lum[9]; - int i = 0; - for (int y = -1; y < 2; ++y) - { - for (int x = -1; x < 2; ++x) - { - FfxFloat32x3 curCol = LoadOpaqueOnly(curPos + FFX_MIN16_I2(x, y)).rgb; - FfxFloat32x3 prevCol = LoadPrevPreAlpha(prevPos + FFX_MIN16_I2(x, y)).rgb; - lum[i++] = length(curCol - prevCol); - } - } - - //float gradX = abs(lum[3] - lum[4]) + abs(lum[5] - lum[4]); - //float gradY = abs(lum[1] - lum[4]) + abs(lum[7] - lum[4]); - - //return sqrt(gradX * gradX + gradY * gradY); - - float gradX = abs(lum[3] - lum[4]) * abs(lum[5] - lum[4]); - float gradY = abs(lum[1] - lum[4]) * abs(lum[7] - lum[4]); - - return sqrt(sqrt(gradX * gradY)); -} - -float computeAlphaEdge(FFX_MIN16_I2 curPos, FFX_MIN16_I2 prevPos) -{ - float lum[9]; - int i = 0; - for (int y = -1; y < 2; ++y) - { - for (int x = -1; x < 2; ++x) - { - FfxFloat32x3 curCol = abs(LoadInputColor(curPos + FFX_MIN16_I2(x, y)).rgb - LoadOpaqueOnly(curPos + FFX_MIN16_I2(x, y)).rgb); - FfxFloat32x3 prevCol = abs(LoadPrevPostAlpha(prevPos + FFX_MIN16_I2(x, y)).rgb - LoadPrevPreAlpha(prevPos + FFX_MIN16_I2(x, y)).rgb); - lum[i++] = length(curCol - prevCol); - } - } - - //float gradX = abs(lum[3] - lum[4]) + abs(lum[5] - lum[4]); - //float gradY = abs(lum[1] - lum[4]) + abs(lum[7] - lum[4]); - - //return sqrt(gradX * gradX + gradY * gradY); - - float gradX = abs(lum[3] - lum[4]) * abs(lum[5] - lum[4]); - float gradY = abs(lum[1] - lum[4]) * abs(lum[7] - lum[4]); - - return sqrt(sqrt(gradX * gradY)); -} - -FFX_MIN16_F ComputeAabbOverlap(FFX_MIN16_I2 uDispatchThreadId, FFX_MIN16_I2 iPrevIdx) -{ - FFX_MIN16_F retVal = FFX_MIN16_F(0.f); - - FfxFloat32x2 fMotionVector = LoadInputMotionVector(uDispatchThreadId); - FfxFloat32x3 colorPreAlpha = LoadOpaqueOnly(uDispatchThreadId); - FfxFloat32x3 colorPostAlpha = LoadInputColor(uDispatchThreadId); - FfxFloat32x3 colorPrevPreAlpha = LoadPrevPreAlpha(iPrevIdx); - FfxFloat32x3 colorPrevPostAlpha = LoadPrevPostAlpha(iPrevIdx); - -#if USE_YCOCG - colorPreAlpha = RGBToYCoCg(colorPreAlpha); - colorPostAlpha = RGBToYCoCg(colorPostAlpha); - colorPrevPreAlpha = RGBToYCoCg(colorPrevPreAlpha); - colorPrevPostAlpha = RGBToYCoCg(colorPrevPostAlpha); -#endif - FfxFloat32x3 minPrev = FFX_MIN16_F3(+1000.f, +1000.f, +1000.f); - FfxFloat32x3 maxPrev = FFX_MIN16_F3(-1000.f, -1000.f, -1000.f); - for (int y = -1; y < 2; ++y) - { - for (int x = -1; x < 2; ++x) - { - FfxFloat32x3 W = LoadPrevPostAlpha(iPrevIdx + FFX_MIN16_I2(x, y)); - -#if USE_YCOCG - W = RGBToYCoCg(W); -#endif - minPrev = min(minPrev, W); - maxPrev = max(maxPrev, W); - } - } - // instead of computing the overlap: simply count how many samples are outside - // set reactive based on that - FFX_MIN16_F count = FFX_MIN16_F(0.f); - for (int y = -1; y < 2; ++y) - { - for (int x = -1; x < 2; ++x) - { - FfxFloat32x3 Y = LoadInputColor(uDispatchThreadId + FFX_MIN16_I2(x, y)); - -#if USE_YCOCG - Y = RGBToYCoCg(Y); -#endif - count += ((Y.x < minPrev.x) || (Y.x > maxPrev.x)) ? FFX_MIN16_F(1.f) : FFX_MIN16_F(0.f); - count += ((Y.y < minPrev.y) || (Y.y > maxPrev.y)) ? FFX_MIN16_F(1.f) : FFX_MIN16_F(0.f); - count += ((Y.z < minPrev.z) || (Y.z > maxPrev.z)) ? FFX_MIN16_F(1.f) : FFX_MIN16_F(0.f); - } - } - retVal = count / FFX_MIN16_F(27.f); - - return retVal; -} - - -// This function computes the Reactive mask: -// We want pixels marked where the alpha portion of the frame changes a lot between neighbours -// Those pixels are expected to change quickly between frames, too. (e.g. small particles, reflections on curved surfaces...) -// As a result history would not be trustworthy. -// On the other hand we don't want pixels marked where pre-alpha has a large differnce, since those would profit from accumulation -// For mirrors we may assume the pre-alpha is pretty uniform color. -// -// This works well generally, but also marks edge pixels -FFX_MIN16_F ComputeReactive(FFX_MIN16_I2 uDispatchThreadId, FFX_MIN16_I2 iPrevIdx) -{ - // we only get here if alpha has a significant contribution and has changed since last frame. - FFX_MIN16_F retVal = FFX_MIN16_F(0.f); - - // mark pixels with huge variance in alpha as reactive - FFX_MIN16_F alphaEdge = FFX_MIN16_F(computeAlphaEdge(uDispatchThreadId, iPrevIdx)); - FFX_MIN16_F opaqueEdge = FFX_MIN16_F(computeSolidEdge(uDispatchThreadId, iPrevIdx)); - retVal = ffxSaturate(alphaEdge - opaqueEdge); - - // the above also marks edge pixels due to jitter, so we need to cancel those out - - - return retVal; -} diff --git a/Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen.h.meta b/Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen.h.meta deleted file mode 100644 index 9394b7f..0000000 --- a/Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen.h.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 6f2847e89a16de145b7f3d8d57e402b2 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.hlsl b/Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.hlsl deleted file mode 100644 index 8e635d1..0000000 --- a/Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.hlsl +++ /dev/null @@ -1,114 +0,0 @@ -// This file is part of the FidelityFX SDK. -// -// Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#define FSR2_BIND_SRV_INPUT_OPAQUE_ONLY 0 -#define FSR2_BIND_SRV_INPUT_COLOR 1 -#define FSR2_BIND_SRV_INPUT_MOTION_VECTORS 2 -#define FSR2_BIND_SRV_PREV_PRE_ALPHA_COLOR 3 -#define FSR2_BIND_SRV_PREV_POST_ALPHA_COLOR 4 -#define FSR2_BIND_SRV_REACTIVE_MASK 4 -#define FSR2_BIND_SRV_TRANSPARENCY_AND_COMPOSITION_MASK 5 - -#define FSR2_BIND_UAV_AUTOREACTIVE 0 -#define FSR2_BIND_UAV_AUTOCOMPOSITION 1 -#define FSR2_BIND_UAV_PREV_PRE_ALPHA_COLOR 2 -#define FSR2_BIND_UAV_PREV_POST_ALPHA_COLOR 3 - -#define FSR2_BIND_CB_FSR2 0 -#define FSR2_BIND_CB_AUTOREACTIVE 1 - -#include "ffx_fsr2_callbacks_hlsl.h" -#include "ffx_fsr2_common.h" - -#if defined(FSR2_BIND_CB_AUTOREACTIVE) - cbuffer cbGenerateReactive : FFX_FSR2_DECLARE_CB(FSR2_BIND_CB_AUTOREACTIVE) - { - float fTcThreshold; // 0.1 is a good starting value, lower will result in more TC pixels - float fTcScale; - float fReactiveScale; - float fReactiveMax; - }; - float getTcThreshold() - { - return fTcThreshold; - } -#else - #define fTcThreshold 0.05f - #define fTcScale 1.00f - #define fReactiveScale 10.0f - #define fReactiveMax 0.90f - float getTcThreshold() - { - return fTcThreshold; - } -#endif - -#include "ffx_fsr2_tcr_autogen.h" - -#ifndef FFX_FSR2_THREAD_GROUP_WIDTH -#define FFX_FSR2_THREAD_GROUP_WIDTH 8 -#endif // #ifndef FFX_FSR2_THREAD_GROUP_WIDTH -#ifndef FFX_FSR2_THREAD_GROUP_HEIGHT -#define FFX_FSR2_THREAD_GROUP_HEIGHT 8 -#endif // FFX_FSR2_THREAD_GROUP_HEIGHT -#ifndef FFX_FSR2_THREAD_GROUP_DEPTH -#define FFX_FSR2_THREAD_GROUP_DEPTH 1 -#endif // #ifndef FFX_FSR2_THREAD_GROUP_DEPTH -#ifndef FFX_FSR2_NUM_THREADS -#define FFX_FSR2_NUM_THREADS [numthreads(FFX_FSR2_THREAD_GROUP_WIDTH, FFX_FSR2_THREAD_GROUP_HEIGHT, FFX_FSR2_THREAD_GROUP_DEPTH)] -#endif // #ifndef FFX_FSR2_NUM_THREADS - -FFX_FSR2_NUM_THREADS -FFX_FSR2_EMBED_ROOTSIG_CONTENT -void CS(uint2 uGroupId : SV_GroupID, uint2 uGroupThreadId : SV_GroupThreadID) -{ - FFX_MIN16_I2 uDispatchThreadId = FFX_MIN16_I2(uGroupId * uint2(FFX_FSR2_THREAD_GROUP_WIDTH, FFX_FSR2_THREAD_GROUP_HEIGHT) + uGroupThreadId); - - // ToDo: take into account jitter (i.e. add delta of previous jitter and current jitter to previous UV - // fetch pre- and post-alpha color values - FFX_MIN16_F2 fUv = ( FFX_MIN16_F2(uDispatchThreadId) + FFX_MIN16_F2(0.5f, 0.5f) ) / FFX_MIN16_F2( RenderSize() ); - FFX_MIN16_F2 fPrevUV = fUv + FFX_MIN16_F2( LoadInputMotionVector(uDispatchThreadId) ); - FFX_MIN16_I2 iPrevIdx = FFX_MIN16_I2(fPrevUV * FFX_MIN16_F2(RenderSize()) - 0.5f); - - FFX_MIN16_F3 colorPreAlpha = FFX_MIN16_F3( LoadOpaqueOnly( uDispatchThreadId ) ); - FFX_MIN16_F3 colorPostAlpha = FFX_MIN16_F3( LoadInputColor( uDispatchThreadId ) ); - - FFX_MIN16_F2 outReactiveMask = 0; - - outReactiveMask.y = ComputeTransparencyAndComposition(uDispatchThreadId, iPrevIdx); - - if (outReactiveMask.y > 0.5f) - { - outReactiveMask.x = ComputeReactive(uDispatchThreadId, iPrevIdx); - outReactiveMask.x *= FFX_MIN16_F(fReactiveScale); - outReactiveMask.x = outReactiveMask.x < fReactiveMax ? outReactiveMask.x : FFX_MIN16_F( fReactiveMax ); - } - - outReactiveMask.y *= FFX_MIN16_F(fTcScale ); - - outReactiveMask.x = max( outReactiveMask.x, FFX_MIN16_F( LoadReactiveMask(uDispatchThreadId) ) ); - outReactiveMask.y = max( outReactiveMask.y, FFX_MIN16_F( LoadTransparencyAndCompositionMask(uDispatchThreadId) ) ); - - StoreAutoReactive(uDispatchThreadId, outReactiveMask); - - StorePrevPreAlpha(uDispatchThreadId, colorPreAlpha); - StorePrevPostAlpha(uDispatchThreadId, colorPostAlpha); -} diff --git a/Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.hlsl.meta b/Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.hlsl.meta deleted file mode 100644 index 733cab7..0000000 --- a/Assets/Resources/FSR2/shaders/ffx_fsr2_tcr_autogen_pass.hlsl.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 28d10665f0175ed4bb9571389f5bb258 -ShaderIncludeImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Fsr2Context.cs b/Assets/Scripts/Fsr2Context.cs index d5f924e..5b79bfe 100644 --- a/Assets/Scripts/Fsr2Context.cs +++ b/Assets/Scripts/Fsr2Context.cs @@ -21,7 +21,6 @@ namespace FidelityFX private Fsr2Pipeline _rcasPipeline; private Fsr2Pipeline _computeLuminancePyramidPipeline; private Fsr2Pipeline _generateReactivePipeline; - private Fsr2Pipeline _tcrAutogeneratePipeline; private readonly Fsr2Resources _resources = new Fsr2Resources(); @@ -82,7 +81,6 @@ namespace FidelityFX public void Destroy() { - DestroyPipeline(ref _tcrAutogeneratePipeline); DestroyPipeline(ref _generateReactivePipeline); DestroyPipeline(ref _computeLuminancePyramidPipeline); DestroyPipeline(ref _rcasPipeline);