From 490c5389ff8d29eb575f72669ec086749bb46266 Mon Sep 17 00:00:00 2001 From: papadanku Date: Sat, 7 Sep 2024 17:36:48 -0700 Subject: [PATCH] cRCAS: Update Luma calculation --- shaders/cCAS.fx | 4 ++-- shaders/cRCAS.fx | 4 ++-- shaders/shared/fidelityfx/cRCAS.fxh | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/shaders/cCAS.fx b/shaders/cCAS.fx index 8e445ad..d054a17 100644 --- a/shaders/cCAS.fx +++ b/shaders/cCAS.fx @@ -25,7 +25,7 @@ uniform float _Contrast < #include "shared/cShade.fxh" #include "shared/cBlend.fxh" -float4 PS_CasFilterNoScaling(CShade_VS2PS_Quad Input): SV_TARGET0 +float4 PS_CAS(CShade_VS2PS_Quad Input): SV_TARGET0 { float4 OutputColor = 1.0; float4 OutputMask = 1.0; @@ -54,6 +54,6 @@ technique CShade_CAS < ui_tooltip = "AMD FidelityFX | Contrast Adaptive Sharpeni CBLEND_CREATE_STATES() VertexShader = CShade_VS_Quad; - PixelShader = PS_CasFilterNoScaling; + PixelShader = PS_CAS; } } diff --git a/shaders/cRCAS.fx b/shaders/cRCAS.fx index e938a70..da0828e 100644 --- a/shaders/cRCAS.fx +++ b/shaders/cRCAS.fx @@ -18,7 +18,7 @@ uniform float _Sharpening < #include "shared/cShade.fxh" #include "shared/cBlend.fxh" -float4 PS_CasFilterNoScaling(CShade_VS2PS_Quad Input): SV_TARGET0 +float4 PS_RCAS(CShade_VS2PS_Quad Input): SV_TARGET0 { float4 OutputColor = 1.0; float4 OutputMask = 1.0; @@ -46,6 +46,6 @@ technique CShade_RCAS < ui_tooltip = "AMD FidelityFX | Robust Contrast Adaptive CBLEND_CREATE_STATES() VertexShader = CShade_VS_Quad; - PixelShader = PS_CasFilterNoScaling; + PixelShader = PS_RCAS; } } diff --git a/shaders/shared/fidelityfx/cRCAS.fxh b/shaders/shared/fidelityfx/cRCAS.fxh index fce5b0a..118a2fb 100644 --- a/shaders/shared/fidelityfx/cRCAS.fxh +++ b/shaders/shared/fidelityfx/cRCAS.fxh @@ -90,11 +90,11 @@ // Luma times 2. float Luma[5]; - Luma[0] = dot(Sample[0].rgb, float3(0.5, 0.5, 1.0)); - Luma[1] = dot(Sample[1].rgb, float3(0.5, 0.5, 1.0)); - Luma[2] = dot(Sample[2].rgb, float3(0.5, 0.5, 1.0)); - Luma[3] = dot(Sample[3].rgb, float3(0.5, 0.5, 1.0)); - Luma[4] = dot(Sample[4].rgb, float3(0.5, 0.5, 1.0)); + Luma[0] = dot(Sample[0].rgb, 2.0 / 3.0); + Luma[1] = dot(Sample[1].rgb, 2.0 / 3.0); + Luma[2] = dot(Sample[2].rgb, 2.0 / 3.0); + Luma[3] = dot(Sample[3].rgb, 2.0 / 3.0); + Luma[4] = dot(Sample[4].rgb, 2.0 / 3.0); // Noise detection using a normalized local contrast filter float Noise = ((Luma[1] + Luma[2] + Luma[3] + Luma[4]) * 0.25) - Luma[0];