Skip to content

Commit

Permalink
cRCAS: Update Luma calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
papadanku committed Sep 8, 2024
1 parent 31583c8 commit 490c538
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions shaders/cCAS.fx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
4 changes: 2 additions & 2 deletions shaders/cRCAS.fx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
10 changes: 5 additions & 5 deletions shaders/shared/fidelityfx/cRCAS.fxh
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 490c538

Please sign in to comment.