]> git.sesse.net Git - nageru/commitdiff
Fix the texel centers for motion search. Helps a whole lot.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 7 Jul 2018 09:08:05 +0000 (11:08 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 7 Jul 2018 09:08:05 +0000 (11:08 +0200)
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.