time to revive the thread. I’m currently working on ScaleFX and there is also a variant similar to Hyllians xBR-hybrid which combies ScaleFX and reverseAA. while improving my shader I noticed that rAA causes some artifacts especially with high sharpness values. this is called ringing which reminded me of a no-ring workaround for sharp resize filters I saw a while back on avisynth discussions on doom9. it’s actually rather simple:
LanczosResize(dest_x,dest_y).Repair(Gaussresize(dest_x,dest_y,p=100),1)
so what does it do? well the picture is resized with some filter (in this case Lanczos) and then we clamp the pixels by taking the min and max of the 3x3 pixels around it (Repair mode 1) of the point resized picture at the same resolution (gaussresize with harpness 100). this completely eliminates all ringing artifacts. I used the same concept on rAA. if you look at the code you’ll see that the algorithm uses the following pixels:
B1
B
D0 D E F F4
H
H5
this is what I changed:
// original
float3 res = saturate(E + fp.y*t1 + fp.x*t2);
return float4(res, 1.0);
-----------------------------------------------------------------
// no-ring
float3 res = E + fp.y*t1 + fp.x*t2;
float3 a = min(min(min(min(B,D),E),F),H);
float3 b = max(max(max(max(B,D),E),F),H);
return float4(clamp(res, a, b), 1.0);
download:
https://mega.nz/#!uF4BELTa!311U9Z-MH2I4yKtS0zITSqbxjnThlkJCfYvs3A86XCE
and two examples of it in action (rAA_sharpness = 2.0):
http://screenshotcomparison.com/comparison/165611/
the original frames: