]> git.sesse.net Git - nageru/blobdiff - motion_search.frag
Fix the texel centers for motion search. Helps a whole lot.
[nageru] / motion_search.frag
index 262dca53a9bc8aaae7abb30e83b85fdd90c01173..927ecc5634ef10488925bd4f5695cff2f02a614e 100644 (file)
@@ -49,7 +49,7 @@ void main()
 {
        // Lock patch_bottom_left_texel to an integer, so that we never get
        // any bilinear artifacts for the gradient.
-       vec2 base = round(patch_bottom_left_texel * image_size)
+       vec2 base = (round(patch_bottom_left_texel * image_size - vec2(0.5, 0.5)) + vec2(0.5, 0.5))
                * inv_image_size;
 
        // First, precompute the pseudo-Hessian for the template patch.