Hi,
Very nice results! Unfortunately I could not reproduce them no matter how. So I came up with my own version of your filter. It requires slightly less samples and still gives very good results.
I made a blog entry about it and here is the GLSL filter. w controls the width of the filter (how large the edges will get) and the threshold (hard-coded comparison to 1.0/6.0) prevents over blurring edges that might not need it.
float lumRGB(vec3 v){ return dot(v, vec3(0.212, 0.716, 0.072)); } void main(){ vec2 UV = gl_FragCoord.xy * inverse_buffer_size; float w = 1.75; float t = lumRGB(texture2D(source, UV + vec2(0.0, -1.0) * w * inverse_buffer_size).xyz), l = lumRGB(texture2D(source, UV + vec2(-1.0, 0.0) * w * inverse_buffer_size).xyz), r = lumRGB(texture2D(source, UV + vec2(1.0, 0.0) * w * inverse_buffer_size).xyz), b = lumRGB(texture2D(source, UV + vec2(0.0, 1.0) * w * inverse_buffer_size).xyz); vec2 n = vec2(-(t - b), r - l); float nl = length(n); if (nl < (1.0 / 16.0)) gl_FragColor = texture2D(source, UV); else { n *= inverse_buffer_size / nl; vec4 o = texture2D(source, UV), t0 = texture2D(source, UV + n * 0.5) * 0.9, t1 = texture2D(source, UV - n * 0.5) * 0.9, t2 = texture2D(source, UV + n) * 0.75, t3 = texture2D(source, UV - n) * 0.75; gl_FragColor = (o + t0 + t1 + t2 + t3) / 4.3; }}
Btw, I played with temporal anti-aliasing and there really is something great to be done on this front too. The main issue to solve is about how to combine jittered frames without introducing too much ghosting artifacts.
Cheers