From 629f08f7b18fb072e9d83642a798236d0409f827 Mon Sep 17 00:00:00 2001 From: Jonatas Esteves Date: Mon, 13 Sep 2021 21:16:41 -0300 Subject: [PATCH] SMAA: Fix color edge detection Fix incorrect calculation of local contrast adaption in color edge detection This is the fix from PR iryoku/smaa#11 --- anti-aliasing/shaders/smaa/SMAA.hlsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/anti-aliasing/shaders/smaa/SMAA.hlsl b/anti-aliasing/shaders/smaa/SMAA.hlsl index 2c8d497..5b807fe 100644 --- a/anti-aliasing/shaders/smaa/SMAA.hlsl +++ b/anti-aliasing/shaders/smaa/SMAA.hlsl @@ -792,11 +792,11 @@ float2 SMAAColorEdgeDetectionPS(float2 texcoord, // Calculate left-left and top-top deltas: float3 Cleftleft = SMAASamplePoint(colorTex, offset[2].xy).rgb; - t = abs(C - Cleftleft); + t = abs(Cleft - Cleftleft); delta.z = max(max(t.r, t.g), t.b); float3 Ctoptop = SMAASamplePoint(colorTex, offset[2].zw).rgb; - t = abs(C - Ctoptop); + t = abs(Ctop - Ctoptop); delta.w = max(max(t.r, t.g), t.b); // Calculate the final maximum delta: